upd: calendar division

Deskripsi:
- load list data event
- indicator kalender
- detail data event kalender
- mengeluarkan anggota
- menambahkan anggota
- menghapus event kalender
- riwayat event kalender
- nb : tambah dan edit kalender blm selesai karena input tgl susahh

No Issues
This commit is contained in:
amel
2025-05-23 17:35:07 +08:00
parent 3f67f65ae5
commit ee87cab5b8
12 changed files with 657 additions and 156 deletions

View File

@@ -2,11 +2,38 @@ import ButtonBackHeader from "@/components/buttonBackHeader";
import ItemHistoryEvent from "@/components/calendar/itemHistoryEvent";
import InputSearch from "@/components/inputSearch";
import Styles from "@/constants/Styles";
import { router, Stack } from "expo-router";
import { SafeAreaView, ScrollView, Text, View } from "react-native";
import { apiGetCalendarHistory } from "@/lib/api";
import { useAuthSession } from "@/providers/AuthProvider";
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import { SafeAreaView, ScrollView, View } from "react-native";
export default function CalendarHistory(){
return(
type Props = {
dateStart: Date
year:string
data: []
}
export default function CalendarHistory() {
const { id } = useLocalSearchParams<{ id: string }>();
const { token, decryptToken } = useAuthSession();
const [data, setData] = useState<Props[]>([])
const [search, setSearch] = useState('')
async function handleLoad() {
try {
const hasil = await decryptToken(String(token?.current));
const response = await apiGetCalendarHistory({ user: hasil, search: '', division: id });
setData(response.data);
} catch (error) {
console.error(error);
}
}
useEffect(() => {
handleLoad()
}, [search])
return (
<SafeAreaView>
<Stack.Screen
options={{
@@ -17,8 +44,8 @@ export default function CalendarHistory(){
/>
<ScrollView>
<View style={[Styles.p15]}>
<InputSearch />
<ItemHistoryEvent/>
<InputSearch onChange={(val) => setSearch(val)} />
<ItemHistoryEvent data={data} />
</View>
</ScrollView>
</SafeAreaView>