From ea1c0bd67e2856c5b4cb818ff6399849fbc6672a Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Fri, 3 Oct 2025 10:39:56 +0800 Subject: [PATCH] upd: refresh pada halaman informasi divisi --- app/(application)/division/[id]/info.tsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/(application)/division/[id]/info.tsx b/app/(application)/division/[id]/info.tsx index c87979c..9cf3f28 100644 --- a/app/(application)/division/[id]/info.tsx +++ b/app/(application)/division/[id]/info.tsx @@ -16,7 +16,7 @@ import { useAuthSession } from "@/providers/AuthProvider" import { Feather, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons" import { router, Stack, useLocalSearchParams } from "expo-router" import { useEffect, useState } from "react" -import { Pressable, SafeAreaView, ScrollView, View } from "react-native" +import { Pressable, RefreshControl, SafeAreaView, ScrollView, View } from "react-native" import Toast from "react-native-toast-message" import { useSelector } from "react-redux" @@ -39,6 +39,7 @@ type PropsMember = { } export default function InformationDivision() { + const [refreshing, setRefreshing] = useState(false) const entityUser = useSelector((state: any) => state.user) const { id } = useLocalSearchParams<{ id: string }>() const [isModal, setModal] = useState(false) @@ -116,6 +117,14 @@ export default function InformationDivision() { } } + const handleRefresh = async () => { + setRefreshing(true) + handleLoad(false) + handleCheckMember() + await new Promise(resolve => setTimeout(resolve, 2000)); + setRefreshing(false) + }; + async function handleCheckMember() { try { const hasil = await decryptToken(String(token?.current)); @@ -161,7 +170,15 @@ export default function InformationDivision() { headerRight: () => ((entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision) && , }} /> - + + } + style={[Styles.h100]} + > { dataDetail?.isActive == false && (