Add ArrowRight icon to signUp and signIn buttons

A new `ArrowRight` icon from `lucide-react` library is introduced to the signUp and signIn buttons on the auth source code. CSS animation properties are applied to the icon for better interactiveness and user experience.
This commit is contained in:
giancarlo
2024-04-21 13:03:01 +08:00
parent c5b70d7b62
commit b1f2e435aa
2 changed files with 25 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
import Link from 'next/link';
import { zodResolver } from '@hookform/resolvers/zod';
import { ArrowRight } from 'lucide-react';
import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import type { z } from 'zod';
@@ -103,13 +104,23 @@ export const PasswordSignInForm: React.FC<{
<Button
data-test="auth-submit-button"
className={'w-full'}
className={'group w-full'}
type="submit"
disabled={loading}
>
<If
condition={loading}
fallback={<Trans i18nKey={'auth:signInWithEmail'} />}
fallback={
<>
<Trans i18nKey={'auth:signInWithEmail'} />
<ArrowRight
className={
'zoom-in animate-in slide-in-from-left-2 fill-mode-both h-4 delay-500 duration-500'
}
/>
</>
}
>
<Trans i18nKey={'auth:signingIn'} />
</If>

View File

@@ -1,6 +1,7 @@
'use client';
import { zodResolver } from '@hookform/resolvers/zod';
import { ArrowRight } from 'lucide-react';
import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
@@ -129,7 +130,17 @@ export const PasswordSignUpForm: React.FC<{
>
<If
condition={loading}
fallback={<Trans i18nKey={'auth:signUpWithEmail'} />}
fallback={
<>
<Trans i18nKey={'auth:signUpWithEmail'} />
<ArrowRight
className={
'zoom-in animate-in slide-in-from-left-2 fill-mode-both h-4 delay-500 duration-500'
}
/>
</>
}
>
<Trans i18nKey={'auth:signingUp'} />
</If>