diff --git a/app/(application)/division/[id]/(fitur-division)/calendar/[detail]/index.tsx b/app/(application)/division/[id]/(fitur-division)/calendar/[detail]/index.tsx
index a88ba2d..2719d52 100644
--- a/app/(application)/division/[id]/(fitur-division)/calendar/[detail]/index.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/calendar/[detail]/index.tsx
@@ -6,6 +6,7 @@ import DrawerBottom from "@/components/drawerBottom"
import ImageUser from "@/components/imageNew"
import MenuItemRow from "@/components/menuItemRow"
import Skeleton from "@/components/skeleton"
+import Text from "@/components/Text"
import Styles from "@/constants/Styles"
import { apiDeleteCalendarMember, apiGetCalendarOne, apiGetDivisionOneFeature } from "@/lib/api"
import { setUpdateCalendar } from "@/lib/calendarUpdate"
@@ -13,7 +14,7 @@ import { useAuthSession } from "@/providers/AuthProvider"
import { MaterialCommunityIcons } from "@expo/vector-icons"
import { router, Stack, useLocalSearchParams } from "expo-router"
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 { useDispatch, useSelector } from "react-redux"
@@ -52,7 +53,7 @@ export default function DetailEventCalendar() {
const entityUser = useSelector((state: any) => state.user);
const [isMemberDivision, setIsMemberDivision] = useState(false);
const [loading, setLoading] = useState(true)
- const arrSkeleton = Array.from({ length: 5 })
+ const [refreshing, setRefreshing] = useState(false)
async function handleCheckMember() {
try {
@@ -69,9 +70,9 @@ export default function DetailEventCalendar() {
}
}
- async function handleLoad() {
+ async function handleLoad(loading:boolean) {
try {
- setLoading(true)
+ setLoading(loading)
const hasil = await decryptToken(String(token?.current));
const response = await apiGetCalendarOne({
user: hasil,
@@ -105,7 +106,7 @@ export default function DetailEventCalendar() {
}
useEffect(() => {
- handleLoad();
+ handleLoad(true);
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 (
(entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision ? <>> :
}}
/>
-
+
+ }
+ >
diff --git a/app/(application)/division/[id]/(fitur-division)/calendar/index.tsx b/app/(application)/division/[id]/(fitur-division)/calendar/index.tsx
index 2df22f4..b5a0185 100644
--- a/app/(application)/division/[id]/(fitur-division)/calendar/index.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/calendar/index.tsx
@@ -157,6 +157,13 @@ export default function CalendarDivision() {
onChange={({ date }) => setSelected(date)}
styles={{
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,
}}
/>
diff --git a/app/(application)/division/[id]/(fitur-division)/discussion/[detail]/index.tsx b/app/(application)/division/[id]/(fitur-division)/discussion/[detail]/index.tsx
index 90a6c5b..22ab478 100644
--- a/app/(application)/division/[id]/(fitur-division)/discussion/[detail]/index.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/discussion/[detail]/index.tsx
@@ -18,7 +18,7 @@ import { Ionicons, MaterialIcons } from "@expo/vector-icons";
import { firebase } from "@react-native-firebase/database";
import { router, Stack, useLocalSearchParams } from "expo-router";
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";
type Props = {
@@ -58,6 +58,7 @@ export default function DiscussionDetail() {
const [loadingKomentar, setLoadingKomentar] = useState(true)
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 [refreshing, setRefreshing] = useState(false)
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 (
<>
-
+
+ }
+ >
{
loading ?
@@ -264,63 +281,68 @@ export default function DiscussionDetail() {
-
- {
- komentar != "" &&
- !loadingSend &&
- data?.status != 2 &&
- data?.isActive &&
- (((entityUser.role == "user" ||
- entityUser.role == "coadmin") &&
- isMemberDivision) ||
- entityUser.role == "admin" ||
- entityUser.role == "supadmin" ||
- entityUser.role == "developer" ||
- entityUser.role == "cosupadmin") &&
- handleKomentar();
- }}
- >
-
+ {
+ komentar != "" &&
+ !loadingSend &&
+ data?.status != 2 &&
+ data?.isActive &&
+ (((entityUser.role == "user" ||
entityUser.role == "coadmin") &&
- !isMemberDivision)
- ? Styles.cGray
- : Styles.cDefault
- }
- />
-
- }
- />
-
+ isMemberDivision) ||
+ entityUser.role == "admin" ||
+ entityUser.role == "supadmin" ||
+ entityUser.role == "developer" ||
+ entityUser.role == "cosupadmin") &&
+ handleKomentar();
+ }}
+ >
+
+
+ }
+ />
+
+
+
>
);
diff --git a/app/(application)/division/[id]/(fitur-division)/document/index.tsx b/app/(application)/division/[id]/(fitur-division)/document/index.tsx
index de52325..16e70c7 100644
--- a/app/(application)/division/[id]/(fitur-division)/document/index.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/document/index.tsx
@@ -112,7 +112,7 @@ export default function DocumentDivision() {
useEffect(() => {
handleLoad(true);
- }, [path, update]);
+ }, [path]);
const handleCheckboxChange = (index: number) => {
setDariSelectAll(false);
@@ -243,6 +243,7 @@ export default function DocumentDivision() {
useEffect(() => {
handleBatal();
+ handleLoad(false)
}, [update]);
async function handleShare(selectedDivision: any[]) {
@@ -270,7 +271,7 @@ export default function DocumentDivision() {
const openFile = (item: Props) => {
- setLoadingOpen(true)
+ if (Platform.OS == 'android') setLoadingOpen(true)
let remoteUrl = 'https://wibu-storage.wibudev.com/api/files/' + item.idStorage;
const fileName = item.name + '.' + item.extension;
let localPath = `${FileSystem.documentDirectory}/${fileName}`;
@@ -278,9 +279,9 @@ export default function DocumentDivision() {
FileSystem.downloadAsync(remoteUrl, localPath).then(async ({ uri }) => {
const contentURL = await FileSystem.getContentUriAsync(uri);
+ setLoadingOpen(false)
try {
if (Platform.OS == 'android') {
- // open with android intent
await startActivityAsync(
'android.intent.action.VIEW',
{
@@ -289,16 +290,13 @@ export default function DocumentDivision() {
type: mimeType as string,
}
);
- // or
- // Sharing.shareAsync(localPath);
-
} else if (Platform.OS == 'ios') {
Sharing.shareAsync(localPath);
}
} catch (error) {
Alert.alert('INFO', 'Gagal membuka file, tidak ada aplikasi yang dapat membuka file ini');
} finally {
- setLoadingOpen(false)
+ if (Platform.OS == 'android') setLoadingOpen(false)
}
});
};
@@ -375,7 +373,7 @@ export default function DocumentDivision() {
}}
>
{item.id != "home" && (
-
+
)}
{item.name}
@@ -538,13 +536,11 @@ export default function DocumentDivision() {
{ setModalMore(false) }}
title=""
>
{
- setModalMore(false);
- }}
+ onClose={() => { setModalMore(false); }}
data={selectedFiles}
share={shareSelected}
/>
@@ -553,7 +549,7 @@ export default function DocumentDivision() {
{ setRename(false) }}
onSubmit={() => {
handleRename();
}}
@@ -576,7 +572,7 @@ export default function DocumentDivision() {
title="Bagikan"
category="share-division"
open={isShare}
- close={setShare}
+ close={() => { setShare(false) }}
onSelect={(value) => {
handleShare(value)
}}
diff --git a/app/(application)/division/[id]/(fitur-division)/task/[detail]/add-task.tsx b/app/(application)/division/[id]/(fitur-division)/task/[detail]/add-task.tsx
index a98fce6..c6d0ac2 100644
--- a/app/(application)/division/[id]/(fitur-division)/task/[detail]/add-task.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/task/[detail]/add-task.tsx
@@ -10,7 +10,7 @@ import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import {
- SafeAreaView,
+ KeyboardAvoidingView, Platform, SafeAreaView,
ScrollView,
View
} from "react-native";
@@ -121,59 +121,65 @@ export default function TaskDivisionAddTask() {
),
}}
/>
-
-
-
- setRange(param)}
- styles={{
- selected: Styles.selectedDate,
- selected_label: Styles.cWhite,
- range_fill: Styles.selectRangeDate,
+
+
+
+
+ setRange(param)}
+ styles={{
+ selected: Styles.selectedDate,
+ selected_label: Styles.cWhite,
+ range_fill: Styles.selectRangeDate,
+ }}
+ />
+
+
+
+
+
+ Tanggal Mulai *
+
+
+ {from}
+
+
+
+
+ Tanggal Berakhir *
+
+
+ {to}
+
+
+
+ {
+ (error.endDate || error.startDate) && Tanggal tidak boleh kosong
+ }
+
+ {
+ onValidation("title", e)
}}
/>
-
-
-
-
- Tanggal Mulai *
-
-
- {from}
-
-
-
-
- Tanggal Berakhir *
-
-
- {to}
-
-
-
- {
- (error.endDate || error.startDate) && Tanggal tidak boleh kosong
- }
-
- {
- onValidation("title", e)
- }}
- />
-
-
+
+
+
);
}
diff --git a/app/(application)/division/[id]/(fitur-division)/task/[detail]/index.tsx b/app/(application)/division/[id]/(fitur-division)/task/[detail]/index.tsx
index 710e444..68720da 100644
--- a/app/(application)/division/[id]/(fitur-division)/task/[detail]/index.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/task/[detail]/index.tsx
@@ -10,7 +10,7 @@ import { apiGetTaskOne } from "@/lib/api";
import { useAuthSession } from "@/providers/AuthProvider";
import { router, Stack, useLocalSearchParams } from "expo-router";
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";
type Props = {
@@ -29,6 +29,7 @@ export default function DetailTaskDivision() {
const [loading, setLoading] = useState(true)
const [progress, setProgress] = useState(0)
const update = useSelector((state: any) => state.taskUpdate)
+ const [refreshing, setRefreshing] = useState(false)
async function handleLoad(cat: 'data' | 'progress') {
@@ -56,6 +57,14 @@ export default function DetailTaskDivision() {
handleLoad('progress')
}, [update.progress])
+ const handleRefresh = async () => {
+ setRefreshing(true)
+ await handleLoad('data')
+ await handleLoad('progress')
+ await new Promise(resolve => setTimeout(resolve, 2000));
+ setRefreshing(false)
+ };
+
return (
,
}}
/>
-
+
+ }
+ >
{
data?.reason != null && data?.reason != "" &&
}
-
-
-
+
+
+
diff --git a/app/(application)/division/[id]/(fitur-division)/task/create/task.tsx b/app/(application)/division/[id]/(fitur-division)/task/create/task.tsx
index ddff5ae..64f30de 100644
--- a/app/(application)/division/[id]/(fitur-division)/task/create/task.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/task/create/task.tsx
@@ -8,6 +8,8 @@ import dayjs from "dayjs";
import { router, Stack } from "expo-router";
import { useEffect, useState } from "react";
import {
+ KeyboardAvoidingView,
+ Platform,
SafeAreaView,
ScrollView,
View
@@ -97,59 +99,64 @@ export default function CreateTaskAddTugas() {
),
}}
/>
-
-
-
- setRange(param)}
- styles={{
- selected: Styles.selectedDate,
- selected_label: Styles.cWhite,
- range_fill: Styles.selectRangeDate,
+
+
+
+
+ setRange(param)}
+ styles={{
+ selected: Styles.selectedDate,
+ selected_label: Styles.cWhite,
+ range_fill: Styles.selectRangeDate,
+ }}
+ />
+
+
+
+
+
+ Tanggal Mulai *
+
+
+ {from}
+
+
+
+
+ Tanggal Berakhir *
+
+
+ {to}
+
+
+
+ {
+ (error.endDate || error.startDate) && Tanggal tidak boleh kosong
+ }
+
+ {
+ onValidation("title", e)
}}
/>
-
-
-
-
- Tanggal Mulai *
-
-
- {from}
-
-
-
-
- Tanggal Berakhir *
-
-
- {to}
-
-
-
- {
- (error.endDate || error.startDate) && Tanggal tidak boleh kosong
- }
-
- {
- onValidation("title", e)
- }}
- />
-
-
+
+
);
}
diff --git a/app/(application)/division/[id]/(fitur-division)/task/index.tsx b/app/(application)/division/[id]/(fitur-division)/task/index.tsx
index 8b434d3..eac1871 100644
--- a/app/(application)/division/[id]/(fitur-division)/task/index.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/task/index.tsx
@@ -193,7 +193,7 @@ export default function ListTask() {
:
data.length > 0 ? (
isList ? (
-
+
data.length}
@@ -241,7 +241,7 @@ export default function ListTask() {
))} */}
) : (
-
+
data.length}
diff --git a/app/(application)/division/[id]/(fitur-division)/task/update/[detail].tsx b/app/(application)/division/[id]/(fitur-division)/task/update/[detail].tsx
index fea688b..9f2c66e 100644
--- a/app/(application)/division/[id]/(fitur-division)/task/update/[detail].tsx
+++ b/app/(application)/division/[id]/(fitur-division)/task/update/[detail].tsx
@@ -10,6 +10,8 @@ import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import {
+ KeyboardAvoidingView,
+ Platform,
SafeAreaView,
ScrollView,
View
@@ -39,9 +41,9 @@ export default function UpdateProjectTaskDivision() {
});
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() {
try {
@@ -141,65 +143,71 @@ export default function UpdateProjectTaskDivision() {
),
}}
/>
-
-
-
- {!loading && (
- setRange(param)}
- month={month}
- year={year}
- styles={{
- selected: Styles.selectedDate,
- selected_label: Styles.cWhite,
- range_fill: Styles.selectRangeDate,
- }}
- />
- )}
-
-
-
-
-
- Tanggal Mulai *
-
-
- {from}
-
-
-
-
- Tanggal Berakhir *
-
-
- {to}
-
-
+
+
+
+
+ {!loading && (
+ setRange(param)}
+ month={month}
+ year={year}
+ styles={{
+ selected: Styles.selectedDate,
+ selected_label: Styles.cWhite,
+ range_fill: Styles.selectRangeDate,
+ }}
+ />
+ )}
- {(error.endDate || error.startDate) && (
-
- Tanggal tidak boleh kosong
-
- )}
+
+
+
+
+ Tanggal Mulai *
+
+
+ {from}
+
+
+
+
+ Tanggal Berakhir *
+
+
+ {to}
+
+
+
+ {(error.endDate || error.startDate) && (
+
+ Tanggal tidak boleh kosong
+
+ )}
+
+ {
+ onValidation("title", e)
+ }}
+ />
- {
- onValidation("title", e)
- }}
- />
-
-
+
+
+
);
}
diff --git a/app/(application)/division/[id]/add-member.tsx b/app/(application)/division/[id]/add-member.tsx
index b7011e9..4182b72 100644
--- a/app/(application)/division/[id]/add-member.tsx
+++ b/app/(application)/division/[id]/add-member.tsx
@@ -119,7 +119,7 @@ export default function AddMemberDivision() {
onChoose(item.idUser, item.name, item.img)}
/>
))
diff --git a/app/(application)/division/[id]/info.tsx b/app/(application)/division/[id]/info.tsx
index 1bff143..20f5029 100644
--- a/app/(application)/division/[id]/info.tsx
+++ b/app/(application)/division/[id]/info.tsx
@@ -134,11 +134,11 @@ export default function InformationDivision() {
headerRight: () => ,
}}
/>
-
-
+
+
{
dataDetail?.isActive == false && (
-
+
)
}
diff --git a/app/(application)/project/[id]/add-task.tsx b/app/(application)/project/[id]/add-task.tsx
index d9cda9c..6110f0d 100644
--- a/app/(application)/project/[id]/add-task.tsx
+++ b/app/(application)/project/[id]/add-task.tsx
@@ -10,6 +10,8 @@ import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import {
+ KeyboardAvoidingView,
+ Platform,
SafeAreaView,
ScrollView,
View
@@ -101,59 +103,64 @@ export default function ProjectAddTask() {
),
}}
/>
-
-
-
- setRange(param)}
- styles={{
- selected: Styles.selectedDate,
- selected_label: Styles.cWhite,
- range_fill: Styles.selectRangeDate,
+
+
+
+
+ setRange(param)}
+ styles={{
+ selected: Styles.selectedDate,
+ selected_label: Styles.cWhite,
+ range_fill: Styles.selectRangeDate,
+ }}
+ />
+
+
+
+
+
+ Tanggal Mulai *
+
+
+ {from}
+
+
+
+
+ Tanggal Berakhir *
+
+
+ {to}
+
+
+
+ {
+ (error.endDate || error.startDate) && Tanggal tidak boleh kosong
+ }
+
+ {
+ onValidation("title", e)
}}
/>
-
-
-
-
- Tanggal Mulai *
-
-
- {from}
-
-
-
-
- Tanggal Berakhir *
-
-
- {to}
-
-
-
- {
- (error.endDate || error.startDate) && Tanggal tidak boleh kosong
- }
-
- {
- onValidation("title", e)
- }}
- />
-
-
+
+
);
}
diff --git a/app/(application)/project/create/task.tsx b/app/(application)/project/create/task.tsx
index 248ac75..8f5a517 100644
--- a/app/(application)/project/create/task.tsx
+++ b/app/(application)/project/create/task.tsx
@@ -8,6 +8,8 @@ import dayjs from "dayjs";
import { router, Stack } from "expo-router";
import { useEffect, useState } from "react";
import {
+ KeyboardAvoidingView,
+ Platform,
SafeAreaView,
ScrollView,
View
@@ -97,59 +99,64 @@ export default function CreateProjectAddTask() {
),
}}
/>
-
-
-
- setRange(param)}
- styles={{
- selected: Styles.selectedDate,
- selected_label: Styles.cWhite,
- range_fill: Styles.selectRangeDate,
+
+
+
+
+ setRange(param)}
+ styles={{
+ selected: Styles.selectedDate,
+ selected_label: Styles.cWhite,
+ range_fill: Styles.selectRangeDate,
+ }}
+ />
+
+
+
+
+
+ Tanggal Mulai *
+
+
+ {from}
+
+
+
+
+ Tanggal Berakhir *
+
+
+ {to}
+
+
+
+ {
+ (error.endDate || error.startDate) && Tanggal tidak boleh kosong
+ }
+
+ {
+ onValidation("title", e)
}}
/>
-
-
-
-
- Tanggal Mulai *
-
-
- {from}
-
-
-
-
- Tanggal Berakhir *
-
-
- {to}
-
-
-
- {
- (error.endDate || error.startDate) && Tanggal tidak boleh kosong
- }
-
- {
- onValidation("title", e)
- }}
- />
-
-
+
+
);
}
diff --git a/app/(application)/project/update/[detail].tsx b/app/(application)/project/update/[detail].tsx
index 86ab4c2..49ef0ce 100644
--- a/app/(application)/project/update/[detail].tsx
+++ b/app/(application)/project/update/[detail].tsx
@@ -9,7 +9,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router";
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 DateTimePicker, { DateType } from "react-native-ui-datepicker";
import { useDispatch, useSelector } from "react-redux";
@@ -114,63 +114,68 @@ export default function UpdateProjectTask() {
/>
}}
/>
-
-
-
- {
- !loading
- &&
- setRange(param)}
- // styles={defaultStyles}
- month={month}
- year={year}
- styles={{
- selected: Styles.selectedDate,
- selected_label: Styles.cWhite,
- range_fill: Styles.selectRangeDate,
- }}
- />
- }
+
+
+
+
+ {
+ !loading
+ &&
+ setRange(param)}
+ // styles={defaultStyles}
+ month={month}
+ year={year}
+ styles={{
+ selected: Styles.selectedDate,
+ selected_label: Styles.cWhite,
+ range_fill: Styles.selectRangeDate,
+ }}
+ />
+ }
-
-
-
-
- Tanggal Mulai *
-
- {from}
-
-
-
- Tanggal Berakhir *
-
- {to}
-
-
- {
- (error.endDate || error.startDate) && Tanggal tidak boleh kosong
- }
+
+
+
+ Tanggal Mulai *
+
+ {from}
+
+
+
+ Tanggal Berakhir *
+
+ {to}
+
+
+
+ {
+ (error.endDate || error.startDate) && Tanggal tidak boleh kosong
+ }
+
+ {
+ onValidation("title", e)
+ }}
+ />
- {
- onValidation("title", e)
- }}
- />
-
-
+
+
)
}
\ No newline at end of file
diff --git a/components/document/headerDocument.tsx b/components/document/headerDocument.tsx
index 42263a1..d93304f 100644
--- a/components/document/headerDocument.tsx
+++ b/components/document/headerDocument.tsx
@@ -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 }) {
{ setVisible(false) }}
title="Menu"
>
@@ -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 }) {
{ setNewFolder(false) }}
disableSubmit={name == ""}
- onSubmit={() => {
- handleCreateFolder()
- }}
+ onSubmit={() => { handleCreateFolder() }}
>
{
- setName(value);
- }}
+ onChange={(value: string) => { setName(value) }}
/>
diff --git a/components/document/modalInformasi.tsx b/components/document/modalInformasi.tsx
index 1b150e5..f64efea 100644
--- a/components/document/modalInformasi.tsx
+++ b/components/document/modalInformasi.tsx
@@ -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()
const { token, decryptToken } = useAuthSession()
const [dataShare, setDataShare] = useState([])
+ 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 }) {
}
-
-
-
-
-
-
- { open.value = !open.value; }}>
-
-
- Telah dibagikan ke divisi
+ {
+ loading ? (
+
+
-
-
-
-
- {
- dataShare.length > 0 ? (
- dataShare.map((item, index) => (
-
-
- {item.name}
-
- ))
- )
- : (
-
- Tidak ada data
-
- )
- }
-
-
-
+ ) : (
+
+
+
+
+
+
+ { open.value = !open.value; }}>
+
+
+ Telah dibagikan ke divisi
+
+
+
+
+
+ {
+ dataShare.length > 0 ? (
+ dataShare.map((item, index) => (
+
+
+ {item.name}
+
+ ))
+ )
+ : (
+
+ Tidak ada data
+
+ )
+ }
+
+
+
+ )
+ }
>
)
}
\ No newline at end of file
diff --git a/components/document/modalMore.tsx b/components/document/modalMore.tsx
index c484cd7..bdd01b3 100644
--- a/components/document/modalMore.tsx
+++ b/components/document/modalMore.tsx
@@ -155,7 +155,7 @@ export default function ModalMore({
setInformasi(false)}
title="Informasi Dokumen"
height={80}
>
diff --git a/components/document/modalSalinMove.tsx b/components/document/modalSalinMove.tsx
index 3182e09..670eb8e 100644
--- a/components/document/modalSalinMove.tsx
+++ b/components/document/modalSalinMove.tsx
@@ -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
diff --git a/components/task/sectionFileTask.tsx b/components/task/sectionFileTask.tsx
index 9d0da9a..2d35b6d 100644
--- a/components/task/sectionFileTask.tsx
+++ b/components/task/sectionFileTask.tsx
@@ -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)
}, [])
diff --git a/components/task/sectionMemberTask.tsx b/components/task/sectionMemberTask.tsx
index f6b9315..2c80a54 100644
--- a/components/task/sectionMemberTask.tsx
+++ b/components/task/sectionMemberTask.tsx
@@ -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 {
diff --git a/components/task/sectionTanggalTugasTask.tsx b/components/task/sectionTanggalTugasTask.tsx
index d5b5ad2..2501c64 100644
--- a/components/task/sectionTanggalTugasTask.tsx
+++ b/components/task/sectionTanggalTugasTask.tsx
@@ -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);
}}
/>
{
- handleUpdate(Number(value.val))
- }}
+ close={() => setSelect(false)}
+ onSelect={(value) => { handleUpdate(Number(value.val)) }}
title="Status"
open={isSelect}
valChoose={String(tugas.status)}