refactor: add scroll prop to Link

This commit is contained in:
Chuma McPhoy
2024-07-12 14:18:20 +02:00
parent 70e1f39f5b
commit f78e74d3e3
3 changed files with 9 additions and 1 deletions

View File

@@ -36,7 +36,12 @@ export default async function AmenitiesList({
)
})}
</div>
<Link href={"?sidepeek=amenities"} color="burgundy" variant="icon">
<Link
scroll={false}
href={"?sidepeek=amenities"}
color="burgundy"
variant="icon"
>
{formatMessage({ id: "Show all amenities" })}
<ChevronRightIcon />
</Link>

View File

@@ -13,6 +13,7 @@ export default function Link({
partialMatch = false,
textDecoration,
size,
scroll = true,
prefetch,
variant,
...props
@@ -32,6 +33,7 @@ export default function Link({
})
return (
<NextLink
scroll={scroll}
prefetch={prefetch}
className={classNames}
href={href}

View File

@@ -6,6 +6,7 @@ export interface LinkProps
extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "color">,
VariantProps<typeof linkVariants> {
href: string
scroll?: boolean
partialMatch?: boolean
prefetch?: boolean
}