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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user