upd: member
Deskripsi: - list member - ui tambah member - ui detail member - ui edit member No Issues
This commit is contained in:
@@ -49,7 +49,7 @@ export function InputForm({ label, placeholder, onChange, info, error, errorText
|
||||
<View style={[Styles.mb10]}>
|
||||
{
|
||||
label != undefined && (
|
||||
<Text style={[Styles.mb05, { textTransform: "capitalize" }, error && Styles.cError]}>
|
||||
<Text style={[Styles.mb05, error && Styles.cError]}>
|
||||
{label}
|
||||
{required && (<Text style={Styles.cError}>*</Text>)}
|
||||
</Text>
|
||||
|
||||
49
components/itemDetailMember.tsx
Normal file
49
components/itemDetailMember.tsx
Normal file
@@ -0,0 +1,49 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { AntDesign, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons";
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
type Props = {
|
||||
category: 'nik' | 'group' | 'position' | 'phone' | 'email' | 'gender'
|
||||
value: string
|
||||
}
|
||||
|
||||
|
||||
const data = {
|
||||
nik: {
|
||||
label: 'NIK',
|
||||
icon: <MaterialCommunityIcons name="card-account-details" size={22} color="black" style={[Styles.mr10]} />
|
||||
},
|
||||
group: {
|
||||
label: 'Lembaga Desa',
|
||||
icon: <AntDesign name="tags" size={22} color="black" style={[Styles.mr10]} />
|
||||
},
|
||||
position: {
|
||||
label: 'Jabatan',
|
||||
icon: <MaterialCommunityIcons name="account-tie" size={22} color="black" style={[Styles.mr10]} />
|
||||
},
|
||||
phone: {
|
||||
label: 'No Telepon',
|
||||
icon: <MaterialIcons name="phone" size={22} color="black" style={[Styles.mr10]} />
|
||||
},
|
||||
email: {
|
||||
label: 'Email',
|
||||
icon: <MaterialIcons name="email" size={22} color="black" style={[Styles.mr10]} />
|
||||
},
|
||||
gender: {
|
||||
label: 'Jenis Kelamin',
|
||||
icon: <MaterialCommunityIcons name="gender-male-female" size={22} color="black" style={[Styles.mr10]} />
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
export default function ItemDetailMember({ category, value }: Props) {
|
||||
return (
|
||||
<View style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.mt10]}>
|
||||
<View style={[Styles.rowItemsCenter]}>
|
||||
{data[category].icon}
|
||||
<Text style={[Styles.textDefault]}>{data[category].label}</Text>
|
||||
</View>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{value}</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
46
components/member/headerMemberDetail.tsx
Normal file
46
components/member/headerMemberDetail.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import Styles from "@/constants/Styles"
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons"
|
||||
import { useState } from "react"
|
||||
import { View } from "react-native"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
import DrawerBottom from "../drawerBottom"
|
||||
import MenuItemRow from "../menuItemRow"
|
||||
import { router } from "expo-router"
|
||||
|
||||
type Props = {
|
||||
id: string | string[]
|
||||
}
|
||||
|
||||
export default function HeaderRightMemberDetail({ 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="toggle-switch-off-outline" color="black" size={25} />}
|
||||
title="Non Aktifkan"
|
||||
onPress={() => {
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah anda yakin ingin menonaktifkan data?',
|
||||
onPress: () => { }
|
||||
})
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
icon={<MaterialCommunityIcons name="pencil-outline" color="black" size={25} />}
|
||||
title="Edit"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
router.push(`/member/edit/${id}`)
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,15 +1,16 @@
|
||||
import { router, Stack } from "expo-router"
|
||||
import ButtonBackHeader from "../buttonBackHeader"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
import { useState } from "react"
|
||||
import DrawerBottom from "../drawerBottom"
|
||||
import { View } from "react-native"
|
||||
import Styles from "@/constants/Styles"
|
||||
import MenuItemRow from "../menuItemRow"
|
||||
import { AntDesign } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { View } from "react-native"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
import DrawerBottom from "../drawerBottom"
|
||||
import MenuItemRow from "../menuItemRow"
|
||||
import ModalFilter from "../modalFilter"
|
||||
|
||||
export default function HeaderMemberList() {
|
||||
const [isVisible, setVisible] = useState(false)
|
||||
const [isFilter, setFilter] = useState(false)
|
||||
return (
|
||||
<>
|
||||
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||
@@ -18,15 +19,22 @@ export default function HeaderMemberList() {
|
||||
<MenuItemRow
|
||||
icon={<AntDesign name="pluscircle" color="black" size={25} />}
|
||||
title="Tambah Anggota"
|
||||
onPress={() => { }}
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
router.push('/member/create')
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
icon={<AntDesign name="filter" color="black" size={25} />}
|
||||
title="Filter"
|
||||
onPress={() => { }}
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
setFilter(true)
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
<ModalFilter close={() => { setFilter(false) }} open={isFilter} page="member" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ type Props = {
|
||||
|
||||
export default function MenuItemRow({ onPress, icon, title }: Props) {
|
||||
return (
|
||||
<Pressable onPressOut={() => { console.log('press'); onPress() }} style={[Styles.btnMenuRow]}>
|
||||
<Pressable onPressOut={() => { onPress() }} style={[Styles.btnMenuRow]}>
|
||||
<View style={{ alignItems: 'center' }}>
|
||||
{icon}
|
||||
<Text style={[Styles.mt05]}>{title}</Text>
|
||||
|
||||
@@ -9,7 +9,7 @@ import { router } from "expo-router"
|
||||
type Props = {
|
||||
open: boolean,
|
||||
close: (value: boolean) => void
|
||||
page: 'position'
|
||||
page: 'position' | 'member'
|
||||
}
|
||||
|
||||
export default function ModalFilter({ open, close, page }: Props) {
|
||||
|
||||
Reference in New Issue
Block a user