Update nesting of Button and Link components
The Link component is modified to be nested within the Button component in various JSX files. This change was made with the aid of the 'asChild' property, it ensures that the link remains operable even when wrapped by the button, improving the site's semantics and accessibility.
This commit is contained in:
@@ -71,15 +71,15 @@ function AuthButtons() {
|
||||
<div className={'hidden space-x-0.5 md:flex'}>
|
||||
<ModeToggle className={textClassName} />
|
||||
|
||||
<Link href={pathsConfig.auth.signIn}>
|
||||
<Button variant={'ghost'} className={textClassName}>
|
||||
<Button asChild variant={'ghost'} className={textClassName}>
|
||||
<Link href={pathsConfig.auth.signIn}>
|
||||
<Trans i18nKey={'auth:signIn'} />
|
||||
</Button>
|
||||
</Link>
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Link href={pathsConfig.auth.signUp}>
|
||||
<Button className="group" variant={'default'}>
|
||||
<Button asChild className="group" variant={'default'}>
|
||||
<Link href={pathsConfig.auth.signUp}>
|
||||
<Trans i18nKey={'auth:signUp'} />
|
||||
|
||||
<ChevronRight
|
||||
@@ -87,8 +87,8 @@ function AuthButtons() {
|
||||
'ml-1 h-4 w-4 transition-transform duration-500 group-hover:translate-x-1'
|
||||
}
|
||||
/>
|
||||
</Button>
|
||||
</Link>
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ function MobileDropdown() {
|
||||
const className = 'flex w-full h-full items-center';
|
||||
|
||||
return (
|
||||
<DropdownMenuItem key={item.path}>
|
||||
<DropdownMenuItem key={item.path} asChild>
|
||||
<Link className={className} href={item.path}>
|
||||
<Trans i18nKey={item.label} />
|
||||
</Link>
|
||||
|
||||
@@ -86,15 +86,15 @@ async function FAQPage() {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Link href={'/contact'}>
|
||||
<Button variant={'outline'}>
|
||||
<Button variant={'outline'}>
|
||||
<Link asChild href={'/contact'}>
|
||||
<span>
|
||||
<Trans i18nKey={'marketing:contactFaq'} />
|
||||
</span>
|
||||
|
||||
<ArrowRight className={'ml-2 w-4'} />
|
||||
</Button>
|
||||
</Link>
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -347,14 +347,14 @@ function FeatureContainer(
|
||||
function MainCallToActionButton() {
|
||||
return (
|
||||
<div className={'flex space-x-2'}>
|
||||
<Link href={'/docs'}>
|
||||
<Button variant={'link'}>
|
||||
<Button asChild variant={'link'}>
|
||||
<Link href={'/docs'}>
|
||||
<Trans i18nKey={'common:documentation'} />
|
||||
</Button>
|
||||
</Link>
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
<Link href={'/auth/sign-up'}>
|
||||
<Button>
|
||||
<Button asChild>
|
||||
<Link href={'/auth/sign-up'}>
|
||||
<span className={'flex items-center space-x-0.5'}>
|
||||
<span>
|
||||
<Trans i18nKey={'common:getStarted'} />
|
||||
@@ -367,8 +367,8 @@ function MainCallToActionButton() {
|
||||
}
|
||||
/>
|
||||
</span>
|
||||
</Button>
|
||||
</Link>
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user