upd: project
Deskripsi: - update button save pada tambah edit project - ui edit tugas dan tanggal project - modal menu detail tugas dan tanggal - modal menu detail file - modal menu detail anggota project No Issues
This commit is contained in:
@@ -3,7 +3,7 @@ import { ButtonHeader } from "./buttonHeader"
|
||||
import AlertKonfirmasi from "./alertKonfirmasi"
|
||||
|
||||
type Props = {
|
||||
category: 'create' | 'update'
|
||||
category: 'create' | 'update' | 'cancel'
|
||||
onPress?: () => void
|
||||
disable?: boolean
|
||||
}
|
||||
@@ -16,7 +16,11 @@ export default function ButtonSaveHeader({ category, onPress, disable }: Props)
|
||||
onPress={() => {
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: category == 'create' ? 'Apakah anda yakin ingin menambahkan data?' : 'Apakah anda yakin mengubah data?',
|
||||
desc: category == 'create'
|
||||
? 'Apakah anda yakin ingin menambahkan data?'
|
||||
: category == 'cancel'
|
||||
? 'Apakah anda yakin ingin membatalkan kegiatan? Pembatalan bersifat permanen'
|
||||
: 'Apakah anda yakin mengubah data?',
|
||||
onPress: () => {
|
||||
onPress && onPress()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { Text, View } from "react-native";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
|
||||
|
||||
type Props = {
|
||||
@@ -8,11 +8,12 @@ type Props = {
|
||||
title: string
|
||||
dateStart: string
|
||||
dateEnd: string
|
||||
onPress?: () => void
|
||||
}
|
||||
|
||||
export default function ItemSectionTanggalTugas({ done, title, dateStart, dateEnd }: Props) {
|
||||
export default function ItemSectionTanggalTugas({ done, title, dateStart, dateEnd, onPress }: Props) {
|
||||
return (
|
||||
<View style={[Styles.mb15, { borderBottomColor: '#d6d8f6', borderBottomWidth: 1 }]}>
|
||||
<Pressable style={[Styles.mb15, { borderBottomColor: '#d6d8f6', borderBottomWidth: 1 }]} onPress={onPress}>
|
||||
<View style={[Styles.rowItemsCenter]}>
|
||||
{
|
||||
done ?
|
||||
@@ -48,6 +49,6 @@ export default function ItemSectionTanggalTugas({ done, title, dateStart, dateEn
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</Pressable>
|
||||
)
|
||||
}
|
||||
@@ -8,7 +8,7 @@ type Props = {
|
||||
open: boolean
|
||||
close: (value: boolean) => void
|
||||
title: string
|
||||
category: 'group'
|
||||
category: 'group' | 'status-task'
|
||||
choose: string
|
||||
onSelect: (value: { val: string, label: string }) => void
|
||||
}
|
||||
@@ -19,23 +19,43 @@ export default function ModalSelect({ open, close, title, category, choose, onSe
|
||||
return (
|
||||
<DrawerBottom animation="none" isVisible={open} setVisible={close} title={title} height={75}>
|
||||
<View>
|
||||
<Pressable style={[Styles.itemSelectModal]} onPress={() => {
|
||||
onSelect({ val: 'dinas', label: 'Dinas' })
|
||||
setChoose('dinas')
|
||||
close(false)
|
||||
}}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Dinas</Text>
|
||||
<AntDesign name="check" size={20} />
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.itemSelectModal]}>
|
||||
<Text>Adat</Text>
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.itemSelectModal]}>
|
||||
<Text>Karang Taruna</Text>
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.itemSelectModal]}>
|
||||
<Text>PKK</Text>
|
||||
</Pressable>
|
||||
{
|
||||
category == 'group' ?
|
||||
<>
|
||||
<Pressable style={[Styles.itemSelectModal]} onPress={() => {
|
||||
onSelect({ val: 'dinas', label: 'Dinas' })
|
||||
setChoose('dinas')
|
||||
close(false)
|
||||
}}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Dinas</Text>
|
||||
<AntDesign name="check" size={20} />
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.itemSelectModal]}>
|
||||
<Text>Adat</Text>
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.itemSelectModal]}>
|
||||
<Text>Karang Taruna</Text>
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.itemSelectModal]}>
|
||||
<Text>PKK</Text>
|
||||
</Pressable>
|
||||
</>
|
||||
:
|
||||
<>
|
||||
<Pressable style={[Styles.itemSelectModal]} onPress={() => {
|
||||
onSelect({ val: 'blm-dikerjakan', label: 'Belum Dikerjakan' })
|
||||
setChoose('blm-dikerjakan')
|
||||
close(false)
|
||||
}}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Belum Dikerjakan</Text>
|
||||
<AntDesign name="check" size={20} />
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.itemSelectModal]}>
|
||||
<Text>Selesai</Text>
|
||||
</Pressable>
|
||||
</>
|
||||
}
|
||||
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
)
|
||||
|
||||
@@ -1,26 +1,72 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { Text, View } from "react-native";
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { Text, ToastAndroid, View } from "react-native";
|
||||
import BorderBottomItem from "./borderBottomItem";
|
||||
import { useState } from "react";
|
||||
import { router } from "expo-router";
|
||||
import AlertKonfirmasi from "./alertKonfirmasi";
|
||||
import DrawerBottom from "./drawerBottom";
|
||||
import MenuItemRow from "./menuItemRow";
|
||||
|
||||
export default function SectionFile() {
|
||||
const [isModal, setModal] = useState(false)
|
||||
|
||||
return (
|
||||
<View style={[Styles.mb15]}>
|
||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv05]}>File</Text>
|
||||
<View style={[Styles.wrapPaper]}>
|
||||
<BorderBottomItem
|
||||
borderType="all"
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color="black" />}
|
||||
title="image_pertama.jpg"
|
||||
titleWeight="normal"
|
||||
/>
|
||||
<BorderBottomItem
|
||||
borderType="all"
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color="black" />}
|
||||
title="file_kedua.pdf"
|
||||
titleWeight="normal"
|
||||
/>
|
||||
<>
|
||||
<View style={[Styles.mb15]}>
|
||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv05]}>File</Text>
|
||||
<View style={[Styles.wrapPaper]}>
|
||||
<BorderBottomItem
|
||||
borderType="all"
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color="black" />}
|
||||
title="image_pertama.jpg"
|
||||
titleWeight="normal"
|
||||
onPress={() => { setModal(true) }}
|
||||
/>
|
||||
<BorderBottomItem
|
||||
borderType="all"
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color="black" />}
|
||||
title="file_kedua.pdf"
|
||||
titleWeight="normal"
|
||||
onPress={() => { setModal(true) }}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
|
||||
<View style={Styles.rowItemsCenter}>
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="file-eye" color="black" size={25} />}
|
||||
title="Lihat File"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="download" color="black" size={25} />}
|
||||
title="Download"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
}}
|
||||
/>
|
||||
|
||||
<MenuItemRow
|
||||
icon={<Ionicons name="trash" color="black" size={25} />}
|
||||
title="Hapus"
|
||||
onPress={() => {
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah Anda yakin ingin menghapus file ini? File yang dihapus tidak dapat dikembalikan',
|
||||
onPress: () => {
|
||||
setModal(false)
|
||||
ToastAndroid.show('Berhasil menghapus data', ToastAndroid.SHORT)
|
||||
}
|
||||
})
|
||||
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,45 +1,88 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Image, Text, View } from "react-native";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { useState } from "react";
|
||||
import { Image, Text, ToastAndroid, View } from "react-native";
|
||||
import AlertKonfirmasi from "./alertKonfirmasi";
|
||||
import BorderBottomItem from "./borderBottomItem";
|
||||
import DrawerBottom from "./drawerBottom";
|
||||
import MenuItemRow from "./menuItemRow";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function SectionMember() {
|
||||
const [isModal, setModal] = useState(false)
|
||||
|
||||
return (
|
||||
<View style={[Styles.mb15]}>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Anggota</Text>
|
||||
<Text style={[Styles.textDefault]}>Total 5 Anggota</Text>
|
||||
<>
|
||||
<View style={[Styles.mb15]}>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Anggota</Text>
|
||||
<Text style={[Styles.textDefault]}>Total 5 Anggota</Text>
|
||||
</View>
|
||||
|
||||
<View style={[Styles.wrapPaper]}>
|
||||
<BorderBottomItem
|
||||
borderType="bottom"
|
||||
icon={<Image source={require("../assets/images/user.jpeg")} style={[Styles.userProfileSmall]} />}
|
||||
title="Amalia Dwi"
|
||||
subtitle="Dinas - Bendahara"
|
||||
rightTopInfo="Anggota"
|
||||
onPress={() => { setModal(true) }}
|
||||
/>
|
||||
<BorderBottomItem
|
||||
borderType="bottom"
|
||||
icon={<Image source={require("../assets/images/user.jpeg")} style={[Styles.userProfileSmall]} />}
|
||||
title="Amalia Dwi"
|
||||
subtitle="Dinas - Bendahara"
|
||||
rightTopInfo="Anggota"
|
||||
onPress={() => { setModal(true) }}
|
||||
/>
|
||||
<BorderBottomItem
|
||||
borderType="bottom"
|
||||
icon={<Image source={require("../assets/images/user.jpeg")} style={[Styles.userProfileSmall]} />}
|
||||
title="Amalia Dwi"
|
||||
subtitle="Dinas - Bendahara"
|
||||
rightTopInfo="Anggota"
|
||||
onPress={() => { setModal(true) }}
|
||||
/>
|
||||
<BorderBottomItem
|
||||
borderType="bottom"
|
||||
icon={<Image source={require("../assets/images/user.jpeg")} style={[Styles.userProfileSmall]} />}
|
||||
title="Amalia Dwi"
|
||||
subtitle="Dinas - Bendahara"
|
||||
rightTopInfo="Anggota"
|
||||
onPress={() => { setModal(true) }}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={[Styles.wrapPaper]}>
|
||||
<BorderBottomItem
|
||||
borderType="bottom"
|
||||
icon={<Image source={require("../assets/images/user.jpeg")} style={[Styles.userProfileSmall]} />}
|
||||
title="Amalia Dwi"
|
||||
subtitle="Dinas - Bendahara"
|
||||
rightTopInfo="Anggota"
|
||||
/>
|
||||
<BorderBottomItem
|
||||
borderType="bottom"
|
||||
icon={<Image source={require("../assets/images/user.jpeg")} style={[Styles.userProfileSmall]} />}
|
||||
title="Amalia Dwi"
|
||||
subtitle="Dinas - Bendahara"
|
||||
rightTopInfo="Anggota"
|
||||
/>
|
||||
<BorderBottomItem
|
||||
borderType="bottom"
|
||||
icon={<Image source={require("../assets/images/user.jpeg")} style={[Styles.userProfileSmall]} />}
|
||||
title="Amalia Dwi"
|
||||
subtitle="Dinas - Bendahara"
|
||||
rightTopInfo="Anggota"
|
||||
/>
|
||||
<BorderBottomItem
|
||||
borderType="bottom"
|
||||
icon={<Image source={require("../assets/images/user.jpeg")} style={[Styles.userProfileSmall]} />}
|
||||
title="Amalia Dwi"
|
||||
subtitle="Dinas - Bendahara"
|
||||
rightTopInfo="Anggota"
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
|
||||
<View style={Styles.rowItemsCenter}>
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="account-eye" color="black" size={25} />}
|
||||
title="Lihat Profil"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
router.push('/member/123')
|
||||
}}
|
||||
/>
|
||||
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="account-remove" color="black" size={25} />}
|
||||
title="Keluarkan"
|
||||
onPress={() => {
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah Anda yakin ingin mengeluarkan anggota?',
|
||||
onPress: () => {
|
||||
setModal(false)
|
||||
ToastAndroid.show('Berhasil mengeluarkan anggota', ToastAndroid.SHORT)
|
||||
}
|
||||
})
|
||||
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,15 +1,79 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Text, View } from "react-native";
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { Text, ToastAndroid, View } from "react-native";
|
||||
import DrawerBottom from "./drawerBottom";
|
||||
import ItemSectionTanggalTugas from "./itemSectionTanggalTugas";
|
||||
import MenuItemRow from "./menuItemRow";
|
||||
import AlertKonfirmasi from "./alertKonfirmasi";
|
||||
import ModalSelect from "./modalSelect";
|
||||
|
||||
export default function SectionTanggalTugas() {
|
||||
const [isModal, setModal] = useState(false)
|
||||
const [isSelect, setSelect] = useState(false)
|
||||
const [choose, setChoose] = useState({ val: '', label: '' })
|
||||
|
||||
return (
|
||||
<View style={[Styles.mb15, Styles.mt10]}>
|
||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv05]}>Tanggal & Tugas</Text>
|
||||
<View style={[Styles.wrapPaper]}>
|
||||
<ItemSectionTanggalTugas done={false} title="Pertama" dateStart="12-03-2023" dateEnd="15-03-2023" />
|
||||
<ItemSectionTanggalTugas done={true} title="Kedua" dateStart="15-03-2023" dateEnd="20-03-2023" />
|
||||
<>
|
||||
<View style={[Styles.mb15, Styles.mt10]}>
|
||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv05]}>Tanggal & Tugas</Text>
|
||||
<View style={[Styles.wrapPaper]}>
|
||||
<ItemSectionTanggalTugas done={false} title="Pertama" dateStart="12-03-2023" dateEnd="15-03-2023" onPress={() => { setModal(true) }} />
|
||||
<ItemSectionTanggalTugas done={true} title="Kedua" dateStart="15-03-2023" dateEnd="20-03-2023" onPress={() => { setModal(true) }} />
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
|
||||
<View style={Styles.rowItemsCenter}>
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="list-status" color="black" size={25} />}
|
||||
title="Update Status"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
setSelect(true)
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="pencil-outline" color="black" size={25} />}
|
||||
title="Edit Tugas"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
router.push(`/project/update/124`)
|
||||
}}
|
||||
/>
|
||||
|
||||
<MenuItemRow
|
||||
icon={<Ionicons name="trash" color="black" size={25} />}
|
||||
title="Hapus Tugas"
|
||||
onPress={() => {
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah anda yakin ingin menghapus data ini?',
|
||||
onPress: () => {
|
||||
setModal(false)
|
||||
ToastAndroid.show('Berhasil menghapus data', ToastAndroid.SHORT)
|
||||
router.push('/project/243')
|
||||
}
|
||||
})
|
||||
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
|
||||
<ModalSelect
|
||||
category="status-task"
|
||||
close={setSelect}
|
||||
onSelect={(value) => {
|
||||
setChoose(value)
|
||||
setSelect(false)
|
||||
ToastAndroid.show('Berhasil mengubah data', ToastAndroid.SHORT)
|
||||
}}
|
||||
title="Status"
|
||||
choose={choose.val}
|
||||
open={isSelect}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user