upd: pull to refresh

Deskripsi:
- list banner
- lit grouop
- list position
- list member
- list diskusi umum
- list pengumuman
- list project
- list divisi
- list tugas divisi
- list diskusi divisi
- list kalender divisi
- list dokumen divisi

No Issues
This commit is contained in:
2025-07-15 12:08:55 +08:00
parent ae420ec560
commit 4a10655582
12 changed files with 249 additions and 63 deletions

View File

@@ -14,7 +14,7 @@ import { setUpdateGroup } from "@/lib/groupSlice";
import { useAuthSession } from "@/providers/AuthProvider";
import { AntDesign, Feather, MaterialCommunityIcons } from "@expo/vector-icons";
import { useEffect, useState } from "react";
import { SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native";
import { RefreshControl, SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native";
import { useDispatch, useSelector } from "react-redux";
type Props = {
@@ -36,6 +36,7 @@ export default function Index() {
const [idChoose, setIdChoose] = useState('')
const [activeChoose, setActiveChoose] = useState(true)
const [titleChoose, setTitleChoose] = useState('')
const [refreshing, setRefreshing] = useState(false)
const dispatch = useDispatch()
const update = useSelector((state: any) => state.groupUpdate)
@@ -99,12 +100,24 @@ export default function Index() {
handleLoad(true)
}, [status, search])
const handleRefresh = async () => {
setRefreshing(true)
handleLoad(false)
await new Promise(resolve => setTimeout(resolve, 2000));
setRefreshing(false)
};
return (
<SafeAreaView>
<ScrollView>
<ScrollView
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={handleRefresh}
/>
}
>
<View style={[Styles.p15]}>
<View style={[Styles.wrapBtnTab]}>
<ButtonTab