Skip to content
Closed
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
16 changes: 8 additions & 8 deletions components/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface LinkComponentProps {
children: React.ReactNode;
locale?: string;
href?: string;
legacyBehavior?: boolean;

target?: string;
rel?: string;
}
Expand All @@ -19,12 +19,12 @@ interface LinkComponentProps {
* @param {React.ReactNode} props.children - The content to render within the Link.
* @param {string} [props.locale] - The locale for the link.
* @param {string} [props.href] - The URL the link points to.
* @param {boolean} [props.legacyBehavior=false] - Whether to use the legacy behavior for the link.

*/
export default function LinkComponent({
children,
locale,
legacyBehavior = false,

target = '_self',
rel = '',
...props
Expand All @@ -34,7 +34,7 @@ export default function LinkComponent({
// If there is no router available (e.g., during server-side rendering & cypress tests), render a standard Link
if (!router) {
return (
<Link href={props.href || ''} legacyBehavior={legacyBehavior} target={target} rel={rel}>
<Link href={props.href || ''} target={target} rel={rel}>
{children}
</Link>
);
Expand All @@ -55,7 +55,7 @@ export default function LinkComponent({
*/
if ((props.href && i18nPaths[language] && !i18nPaths[language].includes(href)) || href.includes('http', 0)) {
return (
<Link href={href} legacyBehavior={legacyBehavior} passHref target={target} rel={rel}>
<Link href={href} target={target} rel={rel}>
{children}
</Link>
);
Expand All @@ -78,7 +78,7 @@ export default function LinkComponent({
href = href.replace(/([^:/]|^)\/{2,}/g, '$1/');

return (
<Link href={href} legacyBehavior={legacyBehavior} target={target} rel={rel} passHref>
<Link href={href} target={target} rel={rel} >
{children}
</Link>
);
Expand All @@ -87,12 +87,12 @@ export default function LinkComponent({
export const LinkText = ({
href,
children,
legacyBehavior = false,

target = '_self',
rel = ''
}: LinkComponentProps) => {
return (
<Link href={href || ''} target={target} rel={rel} legacyBehavior={legacyBehavior}>
<Link href={href || ''} target={target} rel={rel} >
{children}
</Link>
);
Expand Down
Loading
Loading