From 92c2a229d9c9b510d71b928978872a8b107e9d5a Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 11 Apr 2023 09:47:25 +0700 Subject: Documentation and refactor code --- src/lib/auth/components/Activate.jsx | 52 ++++++++--------------------- src/lib/auth/components/CompanyProfile.jsx | 37 ++++---------------- src/lib/auth/components/Login.jsx | 4 +-- src/lib/auth/components/PersonalProfile.jsx | 32 ++++-------------- src/lib/auth/components/RegisterDesktop.jsx | 20 ++++++++--- src/lib/auth/components/RegisterMobile.jsx | 2 +- 6 files changed, 45 insertions(+), 102 deletions(-) (limited to 'src/lib/auth/components') diff --git a/src/lib/auth/components/Activate.jsx b/src/lib/auth/components/Activate.jsx index 717e178b..c81bcbbd 100644 --- a/src/lib/auth/components/Activate.jsx +++ b/src/lib/auth/components/Activate.jsx @@ -27,10 +27,7 @@ const Activate = () => { children: ( <> Selamat, akun anda berhasil diaktifkan,{' '} - + kembali ke beranda . @@ -43,10 +40,7 @@ const Activate = () => { children: ( <> Mohon maaf token sudah tidak aktif, lakukan permintaan aktivasi akun kembali atau{' '} - + masuk {' '} jika sudah memiliki akun. @@ -67,9 +61,12 @@ const Activate = () => { const activationRequest = async (e) => { e.preventDefault() setIsLoading(true) - let activationRequest = await axios.post(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/activation-request`, { - email - }) + let activationRequest = await axios.post( + `${process.env.NEXT_PUBLIC_SELF_HOST}/api/activation-request`, + { + email + } + ) if (activationRequest.data.activationRequest) { setAlert({ children: <>Mohon cek email anda untuk aktivasi akun Indoteknik, @@ -82,10 +79,7 @@ const Activate = () => { children: ( <> Email tersebut belum terdaftar,{' '} - + daftar sekarang . @@ -99,10 +93,7 @@ const Activate = () => { children: ( <> Email tersebut sudah terdaftar dan sudah aktif,{' '} - + masuk sekarang . @@ -119,29 +110,18 @@ const Activate = () => { return (
- Logo Indoteknik + Logo Indoteknik

Aktivasi Akun Indoteknik

{alert && ( - + {alert.children} )} -
+ { placeholder='Masukan alamat email' autoFocus /> -
diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx index 1b25551e..854aa246 100644 --- a/src/lib/auth/components/CompanyProfile.jsx +++ b/src/lib/auth/components/CompanyProfile.jsx @@ -69,11 +69,7 @@ const CompanyProfile = () => { return ( <> - diff --git a/src/lib/auth/components/Login.jsx b/src/lib/auth/components/Login.jsx index 171ff4c8..cbcfd07b 100644 --- a/src/lib/auth/components/Login.jsx +++ b/src/lib/auth/components/Login.jsx @@ -1,5 +1,5 @@ -import LoginDesktop from "./LoginDesktop" -import LoginMobile from "./LoginMobile" +import LoginDesktop from './LoginDesktop' +import LoginMobile from './LoginMobile' const Login = () => { return ( diff --git a/src/lib/auth/components/PersonalProfile.jsx b/src/lib/auth/components/PersonalProfile.jsx index 4f606ed4..4a533ae9 100644 --- a/src/lib/auth/components/PersonalProfile.jsx +++ b/src/lib/auth/components/PersonalProfile.jsx @@ -34,7 +34,7 @@ const PersonalProfile = () => { let data = values if (!values.password) delete data.password const isUpdated = await editPersonalProfileApi({ data }) - + if (isUpdated?.user) { setAuth(isUpdated.user) setValue('password', '') @@ -47,11 +47,7 @@ const PersonalProfile = () => { return ( <> - diff --git a/src/lib/auth/components/RegisterDesktop.jsx b/src/lib/auth/components/RegisterDesktop.jsx index ac6ac960..482a9ce3 100644 --- a/src/lib/auth/components/RegisterDesktop.jsx +++ b/src/lib/auth/components/RegisterDesktop.jsx @@ -89,9 +89,19 @@ const RegisterDesktop = () => { placeholder='••••••••••••' />
-
- - +
+ +