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:
giancarlo
2024-04-25 10:57:56 +07:00
parent 944197b84a
commit 19332d124d
12 changed files with 63 additions and 61 deletions

View File

@@ -39,7 +39,7 @@ function AuthCallbackErrorPage({ searchParams }: Params) {
</Alert>
</div>
<Button>
<Button asChild>
<Link href={signInPath}>
<Trans i18nKey={'auth:signIn'} />
</Link>

View File

@@ -31,11 +31,11 @@ function PasswordResetPage() {
<PasswordResetRequestContainer redirectPath={redirectPath} />
<div className={'flex justify-center text-xs'}>
<Link href={signIn}>
<Button variant={'link'} size={'sm'}>
<Button asChild variant={'link'} size={'sm'}>
<Link href={signIn}>
<Trans i18nKey={'auth:passwordRecoveredQuestion'} />
</Button>
</Link>
</Link>
</Button>
</div>
</div>
</>

View File

@@ -33,11 +33,11 @@ function SignInPage() {
<SignInMethodsContainer paths={paths} providers={authConfig.providers} />
<div className={'flex justify-center'}>
<Link href={pathsConfig.auth.signUp}>
<Button variant={'link'} size={'sm'}>
<Button asChild variant={'link'} size={'sm'}>
<Link href={pathsConfig.auth.signUp}>
<Trans i18nKey={'auth:doNotHaveAccountYet'} />
</Button>
</Link>
</Link>
</Button>
</div>
</>
);

View File

@@ -45,11 +45,11 @@ function SignUpPage({ searchParams }: Props) {
/>
<div className={'justify-centers flex'}>
<Link href={pathsConfig.auth.signIn}>
<Button variant={'link'} size={'sm'}>
<Button asChild variant={'link'} size={'sm'}>
<Link href={pathsConfig.auth.signIn}>
<Trans i18nKey={'auth:alreadyHaveAnAccount'} />
</Button>
</Link>
</Link>
</Button>
</div>
</>
);