upd: button save

Deskripsi:
- disable button saat udh submit

No Issues
This commit is contained in:
2025-08-04 13:56:33 +08:00
parent b7c44109a1
commit fafb52d87c
31 changed files with 211 additions and 64 deletions

View File

@@ -46,7 +46,8 @@ export default function EditProfile() {
const [isSelect, setSelect] = useState(false);
const [disableBtn, setDisableBtn] = useState(false)
const [valChoose, setValChoose] = useState("")
const [imgForm, setImgForm] = useState<any>();
const [imgForm, setImgForm] = useState<any>()
const [loading, setLoading] = useState(false)
const [data, setData] = useState<Props>({
id: entities.id,
name: entities.name,
@@ -150,6 +151,7 @@ export default function EditProfile() {
async function handleEdit() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -179,6 +181,8 @@ export default function EditProfile() {
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
} finally {
setLoading(false)
}
}
@@ -217,7 +221,7 @@ export default function EditProfile() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading ? true : false}
category="update"
onPress={() => {
handleEdit()