summaryrefslogtreecommitdiff
path: root/src/lib/auth/components/PersonalProfile.jsx
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-04-11 09:47:25 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-04-11 09:47:25 +0700
commit92c2a229d9c9b510d71b928978872a8b107e9d5a (patch)
tree8d8161a49a0bdc46d4c28d3f2682bb485314a41d /src/lib/auth/components/PersonalProfile.jsx
parent62bebc1d33fd090d7666e18e7a0326ef7ef36897 (diff)
Documentation and refactor code
Diffstat (limited to 'src/lib/auth/components/PersonalProfile.jsx')
-rw-r--r--src/lib/auth/components/PersonalProfile.jsx32
1 files changed, 6 insertions, 26 deletions
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 (
<>
- <button
- type='button'
- onClick={toggle}
- className='p-4 flex items-center text-left'
- >
+ <button type='button' onClick={toggle} className='p-4 flex items-center text-left'>
<div>
<div className='font-semibold mb-2'>Informasi Akun</div>
<div className='text-gray_r-11'>
@@ -71,28 +67,15 @@ const PersonalProfile = () => {
>
<div>
<label>Email</label>
- <input
- {...register('email')}
- type='text'
- disabled
- className='form-input mt-3'
- />
+ <input {...register('email')} type='text' disabled className='form-input mt-3' />
</div>
<div>
<label>Nama Lengkap</label>
- <input
- {...register('name')}
- type='text'
- className='form-input mt-3'
- />
+ <input {...register('name')} type='text' className='form-input mt-3' />
</div>
<div>
<label>No. Handphone</label>
- <input
- {...register('mobile')}
- type='tel'
- className='form-input mt-3'
- />
+ <input {...register('mobile')} type='tel' className='form-input mt-3' />
</div>
<div>
<label>Kata Sandi</label>
@@ -103,10 +86,7 @@ const PersonalProfile = () => {
placeholder='Isi jika ingin mengubah kata sandi'
/>
</div>
- <button
- type='submit'
- className='btn-yellow w-full mt-2'
- >
+ <button type='submit' className='btn-yellow w-full mt-2'>
Simpan
</button>
</form>