Deskripsi :
- load refresh pada project
- load refresh pada task divisi
- text pada modal salin atau pindah
- crash modal pada modal more dokumen divisi
- memberi loadin pada modal info dokumen divisi
- crash modal pada header dokumen divisi
- kyboard avoiding pada project
- keyboard avoiding pada tugas divisi
- image pada user yg diselect pada tambah anggota divisi

nb : qc blm selesai

No Issues
This commit is contained in:
2025-07-31 15:10:51 +08:00
parent 5898655fac
commit e7ef09e9aa
21 changed files with 584 additions and 456 deletions

View File

@@ -23,6 +23,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
const { token, decryptToken } = useAuthSession()
const dispatch = useDispatch()
const update = useSelector((state: any) => state.dokumenUpdate)
const [loading, setLoading] = useState(false)
async function handleCreateFolder() {
try {
@@ -56,6 +57,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
async function handleUploadFile(file: any) {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
fd.append("file", {
@@ -85,6 +87,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setVisible(false)
setLoading(false)
}
}
@@ -99,7 +102,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
<DrawerBottom
animation="slide"
isVisible={isVisible}
setVisible={setVisible}
setVisible={() => { setVisible(false) }}
title="Menu"
>
<View style={Styles.rowItemsCenter}>
@@ -111,10 +114,12 @@ export default function HeaderRightDocument({ path }: { path: string }) {
size={25}
/>
}
title="Tambah Dokumen"
title="Tambah Folder"
onPress={() => {
setVisible(false);
setNewFolder(true);
setTimeout(() => {
setNewFolder(true);
}, 600);
}}
/>
@@ -128,11 +133,9 @@ export default function HeaderRightDocument({ path }: { path: string }) {
<ModalFloat
title="Buat Folder Baru"
isVisible={newFolder}
setVisible={setNewFolder}
setVisible={() => { setNewFolder(false) }}
disableSubmit={name == ""}
onSubmit={() => {
handleCreateFolder()
}}
onSubmit={() => { handleCreateFolder() }}
>
<View>
<InputForm
@@ -140,9 +143,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
placeholder="Nama Folder"
required
label="Nama Folder"
onChange={(value: string) => {
setName(value);
}}
onChange={(value: string) => { setName(value) }}
/>
</View>
</ModalFloat>

View File

@@ -3,10 +3,11 @@ import { apiGetDocumentInformasi } from "@/lib/api";
import { useAuthSession } from "@/providers/AuthProvider";
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
import { useEffect, useState } from "react";
import { Pressable, ScrollView, View } from "react-native";
import { ActivityIndicator, Pressable, ScrollView, View } from "react-native";
import { useSharedValue } from "react-native-reanimated";
import ItemAccordion from "../itemAccordion";
import ItemDetailMember from "../itemDetailMember";
import ModalLoading from "../modalLoading";
import Text from "../Text";
type Props = {
@@ -29,9 +30,11 @@ export default function ModalInformasi({ data }: { data: any }) {
const [dataInformasi, setDataInformasi] = useState<Props>()
const { token, decryptToken } = useAuthSession()
const [dataShare, setDataShare] = useState<PropsShare[]>([])
const [loading, setLoading] = useState(true)
async function handleInformasi() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiGetDocumentInformasi({ user: hasil, item: data.id, cat: 'lainnya' })
setDataInformasi(response.data)
@@ -40,6 +43,8 @@ export default function ModalInformasi({ data }: { data: any }) {
setDataShare(responseShare.data)
} catch (error) {
console.error(error)
} finally {
setLoading(false)
}
}
@@ -59,39 +64,47 @@ export default function ModalInformasi({ data }: { data: any }) {
}
</View>
<View>
<ItemDetailMember category="dokumen" value={dataInformasi?.category == 'FOLDER' ? dataInformasi?.name : `${dataInformasi?.name}.${dataInformasi?.extension}`} border />
<ItemDetailMember category="type" value={dataInformasi?.category} border />
<ItemDetailMember category="location" value={dataInformasi?.path} border />
<ItemDetailMember category="owner" value={dataInformasi?.division} border />
<ItemDetailMember category="calendar" value={dataInformasi?.createdAt} border />
<Pressable style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.wrapItemBorderBottom]} onPress={() => { open.value = !open.value; }}>
<View style={[Styles.rowItemsCenter]}>
<MaterialCommunityIcons name="share-variant-outline" size={22} color="black" style={[Styles.mr10]} />
<Text style={[Styles.textDefault]}>Telah dibagikan ke divisi</Text>
{
loading ? (
<View>
<ActivityIndicator size="large" />
</View>
<MaterialCommunityIcons name="chevron-down" size={22} color="black" />
</Pressable>
<ItemAccordion isExpanded={open} viewKey="Accordion" duration={500}>
<ScrollView style={[Styles.w100, { height: 200 }]} >
{
dataShare.length > 0 ? (
dataShare.map((item, index) => (
<View key={index} style={[Styles.rowOnly, Styles.ml10, Styles.mt02]}>
<MaterialCommunityIcons name="account-group-outline" size={22} color="black" style={[Styles.mr10]} />
<Text style={[Styles.textDefault]}>{item.name}</Text>
</View>
))
)
: (
<View style={[Styles.ml10, Styles.mt02]}>
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
</View>
)
}
</ScrollView>
</ItemAccordion>
</View>
) : (
<View>
<ItemDetailMember category="dokumen" value={dataInformasi?.category == 'FOLDER' ? dataInformasi?.name : `${dataInformasi?.name}.${dataInformasi?.extension}`} border />
<ItemDetailMember category="type" value={dataInformasi?.category} border />
<ItemDetailMember category="location" value={dataInformasi?.path} border />
<ItemDetailMember category="owner" value={dataInformasi?.division} border />
<ItemDetailMember category="calendar" value={dataInformasi?.createdAt} border />
<Pressable style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.wrapItemBorderBottom]} onPress={() => { open.value = !open.value; }}>
<View style={[Styles.rowItemsCenter]}>
<MaterialCommunityIcons name="share-variant-outline" size={22} color="black" style={[Styles.mr10]} />
<Text style={[Styles.textDefault]}>Telah dibagikan ke divisi</Text>
</View>
<MaterialCommunityIcons name="chevron-down" size={22} color="black" />
</Pressable>
<ItemAccordion isExpanded={open} viewKey="Accordion" duration={500}>
<ScrollView style={[Styles.w100, { height: 200 }]} >
{
dataShare.length > 0 ? (
dataShare.map((item, index) => (
<View key={index} style={[Styles.rowOnly, Styles.ml10, Styles.mt02]}>
<MaterialCommunityIcons name="account-group-outline" size={22} color="black" style={[Styles.mr10]} />
<Text style={[Styles.textDefault]}>{item.name}</Text>
</View>
))
)
: (
<View style={[Styles.ml10, Styles.mt02]}>
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
</View>
)
}
</ScrollView>
</ItemAccordion>
</View>
)
}
</>
)
}

View File

@@ -155,7 +155,7 @@ export default function ModalMore({
<DrawerBottom
animation="slide"
isVisible={isInformasi}
setVisible={setInformasi}
setVisible={() => setInformasi(false)}
title="Informasi Dokumen"
height={80}
>

View File

@@ -4,9 +4,10 @@ import { useAuthSession } from "@/providers/AuthProvider"
import { AntDesign, Ionicons } from "@expo/vector-icons"
import { useLocalSearchParams } from "expo-router"
import { useEffect, useState } from "react"
import { Pressable, Text, View } from "react-native"
import { Pressable, View } from "react-native"
import BorderBottomItem from "../borderBottomItem"
import DrawerBottom from "../drawerBottom"
import Text from "../Text"
type Props = {
open: boolean

View File

@@ -27,7 +27,7 @@ type Props = {
idStorage: string
}
export default function SectionFileTask() {
export default function SectionFileTask({refreshing}: {refreshing: boolean}) {
const [isModal, setModal] = useState(false)
const { token, decryptToken } = useAuthSession()
const { detail } = useLocalSearchParams<{ detail: string }>()
@@ -56,6 +56,11 @@ export default function SectionFileTask() {
handleLoad(false)
}, [update.file])
useEffect(() => {
if (refreshing)
handleLoad(false);
}, [refreshing]);
useEffect(() => {
handleLoad(true)
}, [])

View File

@@ -25,7 +25,7 @@ type Props = {
position: string;
};
export default function SectionMemberTask() {
export default function SectionMemberTask({ refreshing }: { refreshing: boolean }) {
const [isModal, setModal] = useState(false);
const { token, decryptToken } = useAuthSession();
const { id, detail } = useLocalSearchParams<{ id: string; detail: string }>();
@@ -64,6 +64,10 @@ export default function SectionMemberTask() {
handleLoad(true);
}, [])
useEffect(() => {
if (refreshing)
handleLoad(false);
}, [refreshing]);
async function handleDeleteMember() {
try {

View File

@@ -25,7 +25,7 @@ type Props = {
dateEnd: string;
}
export default function SectionTanggalTugasTask() {
export default function SectionTanggalTugasTask({refreshing}: {refreshing: boolean}) {
const dispatch = useDispatch()
const update = useSelector((state: any) => state.taskUpdate)
const [isModal, setModal] = useState(false)
@@ -79,6 +79,11 @@ export default function SectionTanggalTugasTask() {
handleLoad(false)
}, [update.task])
useEffect(() => {
if (refreshing)
handleLoad(false);
}, [refreshing]);
useEffect(() => {
handleLoad(true)
@@ -153,7 +158,9 @@ export default function SectionTanggalTugasTask() {
title="Update Status"
onPress={() => {
setModal(false)
setSelect(true)
setTimeout(() => {
setSelect(true)
}, 600);
}}
/>
<MenuItemRow
@@ -185,10 +192,8 @@ export default function SectionTanggalTugasTask() {
<ModalSelect
category="status-task"
close={setSelect}
onSelect={(value) => {
handleUpdate(Number(value.val))
}}
close={() => setSelect(false)}
onSelect={(value) => { handleUpdate(Number(value.val)) }}
title="Status"
open={isSelect}
valChoose={String(tugas.status)}