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

@@ -29,6 +29,7 @@ import Toast from "react-native-toast-message";
import { useDispatch, useSelector } from "react-redux";
export default function CreateProject() {
const [loading, setLoading] =useState(false)
const { token, decryptToken } = useAuthSession();
const [chooseGroup, setChooseGroup] = useState({ val: "", label: "" });
const dispatch = useDispatch();
@@ -102,6 +103,7 @@ export default function CreateProject() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -127,6 +129,9 @@ export default function CreateProject() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
}finally{
setLoading(false)
}
}
@@ -178,7 +183,7 @@ export default function CreateProject() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading}
category="create"
onPress={() => {
handleCreate()