upd: project
Deskripsi: - delete project yg telah dibatalkan - akses fitur by user role - tampilan text yg panjang No Issues
This commit is contained in:
@@ -5,6 +5,7 @@ import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Text, ToastAndroid, View } from "react-native";
|
||||
import { useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import BorderBottomItem from "../borderBottomItem";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
@@ -17,7 +18,8 @@ type Props = {
|
||||
idStorage: string
|
||||
}
|
||||
|
||||
export default function SectionFile() {
|
||||
export default function SectionFile({ status, member }: { status: number | undefined, member: boolean }) {
|
||||
const entityUser = useSelector((state: any) => state.user)
|
||||
const [isModal, setModal] = useState(false)
|
||||
const { token, decryptToken } = useAuthSession();
|
||||
const { id } = useLocalSearchParams<{ id: string }>();
|
||||
@@ -82,22 +84,27 @@ export default function SectionFile() {
|
||||
setModal(false)
|
||||
}}
|
||||
/>
|
||||
{
|
||||
!member && (entityUser.role == "user" || entityUser.role == "coadmin") ? <></>
|
||||
:
|
||||
<MenuItemRow
|
||||
icon={<Ionicons name="trash" color="black" size={25} />}
|
||||
title="Hapus"
|
||||
disabled={status == 3}
|
||||
onPress={() => {
|
||||
if (status == 3) return
|
||||
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)
|
||||
}
|
||||
})
|
||||
|
||||
<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>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user