Compare commits

...

20 Commits

Author SHA1 Message Date
7555ece0fa upd: push notification on background
Deskripsi:
- on klik pada background notification
- hide and show notificationn foreground

No Issues
2025-08-07 16:25:45 +08:00
9cb848ddd2 upd: image picker
Deskripsi:
- tambah icon kamera pada image picker > edit profile, tambah anggota dan edit anggota

No Issues
2025-08-07 11:34:54 +08:00
81aedb525f upd: tambah project
Deskripsi:
- mengganti metode tambah anggota pada fitur tambah project

No Issues
2025-08-07 10:47:04 +08:00
da89673271 upd: alert pick image
Deskripsi:
- menghilangkan alert pada picker image

No Issues
2025-08-06 17:24:10 +08:00
d052b7a0d4 upd: tampilan statys
Deskripsi:
- update label status
- menampilkan status pada detail member

No Issues
2025-08-06 17:18:34 +08:00
9370aac9a3 fix : file
Deskripsi:
- lihat atau share file
- view file ios pada home divisi > ga pake loading

No Issues
2025-08-06 17:09:46 +08:00
1298ec079a upd: tampilan pengumuman
Deskripsi:
- menambah tinggi text area
- mengurangi margin list divisi

No Issues
2025-08-06 16:50:31 +08:00
5db712d4b9 upd: notifikasi diskusi umum 2025-08-06 11:58:54 +08:00
1e2069ca42 fix: jarak keyboard
Deskripsi:
- otomatis jarak input dengan keyboard ios

No Issues
2025-08-05 17:24:49 +08:00
1d555bf950 upd: inputdate
Deskripsi:
- custom tampilan input datetime picker pada ios

No Issues
2025-08-05 16:40:37 +08:00
45d08e1df5 fix: kalender
Deskripsi:
- month kalender

No ISsues
2025-08-05 15:50:56 +08:00
7470e8a9c2 fix : group
Deskripsi:
- validasi tambah group
- validasi edit group
- load refresh modal

No Issues
2025-08-05 15:34:40 +08:00
308fda6920 fix : tampilan
Deskripsi:
- form input on ios

No ISsues
2025-08-05 15:10:44 +08:00
7ad846ff9c upd: akses user
Deskripsi:
- header list project > role user bisa akses filter

No Issues
2025-08-05 12:07:17 +08:00
92564373fe fix : input kalendar date
Deskripsi:
- tambah package intl

No Issues
2025-08-05 11:41:03 +08:00
6c84881186 upd: tampilan
deskripsi:
- warna icon

No Issues
2025-08-04 16:45:37 +08:00
2d24050b64 upd: api link 2025-08-04 14:10:28 +08:00
fafb52d87c upd: button save
Deskripsi:
- disable button saat udh submit

No Issues
2025-08-04 13:56:33 +08:00
b7c44109a1 upd: project dan task divisi
Deskripsi:
- menambahkan loading saat tambah file
- button submit disable saat loading]

No Issues
2025-08-04 11:48:06 +08:00
c54f4c9fda update: dokumen divisi
Deskripis:
- loading saat updload file
- upload multiple file

No Issues
2025-08-04 11:32:30 +08:00
66 changed files with 789 additions and 258 deletions

View File

@@ -13,8 +13,9 @@ import { apiReadOneNotification } from "@/lib/api";
import { pushToPage } from "@/lib/pushToPage";
import store from "@/lib/store";
import { useAuthSession } from "@/providers/AuthProvider";
import AsyncStorage from "@react-native-async-storage/async-storage";
import firebase from '@react-native-firebase/app';
import { Redirect, router, Stack } from "expo-router";
import { Redirect, router, Stack, usePathname } from "expo-router";
import { StatusBar } from 'expo-status-bar';
import { useEffect } from "react";
import { Easing, Notifier } from 'react-native-notifier';
@@ -22,37 +23,59 @@ import { Provider } from "react-redux";
export default function RootLayout() {
const { token, decryptToken, isLoading } = useAuthSession()
const pathname = usePathname()
async function handleReadNotification(id: string, category: string, idContent: string) {
async function handleReadNotification(id: string, category: string, idContent: string, title: string) {
try {
if (title != "Komentar Baru") {
const hasil = await decryptToken(String(token?.current))
const response = await apiReadOneNotification({ user: hasil, id: id })
}
pushToPage(category, idContent)
} catch (error) {
console.error(error)
}
}
useEffect(() => {
const checkNavigation = async () => {
const navData = await AsyncStorage.getItem('navigateOnOpen');
if (navData) {
const { screen, content } = JSON.parse(navData);
await AsyncStorage.removeItem('navigateOnOpen'); // reset
pushToPage(screen, content)
}
};
checkNavigation();
}, []);
useEffect(() => {
const unsubscribe = firebase.app().messaging().onMessage(async remoteMessage => {
const id = remoteMessage?.data?.id;
const category = remoteMessage?.data?.category;
const content = remoteMessage?.data?.content;
const title = remoteMessage?.notification?.title;
if (remoteMessage.notification != undefined && remoteMessage.notification.title != undefined && remoteMessage.notification.body != undefined) {
if (category == 'discussion-general' && pathname == '/discussion/' + content) {
return null
} else if (pathname != `/${category}/${content}`) {
Notifier.showNotification({
title: remoteMessage.notification?.title,
title: title,
description: remoteMessage.notification?.body,
duration: 3000,
animationDuration: 300,
showEasing: Easing.ease,
onPress: () => handleReadNotification(String(id), String(category), String(content)),
onPress: () => handleReadNotification(String(id), String(category), String(content), String(title)),
hideOnPress: true,
});
}
}
});
return unsubscribe;
}, []);
}, [pathname]);
if (isLoading) {

View File

@@ -21,7 +21,8 @@ export default function CreateAnnouncement() {
const { token, decryptToken } = useAuthSession()
const [disableBtn, setDisableBtn] = useState(true);
const [modalDivisi, setModalDivisi] = useState(false);
const [divisionMember, setDivisionMember] = useState<any>([]);
const [divisionMember, setDivisionMember] = useState<any>([])
const [loading, setLoading] = useState(false)
const [dataForm, setDataForm] = useState({
title: "",
desc: "",
@@ -66,6 +67,7 @@ export default function CreateAnnouncement() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiCreateAnnouncement({
data: { ...dataForm, user: hasil, groups: divisionMember },
@@ -77,6 +79,8 @@ export default function CreateAnnouncement() {
}
} catch (error) {
console.error(error);
} finally {
setLoading(false)
}
}
@@ -95,7 +99,7 @@ export default function CreateAnnouncement() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading ? true : false}
category="create"
onPress={() => {
divisionMember.length == 0
@@ -145,7 +149,7 @@ export default function CreateAnnouncement() {
<Text style={[Styles.textDefaultSemiBold]}>{item.name}</Text>
{
item.Division.map((division: any, i: any) => (
<View key={i} style={[Styles.rowItemsCenter, Styles.mv05]}>
<View key={i} style={[Styles.rowItemsCenter]}>
<Entypo name="dot-single" size={24} color="black" />
<Text style={[Styles.textDefault]}>{division.name}</Text>
</View>

View File

@@ -33,6 +33,7 @@ export default function EditAnnouncement() {
const [modalDivisi, setModalDivisi] = useState(false);
const [disableBtn, setDisableBtn] = useState(true);
const [dataMember, setDataMember] = useState<any>([]);
const [loading, setLoading] = useState(false)
const [dataForm, setDataForm] = useState({
title: "",
desc: "",
@@ -109,6 +110,7 @@ export default function EditAnnouncement() {
async function handleEdit() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiEditAnnouncement({
...dataForm, user: hasil, groups: dataMember,
@@ -120,6 +122,8 @@ export default function EditAnnouncement() {
}
} catch (error) {
console.error(error);
} finally {
setLoading(false)
}
}
@@ -138,7 +142,7 @@ export default function EditAnnouncement() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading ? true : false}
category="update"
onPress={() => {
dataMember.length == 0
@@ -189,7 +193,7 @@ export default function EditAnnouncement() {
<Text style={[Styles.textDefaultSemiBold]}>{item.name}</Text>
{
item.Division.map((division: any, i: any) => (
<View key={i} style={[Styles.rowItemsCenter, Styles.mv05]}>
<View key={i} style={[Styles.rowItemsCenter]}>
<Entypo name="dot-single" size={24} color="black" />
<Text style={[Styles.textDefault]}>{division.name}</Text>
</View>

View File

@@ -30,6 +30,7 @@ export default function EditBanner() {
const [title, setTitle] = useState("");
const [error, setError] = useState(false);
const [imgForm, setImgForm] = useState<any>();
const [loading, setLoading] = useState(false)
const pickImageAsync = async () => {
let result = await ImagePicker.launchImageLibraryAsync({
@@ -42,8 +43,6 @@ export default function EditBanner() {
if (!result.canceled) {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
}
};
@@ -71,6 +70,7 @@ export default function EditBanner() {
const handleUpdateEntity = async () => {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const fd = new FormData();
@@ -105,6 +105,8 @@ export default function EditBanner() {
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
} finally {
setLoading(false)
}
};
@@ -122,7 +124,7 @@ export default function EditBanner() {
headerTitle: "Edit Banner",
headerTitleAlign: "center",
headerRight: () => <ButtonSaveHeader
disable={title == "" || error ? true : false}
disable={title == "" || error || loading ? true : false}
onPress={() => { handleUpdateEntity() }}
category="update" />,
}}

View File

@@ -29,6 +29,7 @@ export default function CreateBanner() {
const [imgForm, setImgForm] = useState<any>();
const [title, setTitle] = useState("");
const [error, setError] = useState(false);
const [loading, setLoading] = useState(false)
const pickImageAsync = async () => {
let result = await ImagePicker.launchImageLibraryAsync({
@@ -41,8 +42,6 @@ export default function CreateBanner() {
if (result.assets?.[0].uri) {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
}
}
};
@@ -57,6 +56,8 @@ export default function CreateBanner() {
}
const handleCreateEntity = async () => {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const fd = new FormData();
@@ -84,6 +85,12 @@ export default function CreateBanner() {
} else {
Toast.show({ type: 'small', text1: 'Gagal menambahkan data', })
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Gagal menambahkan data', })
} finally {
setLoading(false)
}
};
return (
@@ -101,7 +108,7 @@ export default function CreateBanner() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={title == "" || selectedImage == undefined || error ? true : false}
disable={title == "" || selectedImage == undefined || error || loading ? true : false}
category="create"
onPress={() => {
handleCreateEntity();

View File

@@ -155,7 +155,7 @@ export default function BannerList() {
/>
<MenuItemRow
icon={<MaterialCommunityIcons name="file-eye" color="black" size={25} />}
title="Lihat File"
title="Lihat / Share"
onPress={() => { openFile() }}
/>
<MenuItemRow

View File

@@ -17,6 +17,7 @@ import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import { KeyboardAvoidingView, Platform, Pressable, ScrollView, View } from "react-native";
import { useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
type Props = {
id: string
@@ -49,6 +50,7 @@ export default function DetailDiscussionGeneral() {
const [loadingKomentar, setLoadingKomentar] = useState(true)
const arrSkeleton = Array.from({ length: 3 }, (_, index) => index)
const reference = firebase.app().database('https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app').ref(`/discussion-general/${id}`);
const headerHeight = useHeaderHeight();
useEffect(() => {
const onValueChange = reference.on('value', snapshot => {
@@ -197,7 +199,7 @@ export default function DetailDiscussionGeneral() {
</ScrollView>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<View style={[
Styles.contentItemCenter,

View File

@@ -31,6 +31,7 @@ export default function AddMemberDiscussionDetail() {
const [idGroup, setIdGroup] = useState('')
const [selectMember, setSelectMember] = useState<any[]>([])
const [search, setSearch] = useState('')
const [loading, setLoading] = useState(false)
async function handleLoad() {
try {
@@ -70,15 +71,21 @@ export default function AddMemberDiscussionDetail() {
async function handleAddMember() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiAddMemberDiscussionGeneral({ id: id, data: { user: hasil, member: selectMember } })
if (response.success) {
Toast.show({ type: 'small', text1: 'Berhasil menambahkan anggota', })
dispatch(setUpdateDiscussionGeneralDetail(!update))
router.back()
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal menambahkan anggota', })
} finally {
setLoading(false)
}
}
@@ -93,7 +100,7 @@ export default function AddMemberDiscussionDetail() {
headerRight: () => (
<ButtonSaveHeader
category="update"
disable={selectMember.length > 0 ? false : true}
disable={selectMember.length == 0 || loading ? true : false}
onPress={() => {
handleAddMember()
}}
@@ -149,7 +156,7 @@ export default function AddMemberDiscussionDetail() {
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -31,6 +31,7 @@ export default function CreateDiscussionGeneral() {
const [isSelect, setSelect] = useState(false);
const entitiesMember = useSelector((state: any) => state.memberChoose)
const update = useSelector((state: any) => state.discussionGeneralDetailUpdate)
const [loading, setLoading] = useState(false)
const [dataForm, setDataForm] = useState({
idGroup: "",
title: "",
@@ -95,6 +96,7 @@ export default function CreateDiscussionGeneral() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiCreateDiscussionGeneral({
data: { ...dataForm, user: hasil, member: entitiesMember },
@@ -110,6 +112,8 @@ export default function CreateDiscussionGeneral() {
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -127,7 +131,7 @@ export default function CreateDiscussionGeneral() {
headerRight: () => (
<ButtonSaveHeader
category="create"
disable={disableBtn}
disable={disableBtn || loading ? true : false}
onPress={() => {
entitiesMember.length == 0
? Toast.show({ type: 'small', text1: 'Anda belum memilih anggota', })

View File

@@ -16,6 +16,7 @@ export default function EditDiscussionGeneral() {
const { id } = useLocalSearchParams<{ id: string }>();
const [disableBtn, setDisableBtn] = useState(false)
const dispatch = useDispatch()
const [loading, setLoading] = useState(false)
const update = useSelector((state: any) => state.discussionGeneralDetailUpdate)
const [dataForm, setDataForm] = useState({
title: "",
@@ -80,6 +81,7 @@ export default function EditDiscussionGeneral() {
async function handleEdit() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiEditDiscussionGeneral({ user: hasil, title: dataForm.title, desc: dataForm.desc }, id);
if (response.success) {
@@ -89,6 +91,9 @@ export default function EditDiscussionGeneral() {
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -107,7 +112,7 @@ export default function EditDiscussionGeneral() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading ? true : false}
category="update"
onPress={() => { handleEdit() }}
/>

View File

@@ -31,6 +31,7 @@ export default function AddMemberCalendarEvent() {
const [selectMember, setSelectMember] = useState<any[]>([])
const [search, setSearch] = useState('')
const [idCalendar, setIdCalendar] = useState('')
const [loading, setLoading] = useState(false)
async function handleLoadOldMember() {
try {
@@ -78,6 +79,7 @@ export default function AddMemberCalendarEvent() {
async function handleAddMember() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiAddMemberCalendar({ id: idCalendar, data: { user: hasil, member: selectMember } })
if (response.success) {
@@ -90,6 +92,8 @@ export default function AddMemberCalendarEvent() {
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -104,7 +108,7 @@ export default function AddMemberCalendarEvent() {
headerRight: () => (
<ButtonSaveHeader
category="update"
disable={selectMember.length > 0 ? false : true}
disable={selectMember.length == 0 || loading ? true : false}
onPress={() => {
handleAddMember()
}}
@@ -159,7 +163,7 @@ export default function AddMemberCalendarEvent() {
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -21,6 +21,7 @@ export default function EditEventCalendar() {
const [isSelect, setSelect] = useState(false)
const { id, detail } = useLocalSearchParams<{ id: string, detail: string }>()
const [idCalendar, setIdCalendar] = useState('')
const [loading, setLoading] = useState(false)
const [error, setError] = useState({
title: false,
@@ -140,6 +141,7 @@ export default function EditEventCalendar() {
async function handleUpdate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiUpdateCalendar({ data: { ...data, user: hasil }, id: idCalendar })
if (response.success) {
@@ -150,7 +152,9 @@ export default function EditEventCalendar() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal mengubah acara', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -164,7 +168,7 @@ export default function EditEventCalendar() {
headerTitleAlign: 'center',
headerRight: () =>
<ButtonSaveHeader
disable={Object.values(error).some((val) => val == true) || data.title == "" || data.dateStart == "" || data.timeStart == "" || data.timeEnd == "" || data.repeatEventTyper == ""}
disable={Object.values(error).some((val) => val == true) || data.title == "" || data.dateStart == "" || data.timeStart == "" || data.timeEnd == "" || data.repeatEventTyper == "" || loading}
category="update-calendar"
onPress={() => {
handleUpdate()

View File

@@ -31,6 +31,7 @@ export default function CreateCalendarAddMember() {
const update = useSelector((state: any) => state.calendarCreate)
const dispatch = useDispatch()
const updateRefresh = useSelector((state: any) => state.calendarUpdate)
const [loading, setLoading] = useState(false)
@@ -58,6 +59,7 @@ export default function CreateCalendarAddMember() {
async function handleAddMember() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiCreateCalendar({ data: { ...update, user: hasil, idDivision: id, member: selectMember } })
if (response.success) {
@@ -80,7 +82,9 @@ export default function CreateCalendarAddMember() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal membuat acara', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -94,7 +98,7 @@ export default function CreateCalendarAddMember() {
headerRight: () => (
<ButtonSaveHeader
category="create"
disable={selectMember.length > 0 ? false : true}
disable={selectMember.length == 0 || loading ? true : false}
onPress={() => { handleAddMember() }}
/>
)
@@ -142,7 +146,7 @@ export default function CreateCalendarAddMember() {
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -17,6 +17,7 @@ import {
View
} from "react-native";
import { useDispatch, useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
export default function CalendarDivisionCreate() {
const { id } = useLocalSearchParams<{ id: string }>()
@@ -24,6 +25,7 @@ export default function CalendarDivisionCreate() {
const [isSelect, setSelect] = useState(false)
const update = useSelector((state: any) => state.calendarCreate)
const dispatch = useDispatch()
const headerHeight = useHeaderHeight();
const [error, setError] = useState({
title: false,
dateStart: false,
@@ -145,7 +147,7 @@ export default function CalendarDivisionCreate() {
/>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15]}>

View File

@@ -78,7 +78,9 @@ export default function CalendarDivision() {
} catch (error) {
console.error(error);
} finally {
setTimeout(() => {
setLoadingBtn(false)
}, 500)
}
}
@@ -155,6 +157,7 @@ export default function CalendarDivision() {
date={selected}
month={month}
onChange={({ date }) => setSelected(date)}
onMonthChange={(month) => setMonth(month)}
styles={{
selected: Styles.selectedDate,
month_label: Styles.cBlack,

View File

@@ -17,6 +17,7 @@ export default function DiscussionDivisionEdit() {
const [data, setData] = useState("");
const update = useSelector((state: any) => state.discussionUpdate);
const dispatch = useDispatch();
const [loading, setLoading] = useState(false)
async function handleLoad() {
try {
@@ -38,6 +39,7 @@ export default function DiscussionDivisionEdit() {
async function handleUpdate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiEditDiscussion({
data: { user: hasil, desc: data },
@@ -47,9 +49,14 @@ export default function DiscussionDivisionEdit() {
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
dispatch(setUpdateDiscussion({ ...update, data: !update.data }));
router.back();
}else{
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -68,7 +75,7 @@ export default function DiscussionDivisionEdit() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={data == ""}
disable={data == "" || loading}
category="update"
onPress={() => {
handleUpdate();

View File

@@ -20,6 +20,7 @@ import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import { KeyboardAvoidingView, Platform, Pressable, RefreshControl, ScrollView, View } from "react-native";
import { useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
type Props = {
id: string;
@@ -59,6 +60,7 @@ export default function DiscussionDetail() {
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)
const headerHeight = useHeaderHeight();
useEffect(() => {
@@ -283,7 +285,7 @@ export default function DiscussionDetail() {
</ScrollView>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<View
style={[

View File

@@ -17,9 +17,11 @@ export default function CreateDiscussionDivision() {
const { token, decryptToken } = useAuthSession()
const update = useSelector((state: any) => state.discussionUpdate)
const dispatch = useDispatch();
const [loading, setLoading] = useState(false)
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiCreateDiscussion({ data: { user: hasil, desc, idDivision: id } })
if (response.success) {
@@ -32,6 +34,8 @@ export default function CreateDiscussionDivision() {
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -43,7 +47,7 @@ export default function CreateDiscussionDivision() {
headerTitle: 'Tambah Diskusi',
headerTitleAlign: 'center',
headerRight: () => <ButtonSaveHeader
disable={desc == ""}
disable={desc == "" || loading}
category="create"
onPress={() => {
handleCreate()

View File

@@ -32,6 +32,7 @@ export default function TaskDivisionAddFile() {
const [loadingCheck, setLoadingCheck] = useState(false);
const dispatch = useDispatch();
const update = useSelector((state: any) => state.taskUpdate);
const [loading, setLoading] = useState(false);
const pickDocumentAsync = async () => {
let result = await DocumentPicker.getDocumentAsync({
@@ -90,6 +91,7 @@ export default function TaskDivisionAddFile() {
async function handleAddFile() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const fd = new FormData();
@@ -119,6 +121,8 @@ export default function TaskDivisionAddFile() {
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -138,7 +142,7 @@ export default function TaskDivisionAddFile() {
headerRight: () => (
<ButtonSaveHeader
category="create"
disable={fileForm.length == 0 ? true : false}
disable={fileForm.length == 0 || loading ? true : false}
onPress={() => { handleAddFile() }}
/>
),
@@ -171,6 +175,9 @@ export default function TaskDivisionAddFile() {
{
loadingCheck && <ActivityIndicator size="small" />
}
{
loading && <ActivityIndicator size="large" />
}
</View>
</ScrollView>
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">

View File

@@ -30,6 +30,7 @@ export default function AddMemberTask() {
const [data, setData] = useState<Props[]>([])
const [selectMember, setSelectMember] = useState<any[]>([])
const [search, setSearch] = useState('')
const [loading, setLoading] = useState(false)
async function handleLoadOldMember() {
try {
@@ -72,6 +73,7 @@ export default function AddMemberTask() {
async function handleAddMember() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiAddMemberTask({ id: detail, data: { user: hasil, member: selectMember, idDivision: id } })
if (response.success) {
@@ -83,7 +85,9 @@ export default function AddMemberTask() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal menambahkan anggota', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -98,7 +102,7 @@ export default function AddMemberTask() {
headerRight: () => (
<ButtonSaveHeader
category="update"
disable={selectMember.length > 0 ? false : true}
disable={selectMember.length == 0 || loading ? true : false}
onPress={() => {
handleAddMember()
}}
@@ -154,7 +158,7 @@ export default function AddMemberTask() {
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -8,6 +8,8 @@ import { setUpdateTask } from "@/lib/taskUpdate";
import { useAuthSession } from "@/providers/AuthProvider";
import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router";
import 'intl';
import 'intl/locale-data/jsonp/id';
import { useEffect, useState } from "react";
import {
KeyboardAvoidingView, Platform, SafeAreaView,
@@ -17,6 +19,7 @@ import {
import Toast from "react-native-toast-message";
import DateTimePicker, { DateType } from "react-native-ui-datepicker";
import { useDispatch, useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
export default function TaskDivisionAddTask() {
const { token, decryptToken } = useAuthSession();
@@ -24,6 +27,8 @@ export default function TaskDivisionAddTask() {
const update = useSelector((state: any) => state.taskUpdate);
const { id, detail } = useLocalSearchParams<{ id: string; detail: string }>();
const [disable, setDisable] = useState(true);
const [loading, setLoading] = useState(false)
const headerHeight = useHeaderHeight();
const [range, setRange] = useState<{
startDate: DateType;
endDate: DateType;
@@ -73,6 +78,7 @@ export default function TaskDivisionAddTask() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiCreateTaskTugas({
data: {
@@ -93,7 +99,9 @@ export default function TaskDivisionAddTask() {
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Gagal menambah data', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -113,7 +121,7 @@ export default function TaskDivisionAddTask() {
headerRight: () => (
<ButtonSaveHeader
category="create"
disable={disable}
disable={disable || loading}
onPress={() => {
handleCreate();
}}
@@ -123,7 +131,7 @@ export default function TaskDivisionAddTask() {
/>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
@@ -137,6 +145,13 @@ export default function TaskDivisionAddTask() {
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
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 File

@@ -19,6 +19,7 @@ export default function TaskDivisionCancel() {
const [reason, setReason] = useState("");
const [error, setError] = useState(false);
const [disable, setDisable] = useState(false);
const [loading, setLoading] = useState(false)
function onValidation(val: string) {
setReason(val);
@@ -43,6 +44,7 @@ export default function TaskDivisionCancel() {
async function handleCancel() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiCancelTask(
{
@@ -60,7 +62,9 @@ export default function TaskDivisionCancel() {
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Gagal membatalkan kegiatan', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -79,7 +83,7 @@ export default function TaskDivisionCancel() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disable}
disable={disable || loading}
category="cancel"
onPress={() => {
handleCancel();

View File

@@ -19,6 +19,7 @@ export default function TaskDivisionEdit() {
const [disable, setDisable] = useState(false);
const dispatch = useDispatch();
const update = useSelector((state: any) => state.taskUpdate);
const [loading, setLoading] = useState(false)
async function handleLoad() {
try {
@@ -61,6 +62,7 @@ export default function TaskDivisionEdit() {
async function handleUpdate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiEditTask(
{
@@ -79,6 +81,8 @@ export default function TaskDivisionEdit() {
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -98,7 +102,7 @@ export default function TaskDivisionEdit() {
headerRight: () => (
<ButtonSaveHeader
category="update"
disable={disable}
disable={disable || loading}
onPress={() => { handleUpdate() }}
/>
),

View File

@@ -38,6 +38,7 @@ export default function CreateTaskDivision() {
const [title, setTitle] = useState('')
const [error, setError] = useState(false);
const [isModal, setModal] = useState(false)
const [loading, setLoading] = useState(false)
let hitung = 0;
useEffect(() => {
@@ -77,6 +78,7 @@ export default function CreateTaskDivision() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -102,6 +104,9 @@ export default function CreateTaskDivision() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -121,7 +126,7 @@ export default function CreateTaskDivision() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={title == "" || entitiesMember.length == 0 || taskCreate.length == 0}
disable={title == "" || entitiesMember.length == 0 || taskCreate.length == 0 || loading}
category="create"
onPress={() => { handleCreate() }}
/>

View File

@@ -25,7 +25,6 @@ export default function AddMemberCreateTask() {
const dispatch = useDispatch()
const { token, decryptToken } = useAuthSession()
const { id } = useLocalSearchParams<{ id: string, detail: string }>()
const [dataOld, setDataOld] = useState<Props[]>([])
const [data, setData] = useState<Props[]>([])
const [selectMember, setSelectMember] = useState<any[]>([])
const [search, setSearch] = useState('')
@@ -125,7 +124,7 @@ export default function AddMemberCreateTask() {
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -6,6 +6,8 @@ import Styles from "@/constants/Styles";
import { setTaskCreate } from "@/lib/taskCreate";
import dayjs from "dayjs";
import { router, Stack } from "expo-router";
import 'intl';
import 'intl/locale-data/jsonp/id';
import { useEffect, useState } from "react";
import {
KeyboardAvoidingView,
@@ -18,8 +20,10 @@ import DateTimePicker, {
DateType
} from "react-native-ui-datepicker";
import { useDispatch, useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
export default function CreateTaskAddTugas() {
const headerHeight = useHeaderHeight();
const dispatch = useDispatch()
const [disable, setDisable] = useState(true);
const [range, setRange] = useState<{
@@ -101,7 +105,7 @@ export default function CreateTaskAddTugas() {
/>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
@@ -115,6 +119,13 @@ export default function CreateTaskAddTugas() {
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
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 File

@@ -6,8 +6,11 @@ import Styles from "@/constants/Styles";
import { apiEditTaskTugas, apiGetTaskTugas } from "@/lib/api";
import { setUpdateTask } from "@/lib/taskUpdate";
import { useAuthSession } from "@/providers/AuthProvider";
import { useHeaderHeight } from '@react-navigation/elements';
import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router";
import 'intl';
import 'intl/locale-data/jsonp/id';
import { useEffect, useState } from "react";
import {
KeyboardAvoidingView,
@@ -21,6 +24,7 @@ import DateTimePicker, { DateType } from "react-native-ui-datepicker";
import { useDispatch, useSelector } from "react-redux";
export default function UpdateProjectTaskDivision() {
const headerHeight = useHeaderHeight();
const { detail } = useLocalSearchParams<{ detail: string }>();
const dispatch = useDispatch();
const update = useSelector((state: any) => state.taskUpdate);
@@ -29,6 +33,7 @@ export default function UpdateProjectTaskDivision() {
startDate: DateType;
endDate: DateType;
}>({ startDate: undefined, endDate: undefined });
const [loadingSubmit, setLoadingSubmit] = useState(false)
const [month, setMonth] = useState<any>();
const [year, setYear] = useState<any>();
const [loading, setLoading] = useState(true);
@@ -73,6 +78,7 @@ export default function UpdateProjectTaskDivision() {
async function handleEdit() {
try {
setLoadingSubmit(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiEditTaskTugas({ data: { title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id: detail });
if (response.success) {
@@ -84,7 +90,9 @@ export default function UpdateProjectTaskDivision() {
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Gagal mengubah data', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoadingSubmit(false)
}
}
@@ -134,7 +142,7 @@ export default function UpdateProjectTaskDivision() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loadingSubmit}
category="update"
onPress={() => {
handleEdit()
@@ -145,7 +153,7 @@ export default function UpdateProjectTaskDivision() {
/>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
@@ -162,6 +170,13 @@ export default function UpdateProjectTaskDivision() {
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
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 File

@@ -31,9 +31,11 @@ export default function AddMemberDivision() {
const [search, setSearch] = useState('')
const update = useSelector((state: any) => state.divisionUpdate)
const dispatch = useDispatch()
const [loading, setLoading] = useState(false)
async function handleLoad() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiGetDivisionOneDetail({ user: hasil, id })
setDataOld(response.data.member)
@@ -72,6 +74,7 @@ export default function AddMemberDivision() {
async function handleAddMember() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiAddMemberDivision({ id: id, data: { user: hasil, member: selectMember } })
if (response.success) {
@@ -83,7 +86,9 @@ export default function AddMemberDivision() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal menambahkan anggota', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -98,7 +103,7 @@ export default function AddMemberDivision() {
headerRight: () => (
<ButtonSaveHeader
category="update"
disable={selectMember.length > 0 ? false : true}
disable={selectMember.length == 0 || loading ? true : false}
onPress={() => {
handleAddMember()
}}
@@ -154,7 +159,7 @@ export default function AddMemberDivision() {
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -16,6 +16,7 @@ export default function EditDivision() {
const update = useSelector((state: any) => state.divisionUpdate)
const { token, decryptToken } = useAuthSession();
const { id } = useLocalSearchParams<{ id: string }>();
const [loading, setLoading] = useState(false)
const [data, setData] = useState({
name: "",
desc: "",
@@ -43,6 +44,7 @@ export default function EditDivision() {
async function handleEdit() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiEditDivision({ user: hasil, name: data.name, desc: data.desc }, id)
if (response.success) {
@@ -55,6 +57,8 @@ export default function EditDivision() {
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -73,7 +77,7 @@ export default function EditDivision() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={error.name}
disable={error.name || loading ? true : false}
category="update"
onPress={() => { handleEdit() }}
/>

View File

@@ -29,6 +29,7 @@ export default function CreateDivisionAddAdmin() {
const update = useSelector((state: any) => state.divisionCreate)
const updateDivision = useSelector((state: any) => state.divisionUpdate)
const dispatch = useDispatch()
const [loading, setLoading] = useState(false)
async function handleLoadMember() {
setData(update.member)
@@ -48,6 +49,7 @@ export default function CreateDivisionAddAdmin() {
async function handleAddMember() {
try {
setLoading(true)
dispatch(setFormCreateDivision({ ...update, admin: selectMember }))
const hasil = await decryptToken(String(token?.current))
const response = await apiCreateDivision({ ...update, user: hasil })
@@ -61,7 +63,9 @@ export default function CreateDivisionAddAdmin() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal membuat divisi', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -76,7 +80,7 @@ export default function CreateDivisionAddAdmin() {
headerRight: () => (
<ButtonSaveHeader
category="create"
disable={selectMember.length > 0 ? false : true}
disable={selectMember.length == 0 || loading ? true : false}
onPress={() => {
handleAddMember()
}}
@@ -108,7 +112,7 @@ export default function CreateDivisionAddAdmin() {
</View>
</View>
{
selectMember.some((i: any) => i == item.idUser) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i == item.idUser) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -121,7 +121,7 @@ export default function CreateDivisionAddMember() {
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -8,6 +8,7 @@ import Styles from "@/constants/Styles";
import { apiEditProfile, apiGetProfile } from "@/lib/api";
import { setEntities } from "@/lib/entitiesSlice";
import { useAuthSession } from "@/providers/AuthProvider";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import * as ImagePicker from "expo-image-picker";
import { router, Stack } from "expo-router";
import { useEffect, useState } from "react";
@@ -46,7 +47,8 @@ export default function EditProfile() {
const [isSelect, setSelect] = useState(false);
const [disableBtn, setDisableBtn] = useState(false)
const [valChoose, setValChoose] = useState("")
const [imgForm, setImgForm] = useState<any>();
const [imgForm, setImgForm] = useState<any>()
const [loading, setLoading] = useState(false)
const [data, setData] = useState<Props>({
id: entities.id,
name: entities.name,
@@ -150,6 +152,7 @@ export default function EditProfile() {
async function handleEdit() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -179,6 +182,8 @@ export default function EditProfile() {
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
} finally {
setLoading(false)
}
}
@@ -197,7 +202,6 @@ export default function EditProfile() {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
setErrorImg(false)
}
};
@@ -217,7 +221,7 @@ export default function EditProfile() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading ? true : false}
category="update"
onPress={() => {
handleEdit()
@@ -226,8 +230,8 @@ export default function EditProfile() {
),
}}
/>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
<ScrollView style={[Styles.h100]}>
<View style={[Styles.p15]}>
<View style={{ justifyContent: "center", alignItems: "center" }}>
{
selectedImage != undefined ? (
@@ -241,16 +245,20 @@ export default function EditProfile() {
style={[Styles.userProfileBig]}
onError={() => { setErrorImg(true) }}
/>
<View style={[Styles.absoluteIconPicker]}>
<MaterialCommunityIcons name="image" color={'white'} size={15} />
</View>
</Pressable>
) : (
<Pressable onPress={pickImageAsync}>
{
<Image
source={errorImg ? require("../../assets/images/user.jpg") : { uri: `https://wibu-storage.wibudev.com/api/files/${data?.img}` }}
style={[Styles.userProfileBig]}
onError={() => { setErrorImg(true) }}
/>
}
<View style={[Styles.absoluteIconPicker]}>
<MaterialCommunityIcons name="image" color={'white'} size={15} />
</View>
</Pressable>
)
}

View File

@@ -42,14 +42,9 @@ export default function Index() {
const dispatch = useDispatch()
const update = useSelector((state: any) => state.groupUpdate)
const [data11, setData1] = useState(Array.from({ length: 20 }, (_, i) => `Item ${i}`));
const renderItem = ({ item }: { item: string }) => (
<View style={{ padding: 20, borderBottomWidth: 1, borderColor: '#ccc' }}>
<Text>{item}</Text>
</View>
);
const [error, setError] = useState({
title: false,
});
async function handleEdit() {
@@ -109,6 +104,17 @@ export default function Index() {
setRefreshing(false)
};
function validationForm(val: any, cat: 'title') {
if (cat === 'title') {
setTitleChoose(val)
if (val == "" || val.length < 3) {
setError((prev) => ({ ...prev, title: true }))
} else {
setError((prev) => ({ ...prev, title: false }))
}
}
}
return (
<SafeAreaView>
@@ -207,10 +213,18 @@ export default function Index() {
<DrawerBottom animation="none" keyboard height={30} isVisible={isVisibleEdit} setVisible={() => setVisibleEdit(false)} title="Edit Lembaga Desa">
<View style={{ flex: 1 }}>
<View>
<InputForm type="default" placeholder="Nama Lembaga Desa" required label="Lembaga Desa" value={titleChoose} onChange={setTitleChoose} />
<InputForm
type="default"
placeholder="Nama Lembaga Desa"
required
label="Lembaga Desa"
value={titleChoose}
error={error.title}
errorText="Lembaga Desa tidak boleh kosong & minimal 3 karakter"
onChange={(val) => { validationForm(val, 'title') }} />
</View>
<View>
<ButtonForm text="SIMPAN" onPress={() => { handleEdit() }} />
<ButtonForm text="SIMPAN" disabled={Object.values(error).some((v) => v == true) || titleChoose == ""} onPress={() => { handleEdit() }} />
</View>
</View>
</DrawerBottom>

View File

@@ -1,6 +1,7 @@
import ButtonBackHeader from "@/components/buttonBackHeader";
import ImageUser from "@/components/imageNew";
import ItemDetailMember from "@/components/itemDetailMember";
import LabelStatus from "@/components/labelStatus";
import HeaderRightMemberDetail from "@/components/member/headerMemberDetail";
import Skeleton from "@/components/skeleton";
import Text from "@/components/Text";
@@ -102,6 +103,11 @@ export default function MemberDetail() {
<View style={[Styles.p15]}>
<View style={[Styles.rowSpaceBetween]}>
<Text style={[Styles.textDefaultSemiBold]}>Informasi</Text>
<LabelStatus
size="small"
category={data?.isActive ? 'success' : 'error'}
text={data?.isActive ? 'AKTIF' : 'TIDAK AKTIF'}
/>
</View>
{
loading ?

View File

@@ -10,6 +10,7 @@ import { apiCreateUser } from "@/lib/api";
import { setUpdateMember } from "@/lib/memberSlice";
import { useAuthSession } from "@/providers/AuthProvider";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { useHeaderHeight } from '@react-navigation/elements';
import * as ImagePicker from "expo-image-picker";
import { router, Stack } from "expo-router";
import { useEffect, useState } from "react";
@@ -26,6 +27,7 @@ import Toast from "react-native-toast-message";
import { useDispatch, useSelector } from "react-redux";
export default function CreateMember() {
const headerHeight = useHeaderHeight();
const dispatch = useDispatch()
const update = useSelector((state: any) => state.memberUpdate)
const { token, decryptToken } = useAuthSession()
@@ -41,6 +43,7 @@ export default function CreateMember() {
const [disableBtn, setDisableBtn] = useState(true)
const [valChoose, setValChoose] = useState("")
const [imgForm, setImgForm] = useState<any>()
const [loading, setLoading] = useState(false)
const [error, setError] = useState({
group: false,
position: false,
@@ -144,7 +147,7 @@ export default function CreateMember() {
}, [error, dataForm])
useEffect(() => {
if(entityUser.role !="supadmin" && entityUser.role != "developer"){
if (entityUser.role != "supadmin" && entityUser.role != "developer") {
validationForm("group", entities.idGroup, entities.group)
}
}, [])
@@ -152,6 +155,7 @@ export default function CreateMember() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -169,7 +173,7 @@ export default function CreateMember() {
fd.append("file", "undefined")
}
const response = await apiCreateUser({data: fd})
const response = await apiCreateUser({ data: fd })
if (response.success) {
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
dispatch(setUpdateMember(!update))
@@ -179,6 +183,9 @@ export default function CreateMember() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -194,9 +201,6 @@ export default function CreateMember() {
if (!result.canceled) {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
}
};
@@ -215,7 +219,7 @@ export default function CreateMember() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading}
category="create"
onPress={() => { handleCreate() }}
/>
@@ -225,7 +229,7 @@ export default function CreateMember() {
<KeyboardAvoidingView
style={[Styles.h100]}
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15]}>
@@ -233,17 +237,16 @@ export default function CreateMember() {
{selectedImage != undefined ? (
<Pressable onPress={pickImageAsync}>
<Image src={selectedImage} style={[Styles.userProfileBig]} />
<View style={[Styles.absoluteIconPicker]}>
<MaterialCommunityIcons name="image" color={'white'} size={15} />
</View>
</Pressable>
) : (
<Pressable
onPress={pickImageAsync}
style={[Styles.iconContent, ColorsStatus.gray]}
>
<MaterialCommunityIcons
name="account-tie"
size={100}
color={"gray"}
/>
<Pressable onPress={pickImageAsync} style={[Styles.iconContent, ColorsStatus.gray]} >
<MaterialCommunityIcons name="account-tie" size={85} color={"gray"} />
<View style={[Styles.absoluteIconPicker]}>
<MaterialCommunityIcons name="image" color={'white'} size={15} />
</View>
</Pressable>
)}
</View>

View File

@@ -8,6 +8,8 @@ import Styles from "@/constants/Styles";
import { apiEditUser, apiGetProfile } from "@/lib/api";
import { setUpdateMember } from "@/lib/memberSlice";
import { useAuthSession } from "@/providers/AuthProvider";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { useHeaderHeight } from '@react-navigation/elements';
import * as ImagePicker from "expo-image-picker";
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
@@ -38,6 +40,7 @@ type Props = {
};
export default function EditMember() {
const headerHeight = useHeaderHeight();
const dispatch = useDispatch()
const update = useSelector((state: any) => state.memberUpdate)
const { token, decryptToken } = useAuthSession()
@@ -52,6 +55,7 @@ export default function EditMember() {
const [disableBtn, setDisableBtn] = useState(false)
const [valChoose, setValChoose] = useState("")
const [imgForm, setImgForm] = useState<any>();
const [loading, setLoading] = useState(false)
const [data, setData] = useState<Props>({
id: "",
name: "",
@@ -175,6 +179,7 @@ export default function EditMember() {
async function handleEdit() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -203,7 +208,9 @@ export default function EditMember() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -222,7 +229,6 @@ export default function EditMember() {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
setErrorImg(false)
}
};
@@ -242,7 +248,7 @@ export default function EditMember() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading}
category="update"
onPress={() => {
handleEdit()
@@ -255,7 +261,7 @@ export default function EditMember() {
<KeyboardAvoidingView
style={[Styles.h100]}
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
@@ -263,13 +269,14 @@ export default function EditMember() {
{
errorImg ?
<Pressable onPress={pickImageAsync}>
{
<Image
source={errorImg ? require("../../../../assets/images/user.jpg") : { uri: `https://wibu-storage.wibudev.com/api/files/${data?.img}` }}
style={[Styles.userProfileBig]}
onError={() => { setErrorImg(true) }}
/>
}
<View style={[Styles.absoluteIconPicker]}>
<MaterialCommunityIcons name="image" color={'white'} size={15} />
</View>
</Pressable>
:
selectedImage != undefined ? (
@@ -283,6 +290,9 @@ export default function EditMember() {
style={[Styles.userProfileBig]}
onError={() => { setErrorImg(true) }}
/>
<View style={[Styles.absoluteIconPicker]}>
<MaterialCommunityIcons name="image" color={'white'} size={15} />
</View>
</Pressable>
) : (
<Image

View File

@@ -26,6 +26,7 @@ export default function ProjectAddFile() {
const [loadingCheck, setLoadingCheck] = useState(false)
const dispatch = useDispatch()
const update = useSelector((state: any) => state.projectUpdate)
const [loading, setLoading] = useState(false)
const pickDocumentAsync = async () => {
let result = await DocumentPicker.getDocumentAsync({
@@ -86,6 +87,7 @@ export default function ProjectAddFile() {
async function handleAddFile() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData();
@@ -116,6 +118,8 @@ export default function ProjectAddFile() {
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -130,7 +134,7 @@ export default function ProjectAddFile() {
headerTitle: 'Tambah File',
headerTitleAlign: 'center',
headerRight: () => <ButtonSaveHeader
disable={fileForm.length == 0 ? true : false}
disable={fileForm.length == 0 || loading ? true : false}
category="create"
onPress={() => { handleAddFile() }} />
}}
@@ -162,6 +166,9 @@ export default function ProjectAddFile() {
{
loadingCheck && <ActivityIndicator size="small" />
}
{
loading && <ActivityIndicator size="large" />
}
</View>
</ScrollView>
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">

View File

@@ -31,6 +31,7 @@ export default function AddMemberProject() {
const [idGroup, setIdGroup] = useState('')
const [selectMember, setSelectMember] = useState<any[]>([])
const [search, setSearch] = useState('')
const [loading, setLoading] = useState(false)
async function handleLoad() {
try {
@@ -43,6 +44,7 @@ export default function AddMemberProject() {
setData(responsemember.data.filter((i: any) => i.idUserRole != 'supadmin'))
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
}
}
@@ -73,6 +75,7 @@ export default function AddMemberProject() {
async function handleAddMember() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiAddMemberProject({ id: id, data: { user: hasil, member: selectMember } })
if (response.success) {
@@ -82,6 +85,9 @@ export default function AddMemberProject() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -96,7 +102,7 @@ export default function AddMemberProject() {
headerRight: () => (
<ButtonSaveHeader
category="update"
disable={selectMember.length > 0 ? false : true}
disable={selectMember.length == 0 || loading ? true : false}
onPress={() => {
handleAddMember()
}}
@@ -150,7 +156,7 @@ export default function AddMemberProject() {
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -6,6 +6,8 @@ import Styles from "@/constants/Styles";
import { apiCreateProjectTask } from "@/lib/api";
import { setUpdateProject } from "@/lib/projectUpdate";
import { useAuthSession } from "@/providers/AuthProvider";
import 'intl';
import 'intl/locale-data/jsonp/id';
import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
@@ -21,8 +23,10 @@ import DateTimePicker, {
DateType
} from "react-native-ui-datepicker";
import { useDispatch, useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
export default function ProjectAddTask() {
const headerHeight = useHeaderHeight();
const { token, decryptToken } = useAuthSession()
const dispatch = useDispatch()
const update = useSelector((state: any) => state.projectUpdate)
@@ -38,6 +42,7 @@ export default function ProjectAddTask() {
title: false,
})
const [title, setTitle] = useState('');
const [loading, setLoading] = useState(false)
const from = range.startDate
? dayjs(range.startDate).format("DD-MM-YYYY")
@@ -69,15 +74,21 @@ export default function ProjectAddTask() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiCreateProjectTask({ data: { name: title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id });
if (response.success) {
dispatch(setUpdateProject({ ...update, task: !update.task, progress: !update.progress }))
Toast.show({ type: 'small', text1: 'Berhasil menambah data', })
router.back();
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -96,7 +107,7 @@ export default function ProjectAddTask() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disable}
disable={disable || loading}
category="create"
onPress={() => { handleCreate() }}
/>
@@ -105,7 +116,7 @@ export default function ProjectAddTask() {
/>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
@@ -119,6 +130,13 @@ export default function ProjectAddTask() {
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
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 File

@@ -19,6 +19,7 @@ export default function ProjectCancel() {
const [reason, setReason] = useState("");
const [error, setError] = useState(false);
const [disable, setDisable] = useState(false);
const [loading, setLoading] = useState(false)
function onValidation(val: string) {
@@ -44,6 +45,7 @@ export default function ProjectCancel() {
async function handleCancel() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiCancelProject({
reason: reason,
@@ -56,6 +58,9 @@ export default function ProjectCancel() {
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -74,7 +79,7 @@ export default function ProjectCancel() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disable}
disable={disable || loading}
category="cancel"
onPress={() => {
handleCancel();

View File

@@ -19,6 +19,7 @@ export default function EditProject() {
const [judul, setJudul] = useState("");
const [error, setError] = useState(false);
const [disable, setDisable] = useState(false);
const [loading, setLoading] = useState(false)
async function handleLoad() {
try {
@@ -59,6 +60,7 @@ export default function EditProject() {
async function handleUpdate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiEditProject({
name: judul,
@@ -68,9 +70,14 @@ export default function EditProject() {
dispatch(setUpdateProject({ ...update, data: !update.data }))
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
router.back();
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -91,7 +98,7 @@ export default function EditProject() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disable}
disable={disable || loading}
category="update"
onPress={() => { handleUpdate() }}
/>

View File

@@ -12,6 +12,7 @@ import SelectForm from "@/components/selectForm";
import Text from "@/components/Text";
import Styles from "@/constants/Styles";
import { apiCreateProject } from "@/lib/api";
import { setGroupChoose } from "@/lib/groupChoose";
import { setMemberChoose } from "@/lib/memberChoose";
import { setUpdateProject } from "@/lib/projectUpdate";
import { setTaskCreate } from "@/lib/taskCreate";
@@ -29,6 +30,7 @@ import Toast from "react-native-toast-message";
import { useDispatch, useSelector } from "react-redux";
export default function CreateProject() {
const [loading, setLoading] = useState(false)
const { token, decryptToken } = useAuthSession();
const [chooseGroup, setChooseGroup] = useState({ val: "", label: "" });
const dispatch = useDispatch();
@@ -39,7 +41,6 @@ export default function CreateProject() {
const taskCreate = useSelector((state: any) => state.taskCreate);
const update = useSelector((state: any) => state.projectUpdate)
const entityUser = useSelector((state: any) => state.user);
const userLogin = useSelector((state: any) => state.entities)
const [fileForm, setFileForm] = useState<any[]>([])
const [indexDelFile, setIndexDelFile] = useState<number>(0)
const [disableBtn, setDisableBtn] = useState(true)
@@ -55,10 +56,21 @@ export default function CreateProject() {
member: false,
});
const [hitung, setHitung] = useState(0)
let hitungRefresh = 0;
useEffect(() => {
if (hitungRefresh == 0) {
dispatch(setGroupChoose(''));
dispatch(setTaskCreate([]));
dispatch(setMemberChoose([]));
}
hitungRefresh++;
}, []);
function validationForm(cat: string, val: any, label?: string) {
if (cat == "group") {
setChooseGroup({ val, label: String(label) });
dispatch(setGroupChoose(val));
dispatch(setMemberChoose([]));
setDataForm({ ...dataForm, idGroup: val });
if (val == "" || val == "null") {
@@ -91,6 +103,7 @@ export default function CreateProject() {
}
function handleBack() {
dispatch(setGroupChoose(''));
dispatch(setTaskCreate([]));
dispatch(setMemberChoose([]));
router.back();
@@ -102,6 +115,7 @@ export default function CreateProject() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -127,6 +141,9 @@ export default function CreateProject() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -178,7 +195,7 @@ export default function CreateProject() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loading}
category="create"
onPress={() => {
handleCreate()
@@ -234,16 +251,18 @@ export default function CreateProject() {
onPress={() => {
if (entityUser.role == "supadmin" || entityUser.role == "developer") {
if (chooseGroup.val != "") {
setSelect(true);
setValSelect("member");
// setSelect(true);
// setValSelect("member");
router.push(`/project/create/member`);
} else {
Toast.show({ type: 'small', text1: "Pilih Lembaga Desa terlebih dahulu", })
}
} else {
validationForm('group', userLogin.idGroup, userLogin.group);
setValChoose(userLogin.idGroup)
setSelect(true);
setValSelect("member");
router.push(`/project/create/member`);
// validationForm('group', userLogin.idGroup, userLogin.group);
// setValChoose(userLogin.idGroup)
// setSelect(true);
// setValSelect("member");
}
}}
error={error.member}

View File

@@ -0,0 +1,147 @@
import ButtonBackHeader from "@/components/buttonBackHeader";
import ButtonSaveHeader from "@/components/buttonSaveHeader";
import ImageUser from "@/components/imageNew";
import ImageWithLabel from "@/components/imageWithLabel";
import InputSearch from "@/components/inputSearch";
import Text from "@/components/Text";
import Styles from "@/constants/Styles";
import { apiGetUser } from "@/lib/api";
import { setMemberChoose } from "@/lib/memberChoose";
import { useAuthSession } from "@/providers/AuthProvider";
import { AntDesign } from "@expo/vector-icons";
import { router, Stack } from "expo-router";
import { useEffect, useState } from "react";
import { Pressable, SafeAreaView, ScrollView, View } from "react-native";
import Toast from "react-native-toast-message";
import { useDispatch, useSelector } from "react-redux";
type Props = {
idUser: string,
name: string,
img: string
}
export default function AddMemberCreateProject() {
const dispatch = useDispatch()
const { token, decryptToken } = useAuthSession()
const [data, setData] = useState<Props[]>([])
const [selectMember, setSelectMember] = useState<any[]>([])
const [search, setSearch] = useState('')
const entitiesMember = useSelector((state: any) => state.memberChoose)
const entitiesGroup = useSelector((state: any) => state.groupChoose)
const entityUser = useSelector((state: any) => state.user)
const userLogin = useSelector((state: any) => state.entities)
async function handleLoadMember() {
const hasil = await decryptToken(String(token?.current))
let groupFix = userLogin.idGroup
if (entityUser.role == 'supadmin' || entityUser.role == 'developer') {
groupFix = entitiesGroup
}
const responMemberDivision = await apiGetUser({ user: hasil, active: "true", search: search, group: groupFix })
setData(responMemberDivision.data.filter((i: any) => i.idUserRole != 'supadmin'))
if (entitiesMember.length > 0) {
setSelectMember(entitiesMember)
}
}
useEffect(() => {
handleLoadMember()
}, [search]);
function onChoose(val: string, label: string, img?: string) {
if (selectMember.some((i: any) => i.idUser == val)) {
setSelectMember(selectMember.filter((i: any) => i.idUser != val))
} else {
setSelectMember([...selectMember, { idUser: val, name: label, img }])
}
}
async function handleAddMember() {
try {
dispatch(setMemberChoose(selectMember))
router.back()
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Gagal menambahkan anggota', })
}
}
return (
<SafeAreaView>
<Stack.Screen
options={{
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
headerTitle: 'Pilih Anggota',
headerTitleAlign: 'center',
headerRight: () => (
<ButtonSaveHeader
category="create"
disable={selectMember.length > 0 ? false : true}
onPress={() => {
handleAddMember()
}}
/>
)
}}
/>
<View style={[Styles.p15]}>
<InputSearch onChange={(val) => setSearch(val)} value={search} />
{
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
key={index}
label={item.name}
src={`https://wibu-storage.wibudev.com/api/files/${item.img}`}
onClick={() => onChoose(item.idUser, item.name, item.img)}
/>
))
}
</ScrollView>
</View>
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
{
data.length > 0 ?
data.map((item: any, index: any) => {
return (
<Pressable
key={index}
style={[Styles.itemSelectModal]}
onPress={() => {
onChoose(item.id, item.name, item.img)
}}
>
<View style={[Styles.rowItemsCenter]}>
<ImageUser src={`https://wibu-storage.wibudev.com/api/files/${item.img}`} border />
<View style={[Styles.ml10]}>
<Text style={[Styles.textDefault]}>{item.name}</Text>
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'} />
}
</Pressable>
)
}
)
:
<Text style={[Styles.textDefault, { textAlign: 'center' }]}>Tidak ada data</Text>
}
</ScrollView>
</View>
</SafeAreaView>
)
}

View File

@@ -6,6 +6,8 @@ import Styles from "@/constants/Styles";
import { setTaskCreate } from "@/lib/taskCreate";
import dayjs from "dayjs";
import { router, Stack } from "expo-router";
import 'intl';
import 'intl/locale-data/jsonp/id';
import { useEffect, useState } from "react";
import {
KeyboardAvoidingView,
@@ -18,8 +20,10 @@ import DateTimePicker, {
DateType
} from "react-native-ui-datepicker";
import { useDispatch, useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
export default function CreateProjectAddTask() {
const headerHeight = useHeaderHeight();
const dispatch = useDispatch()
const [disable, setDisable] = useState(true);
const [range, setRange] = useState<{
@@ -101,7 +105,7 @@ export default function CreateProjectAddTask() {
/>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
@@ -115,6 +119,13 @@ export default function CreateProjectAddTask() {
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
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 File

@@ -6,8 +6,11 @@ import Styles from "@/constants/Styles";
import { apiEditProjectTask, apiGetProjectTask } from "@/lib/api";
import { setUpdateProject } from "@/lib/projectUpdate";
import { useAuthSession } from "@/providers/AuthProvider";
import { useHeaderHeight } from '@react-navigation/elements';
import dayjs from "dayjs";
import { router, Stack, useLocalSearchParams } from "expo-router";
import 'intl';
import 'intl/locale-data/jsonp/id';
import { useEffect, useState } from "react";
import { KeyboardAvoidingView, Platform, SafeAreaView, ScrollView, View } from "react-native";
import Toast from "react-native-toast-message";
@@ -15,6 +18,7 @@ import DateTimePicker, { DateType } from "react-native-ui-datepicker";
import { useDispatch, useSelector } from "react-redux";
export default function UpdateProjectTask() {
const headerHeight = useHeaderHeight();
const dispatch = useDispatch()
const update = useSelector((state: any) => state.projectUpdate)
const { token, decryptToken } = useAuthSession();
@@ -24,6 +28,7 @@ export default function UpdateProjectTask() {
const [year, setYear] = useState<any>()
const [loading, setLoading] = useState(true)
const [disableBtn, setDisableBtn] = useState(false)
const [loadingSubmit, setLoadingSubmit] = useState(false)
const [title, setTitle] = useState('')
const [error, setError] = useState({
@@ -65,15 +70,21 @@ export default function UpdateProjectTask() {
async function handleEdit() {
try {
setLoadingSubmit(true)
const hasil = await decryptToken(String(token?.current));
const response = await apiEditProjectTask({ data: { title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id: detail });
if (response.success) {
dispatch(setUpdateProject({ ...update, task: !update.task, progress: !update.progress }))
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
router.back();
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoadingSubmit(false)
}
}
@@ -108,7 +119,7 @@ export default function UpdateProjectTask() {
headerTitle: 'Edit Tanggal dan Tugas',
headerTitleAlign: 'center',
headerRight: () => <ButtonSaveHeader
disable={disableBtn}
disable={disableBtn || loadingSubmit}
category="update"
onPress={() => { handleEdit() }}
/>
@@ -116,7 +127,7 @@ export default function UpdateProjectTask() {
/>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
@@ -129,13 +140,19 @@ export default function UpdateProjectTask() {
startDate={range.startDate}
endDate={range.endDate}
onChange={(param) => setRange(param)}
// styles={defaultStyles}
month={month}
year={year}
styles={{
selected: Styles.selectedDate,
selected_label: Styles.cWhite,
range_fill: Styles.selectRangeDate,
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 File

@@ -4,9 +4,9 @@ import { Stack } from 'expo-router';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import { useEffect } from 'react';
import 'react-native-reanimated';
import { NotifierWrapper } from 'react-native-notifier';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { NotifierWrapper } from 'react-native-notifier';
import 'react-native-reanimated';
// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync();

View File

@@ -51,7 +51,7 @@ export default function FileDivisionDetail() {
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}`;
@@ -59,6 +59,7 @@ export default function FileDivisionDetail() {
FileSystem.downloadAsync(remoteUrl, localPath).then(async ({ uri }) => {
const contentURL = await FileSystem.getContentUriAsync(uri);
setLoadingOpen(false)
try {
if (Platform.OS == 'android') {
// open with android intent
@@ -79,7 +80,7 @@ export default function FileDivisionDetail() {
} 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)
}
});
};

View File

@@ -6,7 +6,7 @@ import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons";
import * as DocumentPicker from "expo-document-picker";
import { useLocalSearchParams } from "expo-router";
import { useState } from "react";
import { View } from "react-native";
import { ActivityIndicator, View } from "react-native";
import Toast from "react-native-toast-message";
import { useDispatch, useSelector } from "react-redux";
import ButtonMenuHeader from "../buttonMenuHeader";
@@ -46,26 +46,31 @@ export default function HeaderRightDocument({ path }: { path: string }) {
const pickDocumentAsync = async () => {
let result = await DocumentPicker.getDocumentAsync({
type: ["*/*"],
multiple: false,
multiple: true,
});
if (!result.canceled) {
if (result.assets?.[0].uri) {
handleUploadFile(result.assets?.[0])
let file: any[] = []
for (let i = 0; i < result.assets?.length; i++) {
if (result.assets?.[i].uri) {
file.push(result.assets?.[i])
}
}
handleUploadFile(file)
}
};
async function handleUploadFile(file: any) {
async function handleUploadFile(file: any[]) {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
fd.append("file", {
uri: file.uri,
for (let i = 0; i < file.length; i++) {
fd.append(`file${i}`, {
uri: file[i].uri,
type: "application/octet-stream",
name: file.name,
name: file[i].name,
} as any);
}
fd.append(
"data",
JSON.stringify({
@@ -73,7 +78,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
idDivision: id,
user: hasil,
})
);
)
const response = await apiUploadFileDocument({ data: fd })
if (response.success) {
@@ -106,6 +111,13 @@ export default function HeaderRightDocument({ path }: { path: string }) {
title="Menu"
>
<View style={Styles.rowItemsCenter}>
{
loading ?
<View style={[Styles.contentItemCenter, Styles.w100, Styles.h100]}>
<ActivityIndicator size="large" />
</View>
:
<>
<MenuItemRow
icon={
<MaterialCommunityIcons
@@ -128,6 +140,8 @@ export default function HeaderRightDocument({ path }: { path: string }) {
title="Upload File"
onPress={pickDocumentAsync}
/>
</>
}
</View>
</DrawerBottom>
<ModalFloat

View File

@@ -48,9 +48,9 @@ export default function HeaderRightGroupList() {
if (cat === 'title') {
setTitle(val)
if (val == "" || val.length < 3) {
setError({ ...error, title: true })
setError((prev) => ({ ...prev, title: true }))
} else {
setError({ ...error, title: false })
setError((prev) => ({ ...prev, title: false }))
}
}
}
@@ -91,7 +91,7 @@ export default function HeaderRightGroupList() {
/>
</View>
<View>
<ButtonForm text="SIMPAN" onPress={() => { onCheck() }} />
<ButtonForm text="SIMPAN" disabled={Object.values(error).some((v) => v == true) || title == ""} onPress={() => { onCheck() }} />
</View>
</View>
</DrawerBottom>

View File

@@ -1,11 +1,11 @@
import { ColorsStatus } from "@/constants/ColorsStatus";
import Styles from "@/constants/Styles";
import { stringToDate } from "@/lib/fun_stringToDate";
import DateTimePicker from "@react-native-community/datetimepicker";
import dayjs from "dayjs";
import { useState } from "react";
import { Pressable, View } from "react-native";
import { Platform, Pressable, View } from "react-native";
import Text from "./Text";
import ModalFloat from "./modalFloat";
type Props = {
label?: string;
@@ -58,15 +58,35 @@ export function InputDate({ label, value, placeholder, onChange, info, disable,
{info != undefined && (<Text style={[Styles.textInformation, Styles.mt05, Styles.cGray]}>{info}</Text>)}
</View>
{
Platform.OS === 'ios' ? (
modal && (
<ModalFloat
isVisible={modal}
setVisible={setModal}
onSubmit={() => { }}
buttonHide
disableSubmit
title={mode == "date" ? "Pilih Tanggal" : mode == "time" ? "Pilih Jam" : "Pilih Tanggal & Jam"}>
<DateTimePicker
value={new Date()}
mode={mode}
display="spinner"
onChange={(event, date) => { onChangeDate(event.type, date) }}
onTouchCancel={() => setModal(false)}
/>
</ModalFloat>
)
) : (
modal && (
<DateTimePicker
value={new Date()}
mode={mode}
display="default"
display="inline"
onChange={(event, date) => { onChangeDate(event.type, date) }}
onTouchCancel={() => setModal(false)}
/>
)
)
}
</>
)

View File

@@ -1,5 +1,5 @@
import Styles from "@/constants/Styles";
import { Dimensions, TextInput, View } from "react-native";
import { Dimensions, Platform, TextInput, View } from "react-native";
import Text from "./Text";
type Props = {
@@ -36,7 +36,14 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
</Text>
)
}
<View style={[Styles.inputRoundForm, itemRight != undefined ? Styles.inputRoundFormRight : Styles.inputRoundFormLeft, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }, error && { borderColor: "red" }]}>
<View style={[
Styles.inputRoundForm,
itemRight != undefined ? Styles.inputRoundFormRight : Styles.inputRoundFormLeft,
round && Styles.round30,
{ backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' },
error && { borderColor: "red" },
Platform.OS == 'ios' && { paddingVertical: 10 },
]}>
{itemRight != undefined ? itemRight : itemLeft}
<TextInput
editable={!disable}
@@ -71,11 +78,11 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
placeholder={placeholder}
keyboardType={type}
editable={!disable}
style={[Styles.inputRoundForm, error && { borderColor: "red" }, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }, { color: 'black' }, multiline && { height: 100, textAlignVertical: 'top' }]}
style={[Styles.inputRoundForm, error && { borderColor: "red" }, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }, { color: 'black' }, multiline && { height: 150, textAlignVertical: 'top' }]}
onChangeText={onChange}
placeholderTextColor={'gray'}
multiline={multiline}
numberOfLines={multiline ? 4 : undefined}
numberOfLines={multiline ? 5 : undefined}
/>
{error && (<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>{errorText}</Text>)}
{info != undefined && (<Text style={[Styles.textInformation, Styles.mt05, Styles.cGray]}>{info}</Text>)}

View File

@@ -10,7 +10,7 @@ type Props = {
}
export default function LabelStatus({ category, text, size }: Props) {
return (
<View style={[size == "small" ? Styles.labelStatusSmall : Styles.labelStatus, ColorsStatus[category], Styles.round10]}>
<View style={[size == "small" ? Styles.labelStatusSmall : Styles.labelStatus, ColorsStatus[category], Styles.round10, Styles.contentItemCenter]}>
<Text style={[size == "small" ? Styles.textSmallSemiBold : Styles.textMediumSemiBold, Styles.cWhite, { textAlign: 'center' }]}>{text}</Text>
</View>
)

View File

@@ -62,7 +62,7 @@ export default function ModalFilter({ open, close, page, category }: Props) {
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
{
chooseGroup == item.id && <AntDesign name="check" size={20} />
chooseGroup == item.id && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
))
@@ -71,7 +71,7 @@ export default function ModalFilter({ open, close, page, category }: Props) {
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
{
chooseGroup == item.id && <AntDesign name="check" size={20} />
chooseGroup == item.id && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
))

View File

@@ -1,7 +1,7 @@
import Styles from '@/constants/Styles';
import { Pressable, View } from 'react-native';
import Text from './Text';
import Modal from 'react-native-modal';
import Text from './Text';
type Props = {
isVisible: boolean
@@ -10,9 +10,10 @@ type Props = {
children: React.ReactNode
onSubmit: () => void
disableSubmit?: boolean
buttonHide?: boolean
}
export default function ModalFloat({ isVisible, setVisible, title, children, onSubmit, disableSubmit }: Props) {
export default function ModalFloat({ isVisible, setVisible, title, children, onSubmit, disableSubmit, buttonHide }: Props) {
return (
<Modal
animationIn={"fadeIn"}
@@ -28,6 +29,8 @@ export default function ModalFloat({ isVisible, setVisible, title, children, onS
<View style={[Styles.mb10]}>
{children}
</View>
{
!buttonHide && (
<View style={[Styles.rowItemsCenter, { justifyContent: 'flex-end' }]}>
<Pressable style={[Styles.ph15, Styles.pv05, Styles.round10, Styles.mr10]} onPress={() => { setVisible(false) }}>
<Text style={[Styles.textDefault]}>Batal</Text>
@@ -36,6 +39,8 @@ export default function ModalFloat({ isVisible, setVisible, title, children, onS
<Text style={[Styles.textDefault, disableSubmit && Styles.cGray]}>Simpan</Text>
</Pressable>
</View>
)
}
</View>
</Modal>
)

View File

@@ -9,13 +9,13 @@ import { useAuthSession } from "@/providers/AuthProvider"
import { AntDesign } from "@expo/vector-icons"
import { useEffect, useState } from "react"
import { Pressable, ScrollView, View } from "react-native"
import Text from "./Text";
import { useDispatch, useSelector } from "react-redux"
import { ButtonForm } from "./buttonForm"
import DrawerBottom from "./drawerBottom"
import ImageUser from "./imageNew"
import ImageWithLabel from "./imageWithLabel"
import InputSearch from "./inputSearch"
import Text from "./Text"
type Props = {
open: boolean
@@ -89,7 +89,6 @@ export default function ModalSelect({ open, close, title, category, idParent, on
useEffect(() => {
if (category == 'group') {
if (entitiesGroup.length == 0)
handleLoadGroup()
setData(entitiesGroup)
} else if (category == 'position') {
@@ -174,9 +173,9 @@ export default function ModalSelect({ open, close, title, category, idParent, on
{
(category == 'member')
?
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'} />
:
chooseValue.val == item.id && <AntDesign name="check" size={20} />
chooseValue.val == item.id && <AntDesign name="check" size={20} color={'black'} />
}
</Pressable>
))
@@ -192,7 +191,7 @@ export default function ModalSelect({ open, close, title, category, idParent, on
}}>
<Text style={[chooseValue.val == item.val ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.label}</Text>
{
valChoose == item.val && <AntDesign name="check" size={20} />
valChoose == item.val && <AntDesign name="check" size={20} color={'black'} />
}
</Pressable>
))

View File

@@ -161,7 +161,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
<Text numberOfLines={1} style={[Styles.w80]}>{item.name}</Text>
{
selectedDivision.some((i: any) => i.id == item.id)
? <AntDesign name="check" size={18} />
? <AntDesign name="check" size={18} color={'black'}/>
: <></>
}
</Pressable>
@@ -177,9 +177,9 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
<Text style={[Styles.textMediumSemiBold]}>{item.name}</Text>
{
checked[item.id] && checked[item.id]?.length === item.Division?.length
? <AntDesign name="check" size={20} />
? <AntDesign name="check" size={20} color={'black'}/>
: (checked[item.id] && checked[item.id]?.length > 0 && checked[item.id]?.length < item.Division?.length)
? <AntDesign name="minus" size={20} />
? <AntDesign name="minus" size={20} color={'black'}/>
: <></>
}
</Pressable>
@@ -189,7 +189,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
<Pressable key={v} style={[Styles.itemSelectModal]} onPress={() => { handleCheck(item.id, child.id) }}>
<Text style={[Styles.ml10, Styles.textMediumNormal, Styles.w80]} numberOfLines={1} ellipsizeMode="tail" >{child.name}</Text>
{
checked[item.id] && checked[item.id].includes(child.id) && <AntDesign name="check" size={20} />
checked[item.id] && checked[item.id].includes(child.id) && <AntDesign name="check" size={20} color={'black'}/>
}
</Pressable>
)

View File

@@ -30,8 +30,6 @@ export default function HeaderRightProjectList() {
}}
/>
}
{
(entityUser.role == 'supadmin' || entityUser.role == 'developer') &&
<MenuItemRow
icon={<AntDesign name="filter" color="black" size={25} />}
title="Filter"
@@ -42,7 +40,6 @@ export default function HeaderRightProjectList() {
}, 600)
}}
/>
}
</View>
</DrawerBottom>
<ModalFilter

View File

@@ -173,7 +173,7 @@ export default function SectionFile({ status, member, refreshing }: { status: nu
<View style={Styles.rowItemsCenter}>
<MenuItemRow
icon={<MaterialCommunityIcons name="file-eye" color="black" size={25} />}
title="Lihat File"
title="Lihat / Share"
onPress={() => {
openFile()
}}

View File

@@ -13,7 +13,7 @@ export default function SectionCancel({ text, title }: Props) {
return (
<View style={[ColorsStatus.lightRed, Styles.p10, Styles.round10, Styles.mb15]}>
<View style={[Styles.rowItemsCenter]}>
<AntDesign name="warning" size={22} style={[Styles.mr10]} />
<AntDesign name="warning" size={22} style={[Styles.mr10]} color={'black'}/>
<Text style={[Styles.textDefaultSemiBold]}>{title ? title : 'Kegiatan Dibatalkan'}</Text>
</View>
{

View File

@@ -157,7 +157,7 @@ export default function SectionFileTask({refreshing}: {refreshing: boolean}) {
<View style={Styles.rowItemsCenter}>
<MenuItemRow
icon={<MaterialCommunityIcons name="file-eye" color="black" size={25} />}
title="Lihat File"
title="Lihat / Share"
onPress={() => {
openFile()
// setModal(false)

View File

@@ -585,6 +585,14 @@ const Styles = StyleSheet.create({
width: '90%',
borderWidth: 1,
borderColor: '#d6d8f6',
},
absoluteIconPicker: {
backgroundColor: '#384288',
padding: 5,
borderRadius: 100,
bottom: 5,
right: 5,
position: 'absolute'
}
})

16
index.js Normal file
View File

@@ -0,0 +1,16 @@
// index.js
import 'expo-router/entry'; // ⬅️ wajib ada agar expo-router tetap bekerja
import messaging from '@react-native-firebase/messaging';
import AsyncStorage from '@react-native-async-storage/async-storage';
// ✅ Firebase background handler — wajib diletakkan DI SINI
messaging().setBackgroundMessageHandler(async remoteMessage => {
const screen = remoteMessage?.data?.category;
const content = remoteMessage?.data?.content;
if (screen && content) {
await AsyncStorage.setItem('navigateOnOpen', JSON.stringify({ screen, content }));
}
});

14
lib/groupChoose.ts Normal file
View File

@@ -0,0 +1,14 @@
import { createSlice } from '@reduxjs/toolkit';
const groupChoose = createSlice({
name: 'groupChoose',
initialState: '',
reducers: {
setGroupChoose: (state, action) => {
return action.payload;
},
},
});
export const { setGroupChoose } = groupChoose.actions;
export default groupChoose.reducer;

View File

@@ -19,6 +19,7 @@ import projectUpdate from './projectUpdate';
import taskCreate from './taskCreate';
import taskUpdate from './taskUpdate';
import userReducer from './userSlice';
import groupChoose from './groupChoose';
const store = configureStore({
reducer: {
@@ -42,6 +43,7 @@ const store = configureStore({
dokumenUpdate: dokumenUpdate,
notificationUpdate: notificationUpdate,
calendarCreate: calendarCreate,
groupChoose: groupChoose,
}
});

View File

@@ -1,3 +1,4 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import { getApp, getApps, initializeApp } from '@react-native-firebase/app';
import messaging, { getMessaging } from '@react-native-firebase/messaging';
import { useEffect } from 'react';
@@ -24,10 +25,14 @@ const initializeFirebase = async () => {
// Set auto initialization and background message handler
mess.setAutoInitEnabled(true);
mess.setBackgroundMessageHandler(async remoteMessage => {
// console.log('Message handled in the background!', remoteMessage);
// pushToPage(String(remoteMessage?.data?.category), String(remoteMessage?.data?.content))
});
// mess.setBackgroundMessageHandler(async remoteMessage => {
// const screen = remoteMessage?.data?.category;
// const content = remoteMessage?.data?.content;
// if (screen && content) {
// await AsyncStorage.setItem('navigateOnOpen', JSON.stringify({ screen, content }));
// }
// });
return mess
} catch (error) {

View File

@@ -1,6 +1,6 @@
{
"name": "mobile-darmasaba",
"main": "expo-router/entry",
"main": "index.js",
"version": "1.0.0",
"scripts": {
"start": "expo start",