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:
@@ -3,12 +3,50 @@ import ButtonSaveHeader from "@/components/buttonSaveHeader"
|
||||
import { InputForm } from "@/components/inputForm"
|
||||
import SelectForm from "@/components/selectForm"
|
||||
import Styles from "@/constants/Styles"
|
||||
import { Stack, router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { apiGetCalendarOne } from "@/lib/api"
|
||||
import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { Stack, router, useLocalSearchParams } from "expo-router"
|
||||
import { useEffect, useState } from "react"
|
||||
import { SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native"
|
||||
|
||||
export default function EditEventCalendar() {
|
||||
const { token, decryptToken } = useAuthSession();
|
||||
const [chooseGroup, setChooseGroup] = useState({ val: '', label: '' })
|
||||
const { id, detail } = useLocalSearchParams<{ id: string, detail: string }>();
|
||||
const [data, setData] = useState({
|
||||
id: '',
|
||||
timeStart: '',
|
||||
timeEnd: '',
|
||||
dateStart: '',
|
||||
dateEnd: '',
|
||||
idCalendar: '',
|
||||
status: 0,
|
||||
title: '',
|
||||
desc: '',
|
||||
linkMeet: '',
|
||||
repeatEventTyper: '',
|
||||
repeatValue: 0,
|
||||
})
|
||||
|
||||
async function handleLoad() {
|
||||
try {
|
||||
const hasil = await decryptToken(String(token?.current));
|
||||
const response = await apiGetCalendarOne({
|
||||
user: hasil,
|
||||
id: detail,
|
||||
cat: 'data',
|
||||
});
|
||||
setData(response.data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
handleLoad();
|
||||
}, []);
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<SafeAreaView>
|
||||
@@ -45,18 +83,6 @@ export default function EditEventCalendar() {
|
||||
<SelectForm bg="white" label="Ulangi Acara" placeholder="Ulangi Acara" value={chooseGroup.label} required onPress={() => { }} />
|
||||
<InputForm label="Jumlah Pengulangan" type="numeric" placeholder="Jumlah Pengulangan" required bg="white" />
|
||||
<InputForm label="Deskripsi" type="default" placeholder="Deskripsi" bg="white" />
|
||||
{/* <ButtonForm
|
||||
text="SIMPAN"
|
||||
onPress={() => {
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah anda yakin ingin menambahkan data?',
|
||||
onPress: () => {
|
||||
ToastAndroid.show('Berhasil menambahkan data', ToastAndroid.SHORT)
|
||||
router.back()
|
||||
}
|
||||
})
|
||||
}} /> */}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
|
||||
Reference in New Issue
Block a user