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

@@ -41,6 +41,7 @@ export default function CreateMember() {
const [disableBtn, setDisableBtn] = useState(true)
const [valChoose, setValChoose] = useState("")
const [imgForm, setImgForm] = useState<any>()
const [loading, setLoading] = useState(false)
const [error, setError] = useState({
group: false,
position: false,
@@ -152,6 +153,7 @@ export default function CreateMember() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -179,6 +181,9 @@ export default function CreateMember() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
}finally{
setLoading(false)
}
}
@@ -215,7 +220,7 @@ export default function CreateMember() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading}
category="create"
onPress={() => { handleCreate() }}
/>