upd: division
Deskripsi: - ui edit divisi - ui informasi divisi - ui laporan per divisi - ui create divisi No Issues
This commit is contained in:
@@ -5,6 +5,7 @@ import { View } from "react-native"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
import DrawerBottom from "../drawerBottom"
|
||||
import MenuItemRow from "../menuItemRow"
|
||||
import { router } from "expo-router"
|
||||
|
||||
type Props = {
|
||||
id: string | string[]
|
||||
@@ -23,7 +24,7 @@ export default function HeaderRightDivisionDetail({ id }: Props) {
|
||||
title="Informasi Divisi"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
// router.push('/project/create')
|
||||
router.push('/division/123/info')
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
@@ -31,6 +32,7 @@ export default function HeaderRightDivisionDetail({ id }: Props) {
|
||||
title="Laporan Divisi"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
router.push('/division/123/report')
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
|
||||
48
components/division/headerDivisionInfo.tsx
Normal file
48
components/division/headerDivisionInfo.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import { useState } from "react"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
import DrawerBottom from "../drawerBottom"
|
||||
import { View } from "react-native"
|
||||
import Styles from "@/constants/Styles"
|
||||
import MenuItemRow from "../menuItemRow"
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import { router } from "expo-router"
|
||||
|
||||
type Props = {
|
||||
id: string | string[]
|
||||
}
|
||||
|
||||
export default function HeaderRightDivisionInfo({ id }: Props) {
|
||||
const [isVisible, setVisible] = useState(false)
|
||||
return (
|
||||
<>
|
||||
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={setVisible} title="Menu">
|
||||
<View style={Styles.rowItemsCenter}>
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="pencil-outline" color="black" size={25} />}
|
||||
title="Edit Divisi"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
router.push(`/division/${id}/edit`)
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="toggle-switch-off-outline" color="black" size={25} />}
|
||||
title="Non Aktifkan"
|
||||
onPress={() => {
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah anda yakin ingin menonaktifkan divisi?',
|
||||
onPress: () => {
|
||||
setVisible(false)
|
||||
router.push('/division')
|
||||
}
|
||||
})
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -21,7 +21,7 @@ export default function HeaderRightDivisionList() {
|
||||
title="Tambah Divisi"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
// router.push('/project/create')
|
||||
router.push('/division/create')
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
|
||||
Reference in New Issue
Block a user