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.
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import Link from 'next/link';
|
|
|
|
import { SignInMethodsContainer } from '@kit/auth/sign-in';
|
|
import { Button } from '@kit/ui/button';
|
|
import { Heading } from '@kit/ui/heading';
|
|
import { Trans } from '@kit/ui/trans';
|
|
|
|
import authConfig from '~/config/auth.config';
|
|
import pathsConfig from '~/config/paths.config';
|
|
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
|
import { withI18n } from '~/lib/i18n/with-i18n';
|
|
|
|
export const generateMetadata = async () => {
|
|
const i18n = await createI18nServerInstance();
|
|
|
|
return {
|
|
title: i18n.t('auth:signIn'),
|
|
};
|
|
};
|
|
|
|
const paths = {
|
|
callback: pathsConfig.auth.callback,
|
|
home: pathsConfig.app.home,
|
|
};
|
|
|
|
function SignInPage() {
|
|
return (
|
|
<>
|
|
<Heading level={4}>
|
|
<Trans i18nKey={'auth:signInHeading'} />
|
|
</Heading>
|
|
|
|
<SignInMethodsContainer paths={paths} providers={authConfig.providers} />
|
|
|
|
<div className={'flex justify-center'}>
|
|
<Button asChild variant={'link'} size={'sm'}>
|
|
<Link href={pathsConfig.auth.signUp}>
|
|
<Trans i18nKey={'auth:doNotHaveAccountYet'} />
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default withI18n(SignInPage);
|