fix(BOOK-325): Added refetch options to user.name query and refactored header
Approved-by: Linus Flood Approved-by: Matilda Landström
This commit is contained in:
@@ -4,12 +4,24 @@ import HeaderLink from "../HeaderLink"
|
||||
|
||||
import styles from "./topLink.module.css"
|
||||
|
||||
import type { TopLinkProps } from "@/types/components/header/topLink"
|
||||
import type { Header } from "@scandic-hotels/trpc/types/header"
|
||||
import type { ComponentProps } from "react"
|
||||
|
||||
export interface TopLinkProps
|
||||
extends Omit<
|
||||
ComponentProps<typeof HeaderLink>,
|
||||
"href" | "iconName" | "children"
|
||||
> {
|
||||
isLoggedIn: boolean
|
||||
topLink: Header["header"]["topLink"]
|
||||
iconSize?: number
|
||||
}
|
||||
|
||||
export default function TopLink({
|
||||
isLoggedIn,
|
||||
topLink,
|
||||
iconSize = 16,
|
||||
...props
|
||||
}: TopLinkProps) {
|
||||
const linkData = isLoggedIn ? topLink.logged_in : topLink.logged_out
|
||||
|
||||
@@ -22,6 +34,7 @@ export default function TopLink({
|
||||
href={linkData.url}
|
||||
iconName={linkData.icon || IconName.Gift}
|
||||
iconSize={iconSize}
|
||||
{...props}
|
||||
>
|
||||
<span className={styles.topLink}>{linkData.title}</span>
|
||||
</HeaderLink>
|
||||
|
||||
Reference in New Issue
Block a user