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

@@ -6,6 +6,7 @@ import DrawerBottom from "@/components/drawerBottom"
import ImageUser from "@/components/imageNew" import ImageUser from "@/components/imageNew"
import MenuItemRow from "@/components/menuItemRow" import MenuItemRow from "@/components/menuItemRow"
import Skeleton from "@/components/skeleton" import Skeleton from "@/components/skeleton"
import Text from "@/components/Text"
import Styles from "@/constants/Styles" import Styles from "@/constants/Styles"
import { apiDeleteCalendarMember, apiGetCalendarOne, apiGetDivisionOneFeature } from "@/lib/api" import { apiDeleteCalendarMember, apiGetCalendarOne, apiGetDivisionOneFeature } from "@/lib/api"
import { setUpdateCalendar } from "@/lib/calendarUpdate" import { setUpdateCalendar } from "@/lib/calendarUpdate"
@@ -13,7 +14,7 @@ import { useAuthSession } from "@/providers/AuthProvider"
import { MaterialCommunityIcons } from "@expo/vector-icons" import { MaterialCommunityIcons } from "@expo/vector-icons"
import { router, Stack, useLocalSearchParams } from "expo-router" import { router, Stack, useLocalSearchParams } from "expo-router"
import { useEffect, useState } from "react" import { useEffect, useState } from "react"
import { SafeAreaView, ScrollView, Text, View } from "react-native" import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native"
import Toast from "react-native-toast-message" import Toast from "react-native-toast-message"
import { useDispatch, useSelector } from "react-redux" import { useDispatch, useSelector } from "react-redux"
@@ -52,7 +53,7 @@ export default function DetailEventCalendar() {
const entityUser = useSelector((state: any) => state.user); const entityUser = useSelector((state: any) => state.user);
const [isMemberDivision, setIsMemberDivision] = useState(false); const [isMemberDivision, setIsMemberDivision] = useState(false);
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
const arrSkeleton = Array.from({ length: 5 }) const [refreshing, setRefreshing] = useState(false)
async function handleCheckMember() { async function handleCheckMember() {
try { try {
@@ -69,9 +70,9 @@ export default function DetailEventCalendar() {
} }
} }
async function handleLoad() { async function handleLoad(loading:boolean) {
try { try {
setLoading(true) setLoading(loading)
const hasil = await decryptToken(String(token?.current)); const hasil = await decryptToken(String(token?.current));
const response = await apiGetCalendarOne({ const response = await apiGetCalendarOne({
user: hasil, user: hasil,
@@ -105,7 +106,7 @@ export default function DetailEventCalendar() {
} }
useEffect(() => { useEffect(() => {
handleLoad(); handleLoad(true);
handleCheckMember() handleCheckMember()
}, []); }, []);
@@ -133,6 +134,15 @@ export default function DetailEventCalendar() {
} }
} }
const handleRefresh = async () => {
setRefreshing(true)
handleLoad(false)
handleLoadMember()
await new Promise(resolve => setTimeout(resolve, 2000));
setRefreshing(false)
};
return ( return (
<SafeAreaView> <SafeAreaView>
<Stack.Screen <Stack.Screen
@@ -143,7 +153,15 @@ export default function DetailEventCalendar() {
headerRight: () => (entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision ? <></> : <HeaderRightCalendarDetail id={String(data?.idCalendar)} idReminder={String(detail)} /> headerRight: () => (entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision ? <></> : <HeaderRightCalendarDetail id={String(data?.idCalendar)} idReminder={String(detail)} />
}} }}
/> />
<ScrollView> <ScrollView
style={[Styles.h100]}
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={handleRefresh}
/>
}
>
<View style={[Styles.p15]}> <View style={[Styles.p15]}>
<View style={[Styles.wrapPaper, Styles.mb15]}> <View style={[Styles.wrapPaper, Styles.mb15]}>
<View style={Styles.rowItemsCenter}> <View style={Styles.rowItemsCenter}>

View File

@@ -157,6 +157,13 @@ export default function CalendarDivision() {
onChange={({ date }) => setSelected(date)} onChange={({ date }) => setSelected(date)}
styles={{ styles={{
selected: Styles.selectedDate, selected: Styles.selectedDate,
month_label: Styles.cBlack,
month_selector_label: Styles.cBlack,
year_label: Styles.cBlack,
year_selector_label: Styles.cBlack,
day_label: Styles.cBlack,
time_label: Styles.cBlack,
weekday_label: Styles.cBlack,
}} }}
/> />
</View> </View>

View File

@@ -18,7 +18,7 @@ import { Ionicons, MaterialIcons } from "@expo/vector-icons";
import { firebase } from "@react-native-firebase/database"; import { firebase } from "@react-native-firebase/database";
import { router, Stack, useLocalSearchParams } from "expo-router"; import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Pressable, ScrollView, View } from "react-native"; import { KeyboardAvoidingView, Platform, Pressable, RefreshControl, ScrollView, View } from "react-native";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
type Props = { type Props = {
@@ -58,6 +58,7 @@ export default function DiscussionDetail() {
const [loadingKomentar, setLoadingKomentar] = useState(true) const [loadingKomentar, setLoadingKomentar] = useState(true)
const arrSkeleton = Array.from({ length: 3 }) const arrSkeleton = Array.from({ length: 3 })
const reference = firebase.app().database('https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app').ref(`/discussion-division/${detail}`); const reference = firebase.app().database('https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app').ref(`/discussion-division/${detail}`);
const [refreshing, setRefreshing] = useState(false)
useEffect(() => { useEffect(() => {
@@ -165,6 +166,15 @@ export default function DiscussionDetail() {
} }
} }
const handleRefresh = async () => {
setRefreshing(true)
handleLoad(false)
handleLoadComment(false)
await new Promise(resolve => setTimeout(resolve, 2000));
setRefreshing(false)
};
return ( return (
<> <>
<Stack.Screen <Stack.Screen
@@ -189,7 +199,14 @@ export default function DiscussionDetail() {
}} }}
/> />
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<ScrollView> <ScrollView
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={handleRefresh}
/>
}
>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
{ {
loading ? loading ?
@@ -264,63 +281,68 @@ export default function DiscussionDetail() {
</View> </View>
</View> </View>
</ScrollView> </ScrollView>
<View <KeyboardAvoidingView
style={[ behavior={Platform.OS === 'ios' ? 'padding' : undefined}
Styles.contentItemCenter, keyboardVerticalOffset={110}
Styles.absolute0,
Styles.w100,
{ backgroundColor: "#f4f4f4" },
]}
> >
<InputForm <View
disable={ style={[
data?.status == 2 || Styles.contentItemCenter,
data?.isActive == false || Styles.w100,
((entityUser.role == "user" || entityUser.role == "coadmin") && { backgroundColor: "#f4f4f4" },
!isMemberDivision) ]}
} >
bg="white" <InputForm
type="default" disable={
round data?.status == 2 ||
placeholder="Kirim Komentar" data?.isActive == false ||
onChange={setKomentar} ((entityUser.role == "user" || entityUser.role == "coadmin") &&
value={komentar} !isMemberDivision)
itemRight={ }
<Pressable bg="white"
onPress={() => { type="default"
komentar != "" && round
!loadingSend && placeholder="Kirim Komentar"
data?.status != 2 && onChange={setKomentar}
data?.isActive && value={komentar}
(((entityUser.role == "user" || itemRight={
entityUser.role == "coadmin") && <Pressable
isMemberDivision) || onPress={() => {
entityUser.role == "admin" || komentar != "" &&
entityUser.role == "supadmin" || !loadingSend &&
entityUser.role == "developer" || data?.status != 2 &&
entityUser.role == "cosupadmin") && data?.isActive &&
handleKomentar(); (((entityUser.role == "user" ||
}}
>
<MaterialIcons
name="send"
size={25}
style={
komentar == "" ||
loadingSend ||
data?.status == 2 ||
data?.isActive == false ||
((entityUser.role == "user" ||
entityUser.role == "coadmin") && entityUser.role == "coadmin") &&
!isMemberDivision) isMemberDivision) ||
? Styles.cGray entityUser.role == "admin" ||
: Styles.cDefault entityUser.role == "supadmin" ||
} entityUser.role == "developer" ||
/> entityUser.role == "cosupadmin") &&
</Pressable> handleKomentar();
} }}
/> >
</View> <MaterialIcons
name="send"
size={25}
style={
komentar == "" ||
loadingSend ||
data?.status == 2 ||
data?.isActive == false ||
((entityUser.role == "user" ||
entityUser.role == "coadmin") &&
!isMemberDivision)
? Styles.cGray
: Styles.cDefault
}
/>
</Pressable>
}
/>
</View>
</KeyboardAvoidingView>
</View> </View>
</> </>
); );

View File

@@ -112,7 +112,7 @@ export default function DocumentDivision() {
useEffect(() => { useEffect(() => {
handleLoad(true); handleLoad(true);
}, [path, update]); }, [path]);
const handleCheckboxChange = (index: number) => { const handleCheckboxChange = (index: number) => {
setDariSelectAll(false); setDariSelectAll(false);
@@ -243,6 +243,7 @@ export default function DocumentDivision() {
useEffect(() => { useEffect(() => {
handleBatal(); handleBatal();
handleLoad(false)
}, [update]); }, [update]);
async function handleShare(selectedDivision: any[]) { async function handleShare(selectedDivision: any[]) {
@@ -270,7 +271,7 @@ export default function DocumentDivision() {
const openFile = (item: Props) => { const openFile = (item: Props) => {
setLoadingOpen(true) if (Platform.OS == 'android') setLoadingOpen(true)
let remoteUrl = 'https://wibu-storage.wibudev.com/api/files/' + item.idStorage; let remoteUrl = 'https://wibu-storage.wibudev.com/api/files/' + item.idStorage;
const fileName = item.name + '.' + item.extension; const fileName = item.name + '.' + item.extension;
let localPath = `${FileSystem.documentDirectory}/${fileName}`; let localPath = `${FileSystem.documentDirectory}/${fileName}`;
@@ -278,9 +279,9 @@ export default function DocumentDivision() {
FileSystem.downloadAsync(remoteUrl, localPath).then(async ({ uri }) => { FileSystem.downloadAsync(remoteUrl, localPath).then(async ({ uri }) => {
const contentURL = await FileSystem.getContentUriAsync(uri); const contentURL = await FileSystem.getContentUriAsync(uri);
setLoadingOpen(false)
try { try {
if (Platform.OS == 'android') { if (Platform.OS == 'android') {
// open with android intent
await startActivityAsync( await startActivityAsync(
'android.intent.action.VIEW', 'android.intent.action.VIEW',
{ {
@@ -289,16 +290,13 @@ export default function DocumentDivision() {
type: mimeType as string, type: mimeType as string,
} }
); );
// or
// Sharing.shareAsync(localPath);
} else if (Platform.OS == 'ios') { } else if (Platform.OS == 'ios') {
Sharing.shareAsync(localPath); Sharing.shareAsync(localPath);
} }
} catch (error) { } catch (error) {
Alert.alert('INFO', 'Gagal membuka file, tidak ada aplikasi yang dapat membuka file ini'); Alert.alert('INFO', 'Gagal membuka file, tidak ada aplikasi yang dapat membuka file ini');
} finally { } finally {
setLoadingOpen(false) if (Platform.OS == 'android') setLoadingOpen(false)
} }
}); });
}; };
@@ -375,7 +373,7 @@ export default function DocumentDivision() {
}} }}
> >
{item.id != "home" && ( {item.id != "home" && (
<AntDesign name="right" style={[Styles.mh05, Styles.mt02]} /> <AntDesign name="right" style={[Styles.mh05, Styles.mt02]} color="black" />
)} )}
<Text> {item.name} </Text> <Text> {item.name} </Text>
</Pressable> </Pressable>
@@ -538,13 +536,11 @@ export default function DocumentDivision() {
<DrawerBottom <DrawerBottom
animation="slide" animation="slide"
isVisible={modalMore} isVisible={modalMore}
setVisible={setModalMore} setVisible={() => { setModalMore(false) }}
title="" title=""
> >
<ModalMore <ModalMore
onClose={() => { onClose={() => { setModalMore(false); }}
setModalMore(false);
}}
data={selectedFiles} data={selectedFiles}
share={shareSelected} share={shareSelected}
/> />
@@ -553,7 +549,7 @@ export default function DocumentDivision() {
<ModalFloat <ModalFloat
title="Ganti Nama" title="Ganti Nama"
isVisible={isRename} isVisible={isRename}
setVisible={setRename} setVisible={() => { setRename(false) }}
onSubmit={() => { onSubmit={() => {
handleRename(); handleRename();
}} }}
@@ -576,7 +572,7 @@ export default function DocumentDivision() {
title="Bagikan" title="Bagikan"
category="share-division" category="share-division"
open={isShare} open={isShare}
close={setShare} close={() => { setShare(false) }}
onSelect={(value) => { onSelect={(value) => {
handleShare(value) handleShare(value)
}} }}

View File

@@ -10,7 +10,7 @@ import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router"; import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { import {
SafeAreaView, KeyboardAvoidingView, Platform, SafeAreaView,
ScrollView, ScrollView,
View View
} from "react-native"; } from "react-native";
@@ -121,59 +121,65 @@ export default function TaskDivisionAddTask() {
), ),
}} }}
/> />
<ScrollView> <KeyboardAvoidingView
<View style={[Styles.p15, Styles.mb100]}> behavior={Platform.OS === 'ios' ? 'padding' : undefined}
<View style={[Styles.wrapPaper, Styles.p10]}> keyboardVerticalOffset={110}
<DateTimePicker >
mode="range" <ScrollView>
startDate={range.startDate} <View style={[Styles.p15, Styles.mb100]}>
endDate={range.endDate} <View style={[Styles.wrapPaper, Styles.p10]}>
onChange={(param) => setRange(param)} <DateTimePicker
styles={{ mode="range"
selected: Styles.selectedDate, startDate={range.startDate}
selected_label: Styles.cWhite, endDate={range.endDate}
range_fill: Styles.selectRangeDate, onChange={(param) => setRange(param)}
styles={{
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
}}
/>
</View>
<View style={[Styles.mv10]}>
<View style={[Styles.rowSpaceBetween]}>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}} }}
/> />
</View> </View>
<View style={[Styles.mv10]}> </ScrollView>
<View style={[Styles.rowSpaceBetween]}> </KeyboardAvoidingView>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}}
/>
</View>
</ScrollView>
</SafeAreaView> </SafeAreaView>
); );
} }

View File

@@ -10,7 +10,7 @@ import { apiGetTaskOne } from "@/lib/api";
import { useAuthSession } from "@/providers/AuthProvider"; import { useAuthSession } from "@/providers/AuthProvider";
import { router, Stack, useLocalSearchParams } from "expo-router"; import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { SafeAreaView, ScrollView, View } from "react-native"; import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
type Props = { type Props = {
@@ -29,6 +29,7 @@ export default function DetailTaskDivision() {
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
const [progress, setProgress] = useState(0) const [progress, setProgress] = useState(0)
const update = useSelector((state: any) => state.taskUpdate) const update = useSelector((state: any) => state.taskUpdate)
const [refreshing, setRefreshing] = useState(false)
async function handleLoad(cat: 'data' | 'progress') { async function handleLoad(cat: 'data' | 'progress') {
@@ -56,6 +57,14 @@ export default function DetailTaskDivision() {
handleLoad('progress') handleLoad('progress')
}, [update.progress]) }, [update.progress])
const handleRefresh = async () => {
setRefreshing(true)
await handleLoad('data')
await handleLoad('progress')
await new Promise(resolve => setTimeout(resolve, 2000));
setRefreshing(false)
};
return ( return (
<SafeAreaView> <SafeAreaView>
<Stack.Screen <Stack.Screen
@@ -66,15 +75,22 @@ export default function DetailTaskDivision() {
headerRight: () => <HeaderRightTaskDetail id={detail} division={id} status={data?.status} />, headerRight: () => <HeaderRightTaskDetail id={detail} division={id} status={data?.status} />,
}} }}
/> />
<ScrollView> <ScrollView
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={handleRefresh}
/>
}
>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
{ {
data?.reason != null && data?.reason != "" && <SectionCancel text={data?.reason} /> data?.reason != null && data?.reason != "" && <SectionCancel text={data?.reason} />
} }
<SectionProgress text={`Kemajuan Kegiatan ${progress}%`} progress={progress} /> <SectionProgress text={`Kemajuan Kegiatan ${progress}%`} progress={progress} />
<SectionTanggalTugasTask /> <SectionTanggalTugasTask refreshing={refreshing}/>
<SectionFileTask /> <SectionFileTask refreshing={refreshing}/>
<SectionMemberTask /> <SectionMemberTask refreshing={refreshing}/>
</View> </View>
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>

View File

@@ -8,6 +8,8 @@ import dayjs from "dayjs";
import { router, Stack } from "expo-router"; import { router, Stack } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { import {
KeyboardAvoidingView,
Platform,
SafeAreaView, SafeAreaView,
ScrollView, ScrollView,
View View
@@ -97,59 +99,64 @@ export default function CreateTaskAddTugas() {
), ),
}} }}
/> />
<ScrollView> <KeyboardAvoidingView
<View style={[Styles.p15, Styles.mb100]}> behavior={Platform.OS === 'ios' ? 'padding' : undefined}
<View style={[Styles.wrapPaper, Styles.p10]}> keyboardVerticalOffset={110}
<DateTimePicker >
mode="range" <ScrollView>
startDate={range.startDate} <View style={[Styles.p15, Styles.mb100]}>
endDate={range.endDate} <View style={[Styles.wrapPaper, Styles.p10]}>
onChange={(param) => setRange(param)} <DateTimePicker
styles={{ mode="range"
selected: Styles.selectedDate, startDate={range.startDate}
selected_label: Styles.cWhite, endDate={range.endDate}
range_fill: Styles.selectRangeDate, onChange={(param) => setRange(param)}
styles={{
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
}}
/>
</View>
<View style={[Styles.mv10]}>
<View style={[Styles.rowSpaceBetween]}>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}} }}
/> />
</View> </View>
<View style={[Styles.mv10]}> </ScrollView>
<View style={[Styles.rowSpaceBetween]}> </KeyboardAvoidingView>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}}
/>
</View>
</ScrollView>
</SafeAreaView> </SafeAreaView>
); );
} }

View File

@@ -193,7 +193,7 @@ export default function ListTask() {
: :
data.length > 0 ? ( data.length > 0 ? (
isList ? ( isList ? (
<View> <View style={[Styles.h100]}>
<VirtualizedList <VirtualizedList
data={data} data={data}
getItemCount={() => data.length} getItemCount={() => data.length}
@@ -241,7 +241,7 @@ export default function ListTask() {
))} */} ))} */}
</View> </View>
) : ( ) : (
<View> <View style={[Styles.h100]}>
<VirtualizedList <VirtualizedList
data={data} data={data}
getItemCount={() => data.length} getItemCount={() => data.length}

View File

@@ -10,6 +10,8 @@ import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router"; import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { import {
KeyboardAvoidingView,
Platform,
SafeAreaView, SafeAreaView,
ScrollView, ScrollView,
View View
@@ -39,9 +41,9 @@ export default function UpdateProjectTaskDivision() {
}); });
const from = range.startDate const from = range.startDate
? dayjs(range.startDate).format("MMM DD, YYYY") ? dayjs(range.startDate).format("DD-MM-YYYY")
: ""; : "";
const to = range.endDate ? dayjs(range.endDate).format("MMM DD, YYYY") : ""; const to = range.endDate ? dayjs(range.endDate).format("DD-MM-YYYY") : "";
async function handleLoad() { async function handleLoad() {
try { try {
@@ -141,65 +143,71 @@ export default function UpdateProjectTaskDivision() {
), ),
}} }}
/> />
<ScrollView> <KeyboardAvoidingView
<View style={[Styles.p15, Styles.mb100]}> behavior={Platform.OS === 'ios' ? 'padding' : undefined}
<View style={[Styles.wrapPaper, Styles.p10]}> keyboardVerticalOffset={110}
{!loading && ( >
<DateTimePicker <ScrollView>
mode="range" <View style={[Styles.p15, Styles.mb100]}>
startDate={range.startDate} <View style={[Styles.wrapPaper, Styles.p10]}>
endDate={range.endDate} {!loading && (
onChange={(param) => setRange(param)} <DateTimePicker
month={month} mode="range"
year={year} startDate={range.startDate}
styles={{ endDate={range.endDate}
selected: Styles.selectedDate, onChange={(param) => setRange(param)}
selected_label: Styles.cWhite, month={month}
range_fill: Styles.selectRangeDate, year={year}
}} styles={{
/> selected: Styles.selectedDate,
)} selected_label: Styles.cWhite,
</View> range_fill: Styles.selectRangeDate,
<View style={[Styles.mv10]}> }}
<View style={[Styles.rowSpaceBetween]}> />
<View style={[{ width: "48%" }]}> )}
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View> </View>
{(error.endDate || error.startDate) && ( <View style={[Styles.mv10]}>
<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]} > <View style={[Styles.rowSpaceBetween]}>
Tanggal tidak boleh kosong <View style={[{ width: "48%" }]}>
</Text> <Text style={[Styles.mb05]}>
)} Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{(error.endDate || error.startDate) && (
<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]} >
Tanggal tidak boleh kosong
</Text>
)}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}}
/>
</View> </View>
<InputForm </ScrollView>
label="Judul Tugas" </KeyboardAvoidingView>
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}}
/>
</View>
</ScrollView>
</SafeAreaView> </SafeAreaView>
); );
} }

View File

@@ -119,7 +119,7 @@ export default function AddMemberDivision() {
<ImageWithLabel <ImageWithLabel
key={index} key={index}
label={item.name} label={item.name}
src={item.img} src={`https://wibu-storage.wibudev.com/api/files/${item.img}`}
onClick={() => onChoose(item.idUser, item.name, item.img)} onClick={() => onChoose(item.idUser, item.name, item.img)}
/> />
)) ))

View File

@@ -134,11 +134,11 @@ export default function InformationDivision() {
headerRight: () => <HeaderRightDivisionInfo id={id} active={dataDetail?.isActive} />, headerRight: () => <HeaderRightDivisionInfo id={id} active={dataDetail?.isActive} />,
}} }}
/> />
<ScrollView> <ScrollView style={[Styles.h100]}>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15]}>
{ {
dataDetail?.isActive == false && ( dataDetail?.isActive == false && (
<SectionCancel title={'Divisi dinonaktifkan'} /> <SectionCancel title={'Divisi nonaktif'} />
) )
} }
<View style={[Styles.mb15]}> <View style={[Styles.mb15]}>

View File

@@ -10,6 +10,8 @@ import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router"; import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { import {
KeyboardAvoidingView,
Platform,
SafeAreaView, SafeAreaView,
ScrollView, ScrollView,
View View
@@ -101,59 +103,64 @@ export default function ProjectAddTask() {
), ),
}} }}
/> />
<ScrollView> <KeyboardAvoidingView
<View style={[Styles.p15, Styles.mb100]}> behavior={Platform.OS === 'ios' ? 'padding' : undefined}
<View style={[Styles.wrapPaper, Styles.p10]}> keyboardVerticalOffset={110}
<DateTimePicker >
mode="range" <ScrollView>
startDate={range.startDate} <View style={[Styles.p15, Styles.mb100]}>
endDate={range.endDate} <View style={[Styles.wrapPaper, Styles.p10]}>
onChange={(param) => setRange(param)} <DateTimePicker
styles={{ mode="range"
selected: Styles.selectedDate, startDate={range.startDate}
selected_label: Styles.cWhite, endDate={range.endDate}
range_fill: Styles.selectRangeDate, onChange={(param) => setRange(param)}
styles={{
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
}}
/>
</View>
<View style={[Styles.mv10]}>
<View style={[Styles.rowSpaceBetween]}>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}} }}
/> />
</View> </View>
<View style={[Styles.mv10]}> </ScrollView>
<View style={[Styles.rowSpaceBetween]}> </KeyboardAvoidingView>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}}
/>
</View>
</ScrollView>
</SafeAreaView> </SafeAreaView>
); );
} }

View File

@@ -8,6 +8,8 @@ import dayjs from "dayjs";
import { router, Stack } from "expo-router"; import { router, Stack } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { import {
KeyboardAvoidingView,
Platform,
SafeAreaView, SafeAreaView,
ScrollView, ScrollView,
View View
@@ -97,59 +99,64 @@ export default function CreateProjectAddTask() {
), ),
}} }}
/> />
<ScrollView> <KeyboardAvoidingView
<View style={[Styles.p15, Styles.mb100]}> behavior={Platform.OS === 'ios' ? 'padding' : undefined}
<View style={[Styles.wrapPaper, Styles.p10]}> keyboardVerticalOffset={110}
<DateTimePicker >
mode="range" <ScrollView>
startDate={range.startDate} <View style={[Styles.p15, Styles.mb100]}>
endDate={range.endDate} <View style={[Styles.wrapPaper, Styles.p10]}>
onChange={(param) => setRange(param)} <DateTimePicker
styles={{ mode="range"
selected: Styles.selectedDate, startDate={range.startDate}
selected_label: Styles.cWhite, endDate={range.endDate}
range_fill: Styles.selectRangeDate, onChange={(param) => setRange(param)}
styles={{
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
}}
/>
</View>
<View style={[Styles.mv10]}>
<View style={[Styles.rowSpaceBetween]}>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}} }}
/> />
</View> </View>
<View style={[Styles.mv10]}> </ScrollView>
<View style={[Styles.rowSpaceBetween]}> </KeyboardAvoidingView>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{from}</Text>
</View>
</View>
<View style={[{ width: "48%" }]}>
<Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
</Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: "center" }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}}
/>
</View>
</ScrollView>
</SafeAreaView> </SafeAreaView>
); );
} }

View File

@@ -9,7 +9,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router"; import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { SafeAreaView, ScrollView, View } from "react-native"; import { KeyboardAvoidingView, Platform, SafeAreaView, ScrollView, View } from "react-native";
import Toast from "react-native-toast-message"; import Toast from "react-native-toast-message";
import DateTimePicker, { DateType } from "react-native-ui-datepicker"; import DateTimePicker, { DateType } from "react-native-ui-datepicker";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
@@ -114,63 +114,68 @@ export default function UpdateProjectTask() {
/> />
}} }}
/> />
<ScrollView> <KeyboardAvoidingView
<View style={[Styles.p15, Styles.mb100]}> behavior={Platform.OS === 'ios' ? 'padding' : undefined}
<View style={[Styles.wrapPaper, Styles.p10]}> keyboardVerticalOffset={110}
{ >
!loading <ScrollView>
&& <View style={[Styles.p15, Styles.mb100]}>
<DateTimePicker <View style={[Styles.wrapPaper, Styles.p10]}>
mode="range" {
startDate={range.startDate} !loading
endDate={range.endDate} &&
onChange={(param) => setRange(param)} <DateTimePicker
// styles={defaultStyles} mode="range"
month={month} startDate={range.startDate}
year={year} endDate={range.endDate}
styles={{ onChange={(param) => setRange(param)}
selected: Styles.selectedDate, // styles={defaultStyles}
selected_label: Styles.cWhite, month={month}
range_fill: Styles.selectRangeDate, year={year}
}} styles={{
/> selected: Styles.selectedDate,
} selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
}}
/>
}
</View>
<View style={[Styles.mv10]}>
<View style={[Styles.rowSpaceBetween]}>
<View style={[{ width: '48%' }]}>
<Text style={[Styles.mb05]}>Tanggal Mulai <Text style={Styles.cError}>*</Text></Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: 'center' }}>{from}</Text>
</View>
</View>
<View style={[{ width: '48%' }]}>
<Text style={[Styles.mb05]}>Tanggal Berakhir <Text style={Styles.cError}>*</Text></Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: 'center' }}>{to}</Text>
</View>
</View>
</View> </View>
{ <View style={[Styles.mv10]}>
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text> <View style={[Styles.rowSpaceBetween]}>
} <View style={[{ width: '48%' }]}>
<Text style={[Styles.mb05]}>Tanggal Mulai <Text style={Styles.cError}>*</Text></Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: 'center' }}>{from}</Text>
</View>
</View>
<View style={[{ width: '48%' }]}>
<Text style={[Styles.mb05]}>Tanggal Berakhir <Text style={Styles.cError}>*</Text></Text>
<View style={[Styles.wrapPaper, Styles.p10]}>
<Text style={{ textAlign: 'center' }}>{to}</Text>
</View>
</View>
</View>
{
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
}
</View>
<InputForm
label="Judul Tugas"
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}}
/>
</View> </View>
<InputForm </ScrollView>
label="Judul Tugas" </KeyboardAvoidingView>
type="default"
placeholder="Judul Tugas"
required
bg="white"
value={title}
error={error.title}
errorText="Judul tidak boleh kosong"
onChange={(e) => {
onValidation("title", e)
}}
/>
</View>
</ScrollView>
</SafeAreaView> </SafeAreaView>
) )
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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