Refactor auth methods, remove i18n, and update UI

This commit covers a variety of actions that includes the refactoring of the authentication components to accept paths and invite tokens as props instead of a singular callback prop, thereby improving the component's flexibility. This refactor process removes 'withI18n' calls as i18n functionalities are no longer used. The commit also contains several adjustments to the UI components, including the authorization layout, pricing table, and sign-up page. It also includes minor changes to error messages, specifically those related to password resetting. Lastly, several peer dependencies are removed in the 'package.json' files and changes made to the 'browser.client.ts' file providing a significant code cleanup.
This commit is contained in:
giancarlo
2024-03-27 01:19:20 +08:00
parent cabdd832df
commit 8a614bd6fc
29 changed files with 215 additions and 204 deletions

View File

@@ -3,6 +3,11 @@
import Link from 'next/link';
import { zodResolver } from '@hookform/resolvers/zod';
import {
ArrowLeftIcon,
CheckIcon,
ExclamationTriangleIcon,
} from '@radix-ui/react-icons';
import { useForm } from 'react-hook-form';
import type { z } from 'zod';
@@ -112,7 +117,9 @@ export function PasswordResetForm(params: { redirectTo: string }) {
function SuccessState() {
return (
<div className={'flex flex-col space-y-4'}>
<Alert variant={'destructive'}>
<Alert variant={'success'}>
<CheckIcon className={'s-6'} />
<AlertTitle>
<Trans i18nKey={'account:updatePasswordSuccess'} />
</AlertTitle>
@@ -123,8 +130,12 @@ function SuccessState() {
</Alert>
<Link href={'/'}>
<Button variant={'outline'}>
<Trans i18nKey={'common:backToHomePage'} />
<Button variant={'outline'} className={'w-full'}>
<ArrowLeftIcon className={'mr-2 h-4'} />
<span>
<Trans i18nKey={'common:backToHomePage'} />
</span>
</Button>
</Link>
</div>
@@ -135,12 +146,14 @@ function ErrorState(props: { onRetry: () => void }) {
return (
<div className={'flex flex-col space-y-4'}>
<Alert variant={'destructive'}>
<ExclamationTriangleIcon className={'s-6'} />
<AlertTitle>
<Trans i18nKey={'auth:resetPasswordError'} />
<Trans i18nKey={'common:genericError'} />
</AlertTitle>
<AlertDescription>
<Trans i18nKey={'common:genericError'} />
<Trans i18nKey={'auth:resetPasswordError'} />
</AlertDescription>
</Alert>