diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-22 23:36:47 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-22 23:36:47 +0700 |
| commit | ac3fdf7be9982e65d8f83a20bc487f8dd62e3bfc (patch) | |
| tree | 687d984708708833999c9b83f1e74e32cf64b1c1 /src/lib/address/components | |
| parent | 8cfb615556e67408d7afb6d9694b2407447085ff (diff) | |
fix
Diffstat (limited to 'src/lib/address/components')
| -rw-r--r-- | src/lib/address/components/CreateAddress.jsx | 58 | ||||
| -rw-r--r-- | src/lib/address/components/EditAddress.jsx | 58 |
2 files changed, 98 insertions, 18 deletions
diff --git a/src/lib/address/components/CreateAddress.jsx b/src/lib/address/components/CreateAddress.jsx index 62bb0858..849b4c01 100644 --- a/src/lib/address/components/CreateAddress.jsx +++ b/src/lib/address/components/CreateAddress.jsx @@ -88,20 +88,34 @@ const CreateAddress = () => { } return ( - <form className='p-4 flex flex-col gap-y-4' onSubmit={handleSubmit(onSubmitHandler)}> + <form + className='p-4 flex flex-col gap-y-4' + onSubmit={handleSubmit(onSubmitHandler)} + > <div> <label className='form-label mb-2'>Label Alamat</label> <Controller name='type' control={control} - render={(props) => <HookFormSelect {...props} isSearchable={false} options={types} />} + render={(props) => ( + <HookFormSelect + {...props} + isSearchable={false} + options={types} + /> + )} /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.type?.message}</div> </div> <div> <label className='form-label mb-2'>Nama</label> - <input {...register('name')} placeholder='John Doe' type='text' className='form-input' /> + <input + {...register('name')} + placeholder='John Doe' + type='text' + className='form-input' + /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.name?.message}</div> </div> @@ -118,7 +132,12 @@ const CreateAddress = () => { <div> <label className='form-label mb-2'>Mobile</label> - <input {...register('mobile')} placeholder='08xxxxxxxx' type='tel' className='form-input' /> + <input + {...register('mobile')} + placeholder='08xxxxxxxx' + type='tel' + className='form-input' + /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.mobile?.message}</div> </div> @@ -135,7 +154,12 @@ const CreateAddress = () => { <div> <label className='form-label mb-2'>Kode Pos</label> - <input {...register('zip')} placeholder='10100' type='number' className='form-input' /> + <input + {...register('zip')} + placeholder='10100' + type='number' + className='form-input' + /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.zip?.message}</div> </div> @@ -144,7 +168,12 @@ const CreateAddress = () => { <Controller name='city' control={control} - render={(props) => <HookFormSelect {...props} options={cities} />} + render={(props) => ( + <HookFormSelect + {...props} + options={cities} + /> + )} /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.city?.message}</div> </div> @@ -155,7 +184,11 @@ const CreateAddress = () => { name='district' control={control} render={(props) => ( - <HookFormSelect {...props} options={districts} disabled={!watchCity} /> + <HookFormSelect + {...props} + options={districts} + disabled={!watchCity} + /> )} /> </div> @@ -166,12 +199,19 @@ const CreateAddress = () => { name='subDistrict' control={control} render={(props) => ( - <HookFormSelect {...props} options={subDistricts} disabled={!watchDistrict} /> + <HookFormSelect + {...props} + options={subDistricts} + disabled={!watchDistrict} + /> )} /> </div> - <button type='submit' className='btn-yellow mt-2 w-full'> + <button + type='submit' + className='btn-yellow mt-2 w-full' + > Simpan </button> </form> diff --git a/src/lib/address/components/EditAddress.jsx b/src/lib/address/components/EditAddress.jsx index 0cfa013a..a832edbc 100644 --- a/src/lib/address/components/EditAddress.jsx +++ b/src/lib/address/components/EditAddress.jsx @@ -102,20 +102,34 @@ const EditAddress = ({ id, defaultValues }) => { } return ( - <form className='p-4 flex flex-col gap-y-4' onSubmit={handleSubmit(onSubmitHandler)}> + <form + className='p-4 flex flex-col gap-y-4' + onSubmit={handleSubmit(onSubmitHandler)} + > <div> <label className='form-label mb-2'>Label Alamat</label> <Controller name='type' control={control} - render={(props) => <HookFormSelect {...props} isSearchable={false} options={types} />} + render={(props) => ( + <HookFormSelect + {...props} + isSearchable={false} + options={types} + /> + )} /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.type?.message}</div> </div> <div> <label className='form-label mb-2'>Nama</label> - <input {...register('name')} placeholder='John Doe' type='text' className='form-input' /> + <input + {...register('name')} + placeholder='John Doe' + type='text' + className='form-input' + /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.name?.message}</div> </div> @@ -132,7 +146,12 @@ const EditAddress = ({ id, defaultValues }) => { <div> <label className='form-label mb-2'>Mobile</label> - <input {...register('mobile')} placeholder='08xxxxxxxx' type='tel' className='form-input' /> + <input + {...register('mobile')} + placeholder='08xxxxxxxx' + type='tel' + className='form-input' + /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.mobile?.message}</div> </div> @@ -149,7 +168,12 @@ const EditAddress = ({ id, defaultValues }) => { <div> <label className='form-label mb-2'>Kode Pos</label> - <input {...register('zip')} placeholder='10100' type='number' className='form-input' /> + <input + {...register('zip')} + placeholder='10100' + type='number' + className='form-input' + /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.zip?.message}</div> </div> @@ -158,7 +182,12 @@ const EditAddress = ({ id, defaultValues }) => { <Controller name='city' control={control} - render={(props) => <HookFormSelect {...props} options={cities} />} + render={(props) => ( + <HookFormSelect + {...props} + options={cities} + /> + )} /> <div className='text-caption-2 text-red_r-11 mt-1'>{errors.city?.message}</div> </div> @@ -169,7 +198,11 @@ const EditAddress = ({ id, defaultValues }) => { name='district' control={control} render={(props) => ( - <HookFormSelect {...props} options={districts} disabled={!watchCity} /> + <HookFormSelect + {...props} + options={districts} + disabled={!watchCity} + /> )} /> </div> @@ -180,12 +213,19 @@ const EditAddress = ({ id, defaultValues }) => { name='subDistrict' control={control} render={(props) => ( - <HookFormSelect {...props} options={subDistricts} disabled={!watchDistrict} /> + <HookFormSelect + {...props} + options={subDistricts} + disabled={!watchDistrict} + /> )} /> </div> - <button type='submit' className='btn-yellow mt-2 w-full'> + <button + type='submit' + className='btn-yellow mt-2 w-full' + > Simpan </button> </form> |
