upd: member
Deskripsi: - list member - ui tambah member - ui detail member - ui edit member No Issues
This commit is contained in:
47
app/(application)/member/[id].tsx
Normal file
47
app/(application)/member/[id].tsx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import ButtonBackHeader from "@/components/buttonBackHeader";
|
||||||
|
import ItemDetailMember from "@/components/itemDetailMember";
|
||||||
|
import HeaderRightMemberDetail from "@/components/member/headerMemberDetail";
|
||||||
|
import Styles from "@/constants/Styles";
|
||||||
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
|
import { Image, SafeAreaView, ScrollView, Text, View } from "react-native";
|
||||||
|
|
||||||
|
export default function MemberDetail() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SafeAreaView>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
|
headerTitle: 'Anggota',
|
||||||
|
headerTitleAlign:'center',
|
||||||
|
headerRight: () => <HeaderRightMemberDetail id={id} />,
|
||||||
|
headerShadowVisible: false
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ScrollView>
|
||||||
|
<View style={{ flexDirection: 'column' }}>
|
||||||
|
<View style={[Styles.wrapHeadViewMember]}>
|
||||||
|
<Image
|
||||||
|
source={require("../../../assets/images/user.jpeg")}
|
||||||
|
style={[Styles.userProfileBig]}
|
||||||
|
/>
|
||||||
|
<Text style={[Styles.textSubtitle, Styles.cWhite, Styles.mt10]}>Putri Ayu Dewi</Text>
|
||||||
|
<Text style={[Styles.textMediumNormal, Styles.cWhite]}>Super Admin</Text>
|
||||||
|
</View>
|
||||||
|
<View style={[Styles.p15]}>
|
||||||
|
<View style={[Styles.rowSpaceBetween]}>
|
||||||
|
<Text style={[Styles.textDefaultSemiBold]}>Informasi</Text>
|
||||||
|
</View>
|
||||||
|
<ItemDetailMember category="nik" value="123456789" />
|
||||||
|
<ItemDetailMember category="group" value="Dinas" />
|
||||||
|
<ItemDetailMember category="position" value="Sekretaris" />
|
||||||
|
<ItemDetailMember category="phone" value="08980873782" />
|
||||||
|
<ItemDetailMember category="email" value="putri@gmail.com" />
|
||||||
|
<ItemDetailMember category="gender" value="Perempuan" />
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</SafeAreaView>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,7 +1,80 @@
|
|||||||
import { Text } from "react-native";
|
import AlertKonfirmasi from "@/components/alertKonfirmasi";
|
||||||
|
import ButtonBackHeader from "@/components/buttonBackHeader";
|
||||||
|
import { ButtonForm } from "@/components/buttonForm";
|
||||||
|
import { InputForm } from "@/components/inputForm";
|
||||||
|
import SelectForm from "@/components/selectForm";
|
||||||
|
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||||
|
import Styles from "@/constants/Styles";
|
||||||
|
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||||
|
import * as ImagePicker from 'expo-image-picker';
|
||||||
|
import { router, Stack } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { Image, Pressable, SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native";
|
||||||
|
|
||||||
export default function CreateMember() {
|
export default function CreateMember() {
|
||||||
|
const [chooseGroup, setChooseGroup] = useState({ val: '', label: '' })
|
||||||
|
const [selectedImage, setSelectedImage] = useState<string | undefined>(undefined);
|
||||||
|
|
||||||
|
const pickImageAsync = async () => {
|
||||||
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
|
mediaTypes: ['images'],
|
||||||
|
allowsEditing: true,
|
||||||
|
quality: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result.canceled) {
|
||||||
|
setSelectedImage(result.assets[0].uri);
|
||||||
|
} else {
|
||||||
|
alert('Tidak ada gambar yang dipilih');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Text>Tambah Member</Text>
|
<SafeAreaView>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
|
headerTitle: 'Tambah Anggota',
|
||||||
|
headerTitleAlign: 'center',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ScrollView>
|
||||||
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
|
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
{
|
||||||
|
selectedImage != undefined ? (
|
||||||
|
<Pressable onPress={pickImageAsync}>
|
||||||
|
<Image src={selectedImage} style={[Styles.userProfileBig]} />
|
||||||
|
</Pressable>
|
||||||
|
) : (
|
||||||
|
<Pressable onPress={pickImageAsync} style={[Styles.iconContent, ColorsStatus.gray]}>
|
||||||
|
<MaterialCommunityIcons name="account-tie" size={100} color={'gray'} />
|
||||||
|
</Pressable>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<SelectForm label="Lembaga Desa" placeholder="Pilih Lembaga Desa" value={chooseGroup.label} required onPress={() => { }} />
|
||||||
|
<SelectForm label="Jabatan" placeholder="Pilih Jabatan" value={chooseGroup.label} required onPress={() => { }} />
|
||||||
|
<SelectForm label="User Role" placeholder="Pilih Role" value={chooseGroup.label} required onPress={() => { }} />
|
||||||
|
<InputForm label="NIK" type="numeric" placeholder="NIK" required />
|
||||||
|
<InputForm label="Nama" type="default" placeholder="Nama" required />
|
||||||
|
<InputForm label="Email" type="default" placeholder="Email" required />
|
||||||
|
<InputForm label="Nomor Telepon" type="numeric" placeholder="8XX-XXX-XXX" required itemLeft={<Text>+62</Text>} />
|
||||||
|
<SelectForm label="Jenis Kelamin" placeholder="Pilih Jenis Kelamin" value={chooseGroup.label} required onPress={() => { }} />
|
||||||
|
<ButtonForm
|
||||||
|
text="SIMPAN"
|
||||||
|
onPress={() => {
|
||||||
|
AlertKonfirmasi({
|
||||||
|
title: 'Konfirmasi',
|
||||||
|
desc: 'Apakah anda yakin ingin menambahkan data?',
|
||||||
|
onPress: () => {
|
||||||
|
ToastAndroid.show('Berhasil menambahkan data', ToastAndroid.SHORT)
|
||||||
|
router.push('/member?active=true')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}} />
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</SafeAreaView>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
79
app/(application)/member/edit/[id].tsx
Normal file
79
app/(application)/member/edit/[id].tsx
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import AlertKonfirmasi from "@/components/alertKonfirmasi"
|
||||||
|
import ButtonBackHeader from "@/components/buttonBackHeader"
|
||||||
|
import { ButtonForm } from "@/components/buttonForm"
|
||||||
|
import { InputForm } from "@/components/inputForm"
|
||||||
|
import SelectForm from "@/components/selectForm"
|
||||||
|
import { ColorsStatus } from "@/constants/ColorsStatus"
|
||||||
|
import Styles from "@/constants/Styles"
|
||||||
|
import { MaterialCommunityIcons } from "@expo/vector-icons"
|
||||||
|
import * as ImagePicker from 'expo-image-picker'
|
||||||
|
import { router, Stack } from "expo-router"
|
||||||
|
import { useState } from "react"
|
||||||
|
import { Image, Pressable, SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native"
|
||||||
|
|
||||||
|
export default function EditMember() {
|
||||||
|
const [chooseGroup, setChooseGroup] = useState({ val: '', label: '' })
|
||||||
|
const [selectedImage, setSelectedImage] = useState<string | undefined>(undefined);
|
||||||
|
|
||||||
|
const pickImageAsync = async () => {
|
||||||
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
|
mediaTypes: ['images'],
|
||||||
|
allowsEditing: true,
|
||||||
|
quality: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result.canceled) {
|
||||||
|
setSelectedImage(result.assets[0].uri);
|
||||||
|
} else {
|
||||||
|
alert('Tidak ada gambar yang dipilih');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SafeAreaView>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
|
headerTitle: 'Edit Anggota',
|
||||||
|
headerTitleAlign: 'center',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ScrollView>
|
||||||
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
|
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
{
|
||||||
|
selectedImage != undefined ? (
|
||||||
|
<Pressable onPress={pickImageAsync}>
|
||||||
|
<Image src={selectedImage} style={[Styles.userProfileBig]} />
|
||||||
|
</Pressable>
|
||||||
|
) : (
|
||||||
|
<Pressable onPress={pickImageAsync} style={[Styles.iconContent, ColorsStatus.gray]}>
|
||||||
|
<MaterialCommunityIcons name="account-tie" size={100} color={'gray'} />
|
||||||
|
</Pressable>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<SelectForm label="Jabatan" placeholder="Pilih Jabatan" value={chooseGroup.label} required onPress={() => { }} />
|
||||||
|
<SelectForm label="User Role" placeholder="Pilih Role" value={chooseGroup.label} required onPress={() => { }} />
|
||||||
|
<InputForm label="NIK" type="numeric" placeholder="NIK" required />
|
||||||
|
<InputForm label="Nama" type="default" placeholder="Nama" required />
|
||||||
|
<InputForm label="Email" type="default" placeholder="Email" required />
|
||||||
|
<InputForm label="Nomor Telepon" type="numeric" placeholder="8XX-XXX-XXX" required itemLeft={<Text>+62</Text>} />
|
||||||
|
<SelectForm label="Jenis Kelamin" placeholder="Pilih Jenis Kelamin" value={chooseGroup.label} required onPress={() => { }} />
|
||||||
|
<ButtonForm
|
||||||
|
text="SIMPAN"
|
||||||
|
onPress={() => {
|
||||||
|
AlertKonfirmasi({
|
||||||
|
title: 'Konfirmasi',
|
||||||
|
desc: 'Apakah anda yakin ingin mengubah data?',
|
||||||
|
onPress: () => {
|
||||||
|
ToastAndroid.show('Berhasil mengubah data', ToastAndroid.SHORT)
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}} />
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</SafeAreaView>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -35,7 +35,7 @@ export default function Index() {
|
|||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
onPress={() => { }}
|
onPress={() => {router.push('/member/1')}}
|
||||||
borderType="all"
|
borderType="all"
|
||||||
icon={
|
icon={
|
||||||
<Image
|
<Image
|
||||||
@@ -48,7 +48,7 @@ export default function Index() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
onPress={() => { }}
|
onPress={() => {router.push('/member/1')}}
|
||||||
borderType="all"
|
borderType="all"
|
||||||
icon={
|
icon={
|
||||||
<Image
|
<Image
|
||||||
@@ -61,7 +61,7 @@ export default function Index() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
onPress={() => { }}
|
onPress={() => {router.push('/member/1')}}
|
||||||
borderType="all"
|
borderType="all"
|
||||||
icon={
|
icon={
|
||||||
<Image
|
<Image
|
||||||
@@ -74,7 +74,7 @@ export default function Index() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
onPress={() => { }}
|
onPress={() => {router.push('/member/1')}}
|
||||||
borderType="all"
|
borderType="all"
|
||||||
icon={
|
icon={
|
||||||
<Image
|
<Image
|
||||||
@@ -87,7 +87,7 @@ export default function Index() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
onPress={() => { }}
|
onPress={() => {router.push('/member/1')}}
|
||||||
borderType="all"
|
borderType="all"
|
||||||
icon={
|
icon={
|
||||||
<Image
|
<Image
|
||||||
@@ -100,7 +100,7 @@ export default function Index() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
onPress={() => { }}
|
onPress={() => {router.push('/member/1')}}
|
||||||
borderType="all"
|
borderType="all"
|
||||||
icon={
|
icon={
|
||||||
<Image
|
<Image
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import AlertKonfirmasi from "@/components/alertKonfirmasi";
|
import AlertKonfirmasi from "@/components/alertKonfirmasi";
|
||||||
import ButtonBackHeader from "@/components/buttonBackHeader";
|
import ButtonBackHeader from "@/components/buttonBackHeader";
|
||||||
import { ButtonHeader } from "@/components/buttonHeader";
|
import { ButtonHeader } from "@/components/buttonHeader";
|
||||||
|
import ItemDetailMember from "@/components/itemDetailMember";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { AntDesign, MaterialCommunityIcons, MaterialIcons, Octicons } from "@expo/vector-icons";
|
import { Octicons } from "@expo/vector-icons";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import { Image, SafeAreaView, ScrollView, Text, View } from "react-native";
|
import { Image, SafeAreaView, ScrollView, Text, View } from "react-native";
|
||||||
|
|
||||||
@@ -14,6 +15,7 @@ export default function Profile() {
|
|||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
headerTitle: 'Profile',
|
headerTitle: 'Profile',
|
||||||
headerTitleAlign: 'center',
|
headerTitleAlign: 'center',
|
||||||
|
headerShadowVisible: false,
|
||||||
headerRight: () => <ButtonHeader
|
headerRight: () => <ButtonHeader
|
||||||
item={<Octicons name="sign-out" size={20} color="white" />}
|
item={<Octicons name="sign-out" size={20} color="white" />}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
@@ -41,55 +43,12 @@ export default function Profile() {
|
|||||||
<Text style={[Styles.textDefaultSemiBold]}>Informasi</Text>
|
<Text style={[Styles.textDefaultSemiBold]}>Informasi</Text>
|
||||||
<Text style={[Styles.textLink]}>Edit</Text>
|
<Text style={[Styles.textLink]}>Edit</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.mt10]}>
|
<ItemDetailMember category="nik" value="123456789" />
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
<ItemDetailMember category="group" value="Dinas" />
|
||||||
<MaterialCommunityIcons name="card-account-details" size={22} color="black" style={[Styles.mr10]} />
|
<ItemDetailMember category="position" value="Sekretaris" />
|
||||||
<Text style={[Styles.textDefault]}>NIK</Text>
|
<ItemDetailMember category="phone" value="08980873782" />
|
||||||
</View>
|
<ItemDetailMember category="email" value="putri@gmail.com" />
|
||||||
<Text style={[Styles.textDefaultSemiBold]}>123456789</Text>
|
<ItemDetailMember category="gender" value="Perempuan" />
|
||||||
</View>
|
|
||||||
|
|
||||||
<View style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.mt10]}>
|
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
|
||||||
<AntDesign name="tags" size={25} color="black" style={[Styles.mr10]} />
|
|
||||||
<Text style={[Styles.textDefault]}>Lembaga Desa</Text>
|
|
||||||
</View>
|
|
||||||
<Text style={[Styles.textDefaultSemiBold]}>Dinas</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.mt10]}>
|
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
|
||||||
<MaterialCommunityIcons name="account-tie" size={25} color="black" style={[Styles.mr10]} />
|
|
||||||
<Text style={[Styles.textDefault]}>Jabatan</Text>
|
|
||||||
</View>
|
|
||||||
<Text style={[Styles.textDefaultSemiBold]}>Bendahara</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.mt10]}>
|
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
|
||||||
<MaterialIcons name="phone" size={25} color="black" style={[Styles.mr10]} />
|
|
||||||
<Text style={[Styles.textDefault]}>No Telepon</Text>
|
|
||||||
</View>
|
|
||||||
<Text style={[Styles.textDefaultSemiBold]}>09482903842</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.mt10]}>
|
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
|
||||||
<MaterialIcons name="email" size={25} color="black" style={[Styles.mr10]} />
|
|
||||||
<Text style={[Styles.textDefault]}>Email</Text>
|
|
||||||
</View>
|
|
||||||
<Text style={[Styles.textDefaultSemiBold]}>ayu@gmail.com</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
|
|
||||||
<View style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.mt10]}>
|
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
|
||||||
<MaterialCommunityIcons name="gender-male-female" size={25} color="black" style={[Styles.mr10]} />
|
|
||||||
<Text style={[Styles.textDefault]}>Jenis Kelamin</Text>
|
|
||||||
</View>
|
|
||||||
<Text style={[Styles.textDefaultSemiBold]}>Perempuan</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export function InputForm({ label, placeholder, onChange, info, error, errorText
|
|||||||
<View style={[Styles.mb10]}>
|
<View style={[Styles.mb10]}>
|
||||||
{
|
{
|
||||||
label != undefined && (
|
label != undefined && (
|
||||||
<Text style={[Styles.mb05, { textTransform: "capitalize" }, error && Styles.cError]}>
|
<Text style={[Styles.mb05, error && Styles.cError]}>
|
||||||
{label}
|
{label}
|
||||||
{required && (<Text style={Styles.cError}>*</Text>)}
|
{required && (<Text style={Styles.cError}>*</Text>)}
|
||||||
</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 Styles from "@/constants/Styles"
|
||||||
import MenuItemRow from "../menuItemRow"
|
|
||||||
import { AntDesign } from "@expo/vector-icons"
|
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() {
|
export default function HeaderMemberList() {
|
||||||
const [isVisible, setVisible] = useState(false)
|
const [isVisible, setVisible] = useState(false)
|
||||||
|
const [isFilter, setFilter] = useState(false)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||||
@@ -18,15 +19,22 @@ export default function HeaderMemberList() {
|
|||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
icon={<AntDesign name="pluscircle" color="black" size={25} />}
|
icon={<AntDesign name="pluscircle" color="black" size={25} />}
|
||||||
title="Tambah Anggota"
|
title="Tambah Anggota"
|
||||||
onPress={() => { }}
|
onPress={() => {
|
||||||
|
setVisible(false)
|
||||||
|
router.push('/member/create')
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
icon={<AntDesign name="filter" color="black" size={25} />}
|
icon={<AntDesign name="filter" color="black" size={25} />}
|
||||||
title="Filter"
|
title="Filter"
|
||||||
onPress={() => { }}
|
onPress={() => {
|
||||||
|
setVisible(false)
|
||||||
|
setFilter(true)
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
|
<ModalFilter close={() => { setFilter(false) }} open={isFilter} page="member" />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@ type Props = {
|
|||||||
|
|
||||||
export default function MenuItemRow({ onPress, icon, title }: Props) {
|
export default function MenuItemRow({ onPress, icon, title }: Props) {
|
||||||
return (
|
return (
|
||||||
<Pressable onPressOut={() => { console.log('press'); onPress() }} style={[Styles.btnMenuRow]}>
|
<Pressable onPressOut={() => { onPress() }} style={[Styles.btnMenuRow]}>
|
||||||
<View style={{ alignItems: 'center' }}>
|
<View style={{ alignItems: 'center' }}>
|
||||||
{icon}
|
{icon}
|
||||||
<Text style={[Styles.mt05]}>{title}</Text>
|
<Text style={[Styles.mt05]}>{title}</Text>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { router } from "expo-router"
|
|||||||
type Props = {
|
type Props = {
|
||||||
open: boolean,
|
open: boolean,
|
||||||
close: (value: boolean) => void
|
close: (value: boolean) => void
|
||||||
page: 'position'
|
page: 'position' | 'member'
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ModalFilter({ open, close, page }: Props) {
|
export default function ModalFilter({ open, close, page }: Props) {
|
||||||
|
|||||||
@@ -22,5 +22,8 @@ export const ColorsStatus = {
|
|||||||
},
|
},
|
||||||
lightGreen: {
|
lightGreen: {
|
||||||
backgroundColor: '#d2f0cb'
|
backgroundColor: '#d2f0cb'
|
||||||
|
},
|
||||||
|
gray: {
|
||||||
|
backgroundColor: '#d9d9d9'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,10 +21,13 @@
|
|||||||
"expo": "~52.0.37",
|
"expo": "~52.0.37",
|
||||||
"expo-blur": "~14.0.3",
|
"expo-blur": "~14.0.3",
|
||||||
"expo-constants": "~17.0.7",
|
"expo-constants": "~17.0.7",
|
||||||
|
"expo-document-picker": "^13.0.3",
|
||||||
"expo-font": "~13.0.4",
|
"expo-font": "~13.0.4",
|
||||||
"expo-haptics": "~14.0.1",
|
"expo-haptics": "~14.0.1",
|
||||||
|
"expo-image-picker": "~16.0.6",
|
||||||
"expo-linear-gradient": "~14.0.2",
|
"expo-linear-gradient": "~14.0.2",
|
||||||
"expo-linking": "~7.0.5",
|
"expo-linking": "~7.0.5",
|
||||||
|
"expo-media-library": "~17.0.6",
|
||||||
"expo-router": "~4.0.17",
|
"expo-router": "~4.0.17",
|
||||||
"expo-splash-screen": "~0.29.22",
|
"expo-splash-screen": "~0.29.22",
|
||||||
"expo-status-bar": "~2.0.1",
|
"expo-status-bar": "~2.0.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user