Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAI-460 Removal of legacyBehaviour from next.js links #1573

Merged
merged 9 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/pages/help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export default function Help() {
To find out more about Bailo please see our documentation pages.
</Typography>
</CardContent>
<CardActions>
<Link passHref href='/docs' legacyBehavior>
<CardActions sx={{ justifyContent: 'center' }}>
<Link passHref href='/docs'>
<Button variant='contained' sx={{ mx: 'auto', mb: 2, width: 200 }} data-test='documentationLink'>
View documentation
</Button>
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface NextLinkComposedProps

export const NextLinkComposed = forwardRef<HTMLAnchorElement, NextLinkComposedProps>(
function NextLinkComposed(props, ref) {
const { to, linkAs, replace, scroll, shallow, prefetch, legacyBehavior = true, locale, ...other } = props
const { to, linkAs, replace, scroll, shallow, prefetch, locale, ...other } = props

return (
<NextLink
Expand All @@ -29,9 +29,10 @@ export const NextLinkComposed = forwardRef<HTMLAnchorElement, NextLinkComposedPr
shallow={shallow}
passHref
locale={locale}
legacyBehavior={legacyBehavior}
ref={ref}
{...other}
>
<Anchor ref={ref} {...other} />
{props.children}
</NextLink>
)
},
Expand All @@ -54,7 +55,6 @@ const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(props, ref)
as,
className: classNameProps,
href,
legacyBehavior,
linkAs: linkAsProp,
locale,
noLinkStyle,
Expand Down Expand Up @@ -90,7 +90,6 @@ const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(props, ref)
scroll,
shallow,
prefetch,
legacyBehavior,
locale,
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/docs/DocsWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function DocsWrapper({ children }: DocsWrapperProps): ReactElemen
<ListItemText primary={doc.title} primaryTypographyProps={{ fontWeight: 'bold' }} />
</ListItem>
) : (
<Link passHref href={path} legacyBehavior>
<Link passHref href={path} style={{ textDecoration: 'none', color: 'inherit' }}>
<ListItemButton dense selected={isSelected} sx={{ pl: paddingLeft }}>
<ListItemText
primary={doc.title}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/docs/IntroCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function IntroCard({ title, user, url, children }: IntroCardProps
</Typography>
</CardContent>
<CardActions>
<Link passHref href={url} legacyBehavior>
<Link passHref href={url}>
<Button size='small'>Learn More</Button>
</Link>
</CardActions>
Expand Down
Loading