upd: project
Deskripsi: - tambah data project nb : upload file blm selesai No Issuese
This commit is contained in:
70
components/project/sectionListAddTask.tsx
Normal file
70
components/project/sectionListAddTask.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { deleteTaskCreate } from "@/lib/taskCreate";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Key, useState } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
import ItemSectionTanggalTugas from "../itemSectionTanggalTugas";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
|
||||
export default function SectionListAddTask() {
|
||||
const taskCreate = useSelector((state: any) => state.taskCreate)
|
||||
const [select, setSelect] = useState<any>(null)
|
||||
const [isModal, setModal] = useState(false)
|
||||
const dispatch = useDispatch()
|
||||
|
||||
function handleDelete() {
|
||||
dispatch(deleteTaskCreate(select))
|
||||
setModal(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
taskCreate.length > 0
|
||||
&&
|
||||
<>
|
||||
<View style={[Styles.mb15, Styles.mt10]}>
|
||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv05]}>
|
||||
Tanggal & Tugas
|
||||
</Text>
|
||||
<View style={[Styles.wrapPaper]}>
|
||||
{
|
||||
taskCreate.map((item: { status: number; title: string; dateStart: string; dateEnd: string; }, index: Key | null | undefined) => {
|
||||
return (
|
||||
<ItemSectionTanggalTugas
|
||||
key={index}
|
||||
title={item.title}
|
||||
dateStart={item.dateStart}
|
||||
dateEnd={item.dateEnd}
|
||||
onPress={() => {
|
||||
setSelect(index)
|
||||
setModal(true)
|
||||
}}
|
||||
/>
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
</View>
|
||||
</View>
|
||||
<DrawerBottom
|
||||
animation="slide"
|
||||
isVisible={isModal}
|
||||
setVisible={setModal}
|
||||
title="Menu"
|
||||
>
|
||||
<View style={Styles.rowItemsCenter}>
|
||||
<MenuItemRow
|
||||
icon={<Ionicons name="trash" color="black" size={25} />}
|
||||
title="Hapus Tugas"
|
||||
onPress={() => { handleDelete() }}
|
||||
/>
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
</>
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user