Skip to content

Commit 0809fdb

Browse files
committed
css fixes
1 parent f78b6a5 commit 0809fdb

2 files changed

Lines changed: 25 additions & 14 deletions

File tree

components/Auth.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function Auth({
2222
{renderAuth(type, setServerError, setAuthType)}
2323
</div>
2424
{type == 'login' ? (
25-
<div className=" flex justify-center mt-9">
25+
<div className=" flex justify-center mt-7">
2626
<div className="text-frost-600 text-lg">
2727
Not registered?{' '}
2828
<span
@@ -65,7 +65,12 @@ function renderAuth(
6565
<Register setServerError={setServerError} setAuthType={setAuthType} />
6666
);
6767
case 'resetPassword':
68-
return <PasswordReset setServerError={setServerError} setAuthType={setAuthType} />;
68+
return (
69+
<PasswordReset
70+
setServerError={setServerError}
71+
setAuthType={setAuthType}
72+
/>
73+
);
6974
default:
7075
return (
7176
<Login setServerError={setServerError} setAuthType={setAuthType} />

components/forms/UpdatePassword.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { Input } from './Styles';
22
import styles from '@/styles/Auth.module.css';
3-
import { createUpdatePasswordSchema, CreateUpdatePasswordInput } from '@/types/client/updatePassword';
3+
import {
4+
createUpdatePasswordSchema,
5+
CreateUpdatePasswordInput,
6+
} from '@/types/client/updatePassword';
47
import { useForm } from 'react-hook-form';
58
import { zodResolver } from '@hookform/resolvers/zod';
69
import { Database } from '@/types/database.supabase';
@@ -10,7 +13,11 @@ import { toast } from 'react-toastify';
1013
import { useRouter } from 'next/router';
1114
import PasswordIcon from '../icons/PasswordIcon';
1215

13-
export default function UpdatePassword({setServerError} : {setServerError: Dispatch<SetStateAction<string | null>>;}) {
16+
export default function UpdatePassword({
17+
setServerError,
18+
}: {
19+
setServerError: Dispatch<SetStateAction<string | null>>;
20+
}) {
1421
const router = useRouter();
1522
const supabase = useSupabaseClient<Database>();
1623

@@ -20,12 +27,12 @@ export default function UpdatePassword({setServerError} : {setServerError: Dispa
2027
formState: { errors, isSubmitting },
2128
} = useForm<CreateUpdatePasswordInput>({
2229
resolver: zodResolver(createUpdatePasswordSchema),
23-
mode: 'onChange'
30+
mode: 'onChange',
2431
});
2532

2633
const onSubmit = async (formData: CreateUpdatePasswordInput) => {
2734
const { data, error } = await supabase.auth.updateUser({
28-
password: formData.password
35+
password: formData.password,
2936
});
3037

3138
if (error) {
@@ -37,25 +44,24 @@ export default function UpdatePassword({setServerError} : {setServerError: Dispa
3744
if (data && !error) {
3845
toast.success('Password successfully updated', {
3946
position: 'top-center',
40-
autoClose: 3000
47+
autoClose: 3000,
4148
});
4249
router.push('/');
4350
}
4451
};
4552

46-
4753
return (
48-
<form className="flex flex-col mt-7" onSubmit={handleSubmit(onSubmit)} >
54+
<form className="flex flex-col mt-7" onSubmit={handleSubmit(onSubmit)}>
4955
<label htmlFor="email" className="mt-6">
5056
New Password:
5157
</label>
52-
<div className='mt-3 relative'>
58+
<div className="mt-3 relative">
5359
<div className={`${errors.password ? styles.iconError : styles.icon} `}>
54-
<PasswordIcon/>
60+
<PasswordIcon />
5561
</div>
5662
<input
5763
type="password"
58-
className={`${Input} ${styles.input}`}
64+
className={`${Input()} ${styles.input}`}
5965
placeholder="Enter password"
6066
{...register('password')}
6167
></input>
@@ -72,11 +78,11 @@ export default function UpdatePassword({setServerError} : {setServerError: Dispa
7278
errors.passwordConfirmation ? styles.iconError : styles.icon
7379
} `}
7480
>
75-
<PasswordIcon/>
81+
<PasswordIcon />
7682
</div>
7783
<input
7884
type="password"
79-
className={`${Input} ${styles.input}`}
85+
className={`${Input()} ${styles.input}`}
8086
placeholder="Confirm password"
8187
{...register('passwordConfirmation')}
8288
></input>

0 commit comments

Comments
 (0)