upd: project
Deskripsi: - tambah data project nb : upload file blm selesai No Issuese
This commit is contained in:
@@ -6,17 +6,20 @@ type Props = {
|
||||
value: string
|
||||
onPress?: () => void
|
||||
round?: boolean
|
||||
error?: boolean
|
||||
errorText?: string
|
||||
}
|
||||
|
||||
export default function ButtonSelect({ value, onPress, round }: Props) {
|
||||
export default function ButtonSelect({ value, onPress, round, error, errorText }: Props) {
|
||||
return (
|
||||
<View style={[Styles.mv15]}>
|
||||
<View style={[Styles.mv05]}>
|
||||
<Pressable onPress={onPress}>
|
||||
<View style={[Styles.inputRoundForm, Styles.inputRoundFormRight, round && Styles.round30, Styles.pv10]}>
|
||||
<View style={[Styles.inputRoundForm, Styles.inputRoundFormRight, round && Styles.round30, Styles.pv10, error && { borderColor: "red" }]}>
|
||||
<Feather name="arrow-right-circle" size={20} color="black" />
|
||||
<Text style={[Styles.cBlack]}>{value}</Text>
|
||||
</View>
|
||||
</Pressable>
|
||||
{error && (<Text style={[Styles.textInformation, Styles.mt05, Styles.cError]}>{errorText}</Text>)}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { Pressable, Text, View } from "react-native";
|
||||
|
||||
|
||||
type Props = {
|
||||
done: boolean
|
||||
done?: boolean
|
||||
title: string
|
||||
dateStart: string
|
||||
dateEnd: string
|
||||
@@ -16,16 +16,19 @@ export default function ItemSectionTanggalTugas({ done, title, dateStart, dateEn
|
||||
<Pressable style={[Styles.mb15, { borderBottomColor: '#d6d8f6', borderBottomWidth: 1 }]} onPress={onPress}>
|
||||
<View style={[Styles.rowItemsCenter]}>
|
||||
{
|
||||
done ?
|
||||
<>
|
||||
<MaterialCommunityIcons name="checkbox-marked-circle-outline" size={22} color="gray" style={[Styles.mr10]} />
|
||||
<Text style={[Styles.cGray]}>Selesai</Text>
|
||||
</>
|
||||
done != undefined ?
|
||||
done ?
|
||||
<>
|
||||
<MaterialCommunityIcons name="checkbox-marked-circle-outline" size={22} color="gray" style={[Styles.mr10]} />
|
||||
<Text style={[Styles.cGray]}>Selesai</Text>
|
||||
</>
|
||||
:
|
||||
<>
|
||||
<MaterialCommunityIcons name="checkbox-blank-circle-outline" size={22} color="gray" style={[Styles.mr10]} />
|
||||
<Text style={[Styles.cGray]}>Belum Selesai</Text>
|
||||
</>
|
||||
:
|
||||
<>
|
||||
<MaterialCommunityIcons name="checkbox-blank-circle-outline" size={22} color="gray" style={[Styles.mr10]} />
|
||||
<Text style={[Styles.cGray]}>Belum Selesai</Text>
|
||||
</>
|
||||
<></>
|
||||
}
|
||||
|
||||
</View>
|
||||
|
||||
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