Compare commits
62 Commits
amalia/04-
...
amalia/07-
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b18322f38 | |||
| af24a8af23 | |||
| 95121d0442 | |||
| 5e1ed12ca8 | |||
| 9dde198d5e | |||
| 5fcabc5d77 | |||
| 9fa19af68b | |||
| d2cb7d7738 | |||
| a27c6181dd | |||
| c4e48726e0 | |||
| ab4813d3aa | |||
| 60278fee16 | |||
| 10d4c94cc1 | |||
| 78e7323eab | |||
| ea1c0bd67e | |||
| 1698cc703c | |||
| 43362da45a | |||
| 34d727f07d | |||
| ed175d63f2 | |||
| bd82b7c427 | |||
| a6c96105d2 | |||
| 14e9bf15c7 | |||
| 907b56feaf | |||
| 2341a46992 | |||
| 43a91c6481 | |||
| ecc41c905f | |||
| 65d53951c3 | |||
| c2597b25bf | |||
| f1b3eecbbe | |||
| f042e32d98 | |||
| 93c492ac71 | |||
| 6cca0a3d08 | |||
| bbb25a30d2 | |||
| 46e269b45f | |||
| 4725d27f74 | |||
| ae74791a1c | |||
| ba453ad027 | |||
| 187e9dd19e | |||
| 040cab4f5e | |||
| 7442d01551 | |||
| 180fbeede9 | |||
| d0d40cb1a7 | |||
| 8a25c2f672 | |||
| d31c3677c9 | |||
| 19b02ffc01 | |||
| b9b615636b | |||
| d3e7ef9623 | |||
| d52453c530 | |||
| 1853cb573c | |||
| 83291676d3 | |||
| 1509d1b702 | |||
| 8d6a0d3981 | |||
| d20307fc0b | |||
| 060f96e7b2 | |||
| a15724756e | |||
| c8de5d185a | |||
| 5fa364be24 | |||
| 4768007df3 | |||
| 89bf659598 | |||
| c435eb1503 | |||
| 75c95b5c92 | |||
| bc590b8cb5 |
@@ -39,5 +39,7 @@ app-example
|
|||||||
|
|
||||||
x.ts
|
x.ts
|
||||||
x.sh
|
x.sh
|
||||||
/android
|
|
||||||
/ios
|
.env
|
||||||
|
|
||||||
|
android/
|
||||||
1
.gitignore
vendored
@@ -45,5 +45,4 @@ x.sh
|
|||||||
|
|
||||||
google-services.json
|
google-services.json
|
||||||
service-account.json
|
service-account.json
|
||||||
GoogleService-Info.plist.bak
|
|
||||||
|
|
||||||
|
|||||||
4
android/.kotlin/errors/errors-1757572005452.log
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
kotlin version: 2.0.21
|
||||||
|
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
|
||||||
|
1. Kotlin compile daemon is ready
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ export default {
|
|||||||
expo: {
|
expo: {
|
||||||
name: "Desa+",
|
name: "Desa+",
|
||||||
slug: "mobile-darmasaba",
|
slug: "mobile-darmasaba",
|
||||||
version: "1.0.2",
|
version: "2.0.1", // Versi aplikasi (App Store)
|
||||||
jsEngine: "jsc",
|
jsEngine: "jsc",
|
||||||
orientation: "portrait",
|
orientation: "portrait",
|
||||||
icon: "./assets/images/logo-icon-small.png",
|
icon: "./assets/images/logo-icon-small.png",
|
||||||
@@ -14,15 +14,16 @@ export default {
|
|||||||
ios: {
|
ios: {
|
||||||
supportsTablet: true,
|
supportsTablet: true,
|
||||||
bundleIdentifier: "mobiledarmasaba.app",
|
bundleIdentifier: "mobiledarmasaba.app",
|
||||||
|
buildNumber: "3",
|
||||||
infoPlist: {
|
infoPlist: {
|
||||||
ITSAppUsesNonExemptEncryption: false,
|
ITSAppUsesNonExemptEncryption: false,
|
||||||
CFBundleDisplayName: "Desa+"
|
CFBundleDisplayName: "Desa+"
|
||||||
},
|
},
|
||||||
googleServicesFile: "./ios/Desa/GoogleService-Info.plist"
|
googleServicesFile: process.env.IOS_GOOGLE_SERVICES_FILE
|
||||||
},
|
},
|
||||||
android: {
|
android: {
|
||||||
package: "mobiledarmasaba.app",
|
package: "mobiledarmasaba.app",
|
||||||
versionCode: 6,
|
versionCode: 10,
|
||||||
adaptiveIcon: {
|
adaptiveIcon: {
|
||||||
foregroundImage: "./assets/images/logo-icon-small.png",
|
foregroundImage: "./assets/images/logo-icon-small.png",
|
||||||
backgroundColor: "#ffffff"
|
backgroundColor: "#ffffff"
|
||||||
@@ -59,7 +60,7 @@ export default {
|
|||||||
"@react-native-firebase/app",
|
"@react-native-firebase/app",
|
||||||
{
|
{
|
||||||
ios: {
|
ios: {
|
||||||
googleServicesFile: "./ios/Desa/GoogleService-Info.plist"
|
googleServicesFile: process.env.IOS_GOOGLE_SERVICES_FILE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { getMessaging, onMessage } from "@react-native-firebase/messaging";
|
|||||||
import { Redirect, router, Stack, usePathname } from "expo-router";
|
import { Redirect, router, Stack, usePathname } from "expo-router";
|
||||||
import { StatusBar } from 'expo-status-bar';
|
import { StatusBar } from 'expo-status-bar';
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
import { Platform } from "react-native";
|
||||||
import { Easing, Notifier } from 'react-native-notifier';
|
import { Easing, Notifier } from 'react-native-notifier';
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
|
|
||||||
@@ -148,7 +149,7 @@ export default function RootLayout() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<StatusBar style="inverted" translucent={false} backgroundColor="black" />
|
<StatusBar style={'light'} translucent={false} backgroundColor="black" />
|
||||||
<ToastCustom />
|
<ToastCustom />
|
||||||
</Provider>
|
</Provider>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
|||||||
import { Entypo, MaterialIcons } from "@expo/vector-icons";
|
import { Entypo, MaterialIcons } from "@expo/vector-icons";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Dimensions, SafeAreaView, ScrollView, View } from "react-native";
|
import { Dimensions, RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
import RenderHTML from 'react-native-render-html';
|
import RenderHTML from 'react-native-render-html';
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ export default function DetailAnnouncement() {
|
|||||||
const contentWidth = Dimensions.get('window').width
|
const contentWidth = Dimensions.get('window').width
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const arrSkeleton = Array.from({ length: 2 }, (_, index) => index)
|
const arrSkeleton = Array.from({ length: 2 }, (_, index) => index)
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
async function handleLoad(loading: boolean) {
|
async function handleLoad(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
@@ -56,6 +57,13 @@ export default function DetailAnnouncement() {
|
|||||||
return htmlRegex.test(text);
|
return htmlRegex.test(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
handleLoad(false)
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -66,7 +74,16 @@ export default function DetailAnnouncement() {
|
|||||||
headerRight: () => entityUser.role != 'user' && entityUser.role != 'coadmin' ? <HeaderRightAnnouncementDetail id={id} /> : <></>,
|
headerRight: () => entityUser.role != 'user' && entityUser.role != 'coadmin' ? <HeaderRightAnnouncementDetail id={id} /> : <></>,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={() => handleRefresh()}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15]}>
|
||||||
<View style={[Styles.wrapPaper]}>
|
<View style={[Styles.wrapPaper]}>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -110,8 +110,11 @@ export default function CreateAnnouncement() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
|
<View style={[Styles.p15]}>
|
||||||
<InputForm
|
<InputForm
|
||||||
label="Judul"
|
label="Judul"
|
||||||
type="default"
|
type="default"
|
||||||
|
|||||||
@@ -153,8 +153,11 @@ export default function EditAnnouncement() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
|
<View style={[Styles.p15]}>
|
||||||
<InputForm
|
<InputForm
|
||||||
label="Judul"
|
label="Judul"
|
||||||
type="default"
|
type="default"
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export default function EditBanner() {
|
|||||||
category="update" />,
|
category="update" />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
<View style={[Styles.mb15]}>
|
<View style={[Styles.mb15]}>
|
||||||
{selectedImage != undefined ? (
|
{selectedImage != undefined ? (
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ export default function CreateBanner() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15]}>
|
||||||
<View style={[Styles.mb15]}>
|
<View style={[Styles.mb15]}>
|
||||||
{selectedImage != undefined ? (
|
{selectedImage != undefined ? (
|
||||||
<Pressable onPress={pickImageAsync}>
|
<Pressable onPress={pickImageAsync}>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import SkeletonContent from "@/components/skeletonContent";
|
|||||||
import Text from '@/components/Text';
|
import Text from '@/components/Text';
|
||||||
import { ColorsStatus } from "@/constants/ColorsStatus";
|
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||||
import { ConstEnv } from "@/constants/ConstEnv";
|
import { ConstEnv } from "@/constants/ConstEnv";
|
||||||
|
import { regexOnlySpacesOrEnter } from "@/constants/OnlySpaceOrEnter";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { apiGetDiscussionGeneralOne, apiSendDiscussionGeneralCommentar } from "@/lib/api";
|
import { apiGetDiscussionGeneralOne, apiSendDiscussionGeneralCommentar } from "@/lib/api";
|
||||||
import { getDB } from "@/lib/firebaseDatabase";
|
import { getDB } from "@/lib/firebaseDatabase";
|
||||||
@@ -139,7 +140,7 @@ export default function DetailDiscussionGeneral() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<ScrollView>
|
<ScrollView showsVerticalScrollIndicator={false}>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
{
|
{
|
||||||
loading ?
|
loading ?
|
||||||
@@ -153,14 +154,13 @@ export default function DetailDiscussionGeneral() {
|
|||||||
<MaterialIcons name="chat" size={25} color={'#384288'} />
|
<MaterialIcons name="chat" size={25} color={'#384288'} />
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
title={data?.title}
|
title={data?.title + " " + data?.createdAt}
|
||||||
subtitle={
|
subtitle={
|
||||||
!data?.isActive ?
|
!data?.isActive ?
|
||||||
<LabelStatus category='warning' text='ARSIP' size="small" />
|
<LabelStatus category='warning' text='ARSIP' size="small" />
|
||||||
:
|
:
|
||||||
<LabelStatus category={data.status == 1 ? 'success' : 'error'} text={data.status == 1 ? 'BUKA' : 'TUTUP'} size="small" />
|
<LabelStatus category={data.status == 1 ? 'success' : 'error'} text={data.status == 1 ? 'BUKA' : 'TUTUP'} size="small" />
|
||||||
}
|
}
|
||||||
rightTopInfo={data?.createdAt}
|
|
||||||
desc={data?.desc}
|
desc={data?.desc}
|
||||||
leftBottomInfo={
|
leftBottomInfo={
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
<View style={[Styles.rowItemsCenter]}>
|
||||||
@@ -168,6 +168,11 @@ export default function DetailDiscussionGeneral() {
|
|||||||
<Text style={[Styles.textInformation, Styles.cGray, Styles.mb05]}>{dataKomentar.length} Komentar</Text>
|
<Text style={[Styles.textInformation, Styles.cGray, Styles.mb05]}>{dataKomentar.length} Komentar</Text>
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
|
rightBottomInfo={
|
||||||
|
<View style={[Styles.rowItemsCenter]}>
|
||||||
|
<Text style={[Styles.textInformation, Styles.cGray, Styles.mb05]}>{data?.createdAt}</Text>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15]}>
|
||||||
@@ -214,12 +219,17 @@ export default function DetailDiscussionGeneral() {
|
|||||||
bg="white"
|
bg="white"
|
||||||
onChange={setKomentar}
|
onChange={setKomentar}
|
||||||
value={komentar}
|
value={komentar}
|
||||||
|
multiline
|
||||||
itemRight={
|
itemRight={
|
||||||
<Pressable onPress={() => {
|
<Pressable onPress={() => {
|
||||||
(komentar != '' && data?.status === 1 && data?.isActive && (memberDiscussion || (entityUser.role != "user" && entityUser.role != "coadmin")))
|
(komentar != '' && !regexOnlySpacesOrEnter.test(komentar) && data?.status === 1 && data?.isActive && (memberDiscussion || (entityUser.role != "user" && entityUser.role != "coadmin")))
|
||||||
&& handleKomentar()
|
&& handleKomentar()
|
||||||
}}>
|
}}
|
||||||
<MaterialIcons name="send" size={25} style={(komentar == '' || data?.status === 2 || !data?.isActive || (!memberDiscussion && (entityUser.role == "user" || entityUser.role == "coadmin"))) ? Styles.cGray : Styles.cDefault} />
|
style={[
|
||||||
|
Platform.OS == 'android' && Styles.mb12,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<MaterialIcons name="send" size={25} style={(komentar == '' || regexOnlySpacesOrEnter.test(komentar) || data?.status === 2 || !data?.isActive || (!memberDiscussion && (entityUser.role == "user" || entityUser.role == "coadmin"))) ? Styles.cGray : Styles.cDefault} />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export default function AddMemberDiscussionDetail() {
|
|||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -133,7 +133,9 @@ export default function AddMemberDiscussionDetail() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ export default function CreateDiscussionGeneral() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
{
|
{
|
||||||
(entityUser.role == "supadmin" ||
|
(entityUser.role == "supadmin" ||
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export default function EditDiscussionGeneral() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15]}>
|
||||||
<InputForm
|
<InputForm
|
||||||
label="Judul"
|
label="Judul"
|
||||||
|
|||||||
@@ -98,22 +98,26 @@ export default function Discussion() {
|
|||||||
return (
|
return (
|
||||||
<View style={[Styles.p15, { flex: 1 }]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<View>
|
<View>
|
||||||
<View style={[Styles.wrapBtnTab]}>
|
{
|
||||||
<ButtonTab
|
entityUser.role != "user" && entityUser.role != "coadmin" &&
|
||||||
active={status == "false" ? "false" : "true"}
|
<View style={[Styles.wrapBtnTab]}>
|
||||||
value="true"
|
<ButtonTab
|
||||||
onPress={() => { setStatus("true") }}
|
active={status == "false" ? "false" : "true"}
|
||||||
label="Aktif"
|
value="true"
|
||||||
icon={<Feather name="check-circle" color={status == "false" ? 'black' : 'white'} size={20} />}
|
onPress={() => { setStatus("true") }}
|
||||||
n={2} />
|
label="Aktif"
|
||||||
<ButtonTab
|
icon={<Feather name="check-circle" color={status == "false" ? 'black' : 'white'} size={20} />}
|
||||||
active={status == "false" ? "false" : "true"}
|
n={2} />
|
||||||
value="false"
|
<ButtonTab
|
||||||
onPress={() => { setStatus("false") }}
|
active={status == "false" ? "false" : "true"}
|
||||||
label="Arsip"
|
value="false"
|
||||||
icon={<AntDesign name="closecircleo" color={status == "true" ? 'black' : 'white'} size={20} />}
|
onPress={() => { setStatus("false") }}
|
||||||
n={2} />
|
label="Arsip"
|
||||||
</View>
|
icon={<AntDesign name="closecircleo" color={status == "true" ? 'black' : 'white'} size={20} />}
|
||||||
|
n={2} />
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
|
||||||
<InputSearch onChange={setSearch} />
|
<InputSearch onChange={setSearch} />
|
||||||
{
|
{
|
||||||
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
||||||
|
|||||||
@@ -135,22 +135,25 @@ export default function MemberDiscussionDetail() {
|
|||||||
router.push(`/member/${chooseUser.idUser}`)
|
router.push(`/member/${chooseUser.idUser}`)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{
|
||||||
|
entityUser.role != "user" && entityUser.role != "coadmin" &&
|
||||||
|
<MenuItemRow
|
||||||
|
icon={<MaterialCommunityIcons name="account-remove" color="black" size={25} />}
|
||||||
|
title="Keluarkan"
|
||||||
|
onPress={() => {
|
||||||
|
setModal(false)
|
||||||
|
AlertKonfirmasi({
|
||||||
|
title: 'Konfirmasi',
|
||||||
|
desc: 'Apakah Anda yakin ingin mengeluarkan anggota?',
|
||||||
|
onPress: () => {
|
||||||
|
handleDeleteUser()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
<MenuItemRow
|
}}
|
||||||
icon={<MaterialCommunityIcons name="account-remove" color="black" size={25} />}
|
/>
|
||||||
title="Keluarkan"
|
}
|
||||||
onPress={() => {
|
|
||||||
setModal(false)
|
|
||||||
AlertKonfirmasi({
|
|
||||||
title: 'Konfirmasi',
|
|
||||||
desc: 'Apakah Anda yakin ingin mengeluarkan anggota?',
|
|
||||||
onPress: () => {
|
|
||||||
handleDeleteUser()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export default function AddMemberCalendarEvent() {
|
|||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -140,7 +140,10 @@ export default function AddMemberCalendarEvent() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
data.map((item: any, index: any) => {
|
data.map((item: any, index: any) => {
|
||||||
@@ -151,7 +154,6 @@ export default function AddMemberCalendarEvent() {
|
|||||||
style={[Styles.itemSelectModal]}
|
style={[Styles.itemSelectModal]}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
!found && onChoose(item.idUser, item.name, item.img)
|
!found && onChoose(item.idUser, item.name, item.img)
|
||||||
onChoose(item.idUser, item.name, item.img)
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
<View style={[Styles.rowItemsCenter]}>
|
||||||
@@ -164,7 +166,7 @@ export default function AddMemberCalendarEvent() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'} />
|
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} color={'black'} />
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export default function CreateCalendarAddMember() {
|
|||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -129,7 +129,10 @@ export default function CreateCalendarAddMember() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export default function DiscussionDivisionEdit() {
|
|||||||
required
|
required
|
||||||
value={data}
|
value={data}
|
||||||
onChange={setData}
|
onChange={setData}
|
||||||
|
multiline
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import Skeleton from "@/components/skeleton";
|
|||||||
import SkeletonContent from "@/components/skeletonContent";
|
import SkeletonContent from "@/components/skeletonContent";
|
||||||
import Text from "@/components/Text";
|
import Text from "@/components/Text";
|
||||||
import { ConstEnv } from "@/constants/ConstEnv";
|
import { ConstEnv } from "@/constants/ConstEnv";
|
||||||
|
import { regexOnlySpacesOrEnter } from "@/constants/OnlySpaceOrEnter";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import {
|
import {
|
||||||
apiGetDiscussionOne,
|
apiGetDiscussionOne,
|
||||||
@@ -304,6 +305,7 @@ export default function DiscussionDetail() {
|
|||||||
bg="white"
|
bg="white"
|
||||||
type="default"
|
type="default"
|
||||||
round
|
round
|
||||||
|
multiline
|
||||||
placeholder="Kirim Komentar"
|
placeholder="Kirim Komentar"
|
||||||
onChange={setKomentar}
|
onChange={setKomentar}
|
||||||
value={komentar}
|
value={komentar}
|
||||||
@@ -311,6 +313,7 @@ export default function DiscussionDetail() {
|
|||||||
<Pressable
|
<Pressable
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
komentar != "" &&
|
komentar != "" &&
|
||||||
|
!regexOnlySpacesOrEnter.test(komentar) &&
|
||||||
!loadingSend &&
|
!loadingSend &&
|
||||||
data?.status != 2 &&
|
data?.status != 2 &&
|
||||||
data?.isActive &&
|
data?.isActive &&
|
||||||
@@ -323,12 +326,16 @@ export default function DiscussionDetail() {
|
|||||||
entityUser.role == "cosupadmin") &&
|
entityUser.role == "cosupadmin") &&
|
||||||
handleKomentar();
|
handleKomentar();
|
||||||
}}
|
}}
|
||||||
|
style={[
|
||||||
|
Platform.OS == 'android' && Styles.mb12,
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
<MaterialIcons
|
<MaterialIcons
|
||||||
name="send"
|
name="send"
|
||||||
size={25}
|
size={25}
|
||||||
style={
|
style={
|
||||||
komentar == "" ||
|
[komentar == "" ||
|
||||||
|
regexOnlySpacesOrEnter.test(komentar) ||
|
||||||
loadingSend ||
|
loadingSend ||
|
||||||
data?.status == 2 ||
|
data?.status == 2 ||
|
||||||
data?.isActive == false ||
|
data?.isActive == false ||
|
||||||
@@ -336,7 +343,8 @@ export default function DiscussionDetail() {
|
|||||||
entityUser.role == "coadmin") &&
|
entityUser.role == "coadmin") &&
|
||||||
!isMemberDivision)
|
!isMemberDivision)
|
||||||
? Styles.cGray
|
? Styles.cGray
|
||||||
: Styles.cDefault
|
: Styles.cDefault,
|
||||||
|
]
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|||||||
@@ -56,7 +56,14 @@ export default function CreateDiscussionDivision() {
|
|||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
<InputForm label="Diskusi" type="default" placeholder="Hal yang didiskusikan" required onChange={setDesc} />
|
<InputForm
|
||||||
|
label="Diskusi"
|
||||||
|
type="default"
|
||||||
|
placeholder="Hal yang didiskusikan"
|
||||||
|
required
|
||||||
|
onChange={setDesc}
|
||||||
|
multiline
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import SkeletonContent from "@/components/skeletonContent";
|
|||||||
import Text from "@/components/Text";
|
import Text from "@/components/Text";
|
||||||
import { ConstEnv } from "@/constants/ConstEnv";
|
import { ConstEnv } from "@/constants/ConstEnv";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { apiGetDiscussion } from "@/lib/api";
|
import { apiGetDiscussion, apiGetDivisionOneFeature } from "@/lib/api";
|
||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { AntDesign, Feather, Ionicons } from "@expo/vector-icons";
|
import { AntDesign, Feather, Ionicons } from "@expo/vector-icons";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
@@ -41,6 +41,30 @@ export default function DiscussionDivision() {
|
|||||||
const [waiting, setWaiting] = useState(false)
|
const [waiting, setWaiting] = useState(false)
|
||||||
const [status, setStatus] = useState<'true' | 'false'>('true')
|
const [status, setStatus] = useState<'true' | 'false'>('true')
|
||||||
const [refreshing, setRefreshing] = useState(false)
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
const [isMemberDivision, setIsMemberDivision] = useState(false)
|
||||||
|
const [isAdminDivision, setIsAdminDivision] = useState(false)
|
||||||
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
|
|
||||||
|
async function handleCheckMember() {
|
||||||
|
try {
|
||||||
|
const hasil = await decryptToken(String(token?.current));
|
||||||
|
const response = await apiGetDivisionOneFeature({
|
||||||
|
id,
|
||||||
|
user: hasil,
|
||||||
|
cat: "check-member",
|
||||||
|
});
|
||||||
|
|
||||||
|
const response2 = await apiGetDivisionOneFeature({
|
||||||
|
id,
|
||||||
|
user: hasil,
|
||||||
|
cat: "check-admin",
|
||||||
|
});
|
||||||
|
setIsMemberDivision(response.data);
|
||||||
|
setIsAdminDivision(response2.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleLoad(loading: boolean, thisPage: number) {
|
async function handleLoad(loading: boolean, thisPage: number) {
|
||||||
try {
|
try {
|
||||||
@@ -80,6 +104,10 @@ export default function DiscussionDivision() {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleCheckMember()
|
||||||
|
}, [])
|
||||||
|
|
||||||
const handleRefresh = async () => {
|
const handleRefresh = async () => {
|
||||||
setRefreshing(true)
|
setRefreshing(true)
|
||||||
handleLoad(false, 1)
|
handleLoad(false, 1)
|
||||||
@@ -101,25 +129,29 @@ export default function DiscussionDivision() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[Styles.p15, { flex: 1 }]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<View>
|
{
|
||||||
<View style={[Styles.wrapBtnTab]}>
|
((entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision) &&
|
||||||
<ButtonTab
|
<View>
|
||||||
active={status == "false" ? "false" : "true"}
|
<View style={[Styles.wrapBtnTab]}>
|
||||||
value="true"
|
<ButtonTab
|
||||||
onPress={() => { setStatus("true") }}
|
active={status == "false" ? "false" : "true"}
|
||||||
label="Aktif"
|
value="true"
|
||||||
icon={<Feather name="check-circle" color={status == "false" ? 'black' : 'white'} size={20} />}
|
onPress={() => { setStatus("true") }}
|
||||||
n={2} />
|
label="Aktif"
|
||||||
<ButtonTab
|
icon={<Feather name="check-circle" color={status == "false" ? 'black' : 'white'} size={20} />}
|
||||||
active={status == "false" ? "false" : "true"}
|
n={2} />
|
||||||
value="false"
|
<ButtonTab
|
||||||
onPress={() => { setStatus("false") }}
|
active={status == "false" ? "false" : "true"}
|
||||||
label="Arsip"
|
value="false"
|
||||||
icon={<AntDesign name="closecircleo" color={status == "true" ? 'black' : 'white'} size={20} />}
|
onPress={() => { setStatus("false") }}
|
||||||
n={2} />
|
label="Arsip"
|
||||||
|
icon={<AntDesign name="closecircleo" color={status == "true" ? 'black' : 'white'} size={20} />}
|
||||||
|
n={2} />
|
||||||
|
</View>
|
||||||
|
<InputSearch onChange={setSearch} />
|
||||||
</View>
|
</View>
|
||||||
<InputSearch onChange={setSearch} />
|
}
|
||||||
</View>
|
|
||||||
|
|
||||||
<View style={[{ flex: 2 }, Styles.mt05]}>
|
<View style={[{ flex: 2 }, Styles.mt05]}>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import Styles from "@/constants/Styles";
|
|||||||
import {
|
import {
|
||||||
apiDocumentDelete,
|
apiDocumentDelete,
|
||||||
apiDocumentRename,
|
apiDocumentRename,
|
||||||
|
apiGetDivisionOneFeature,
|
||||||
apiGetDocument,
|
apiGetDocument,
|
||||||
apiShareDocument,
|
apiShareDocument,
|
||||||
} from "@/lib/api";
|
} from "@/lib/api";
|
||||||
@@ -85,6 +86,8 @@ export default function DocumentDivision() {
|
|||||||
const update = useSelector((state: any) => state.dokumenUpdate)
|
const update = useSelector((state: any) => state.dokumenUpdate)
|
||||||
const [refreshing, setRefreshing] = useState(false)
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
const [loadingOpen, setLoadingOpen] = useState(false)
|
const [loadingOpen, setLoadingOpen] = useState(false)
|
||||||
|
const [isMemberDivision, setIsMemberDivision] = useState(false)
|
||||||
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
const [bodyRename, setBodyRename] = useState({
|
const [bodyRename, setBodyRename] = useState({
|
||||||
id: "",
|
id: "",
|
||||||
name: "",
|
name: "",
|
||||||
@@ -93,6 +96,24 @@ export default function DocumentDivision() {
|
|||||||
extension: "",
|
extension: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function handleCheckMember() {
|
||||||
|
try {
|
||||||
|
const hasil = await decryptToken(String(token?.current));
|
||||||
|
const response = await apiGetDivisionOneFeature({
|
||||||
|
id,
|
||||||
|
user: hasil,
|
||||||
|
cat: "check-member",
|
||||||
|
});
|
||||||
|
setIsMemberDivision(response.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleCheckMember()
|
||||||
|
}, [id])
|
||||||
|
|
||||||
async function handleLoad(loading: boolean) {
|
async function handleLoad(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(loading)
|
setLoading(loading)
|
||||||
@@ -347,7 +368,7 @@ export default function DocumentDivision() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<HeaderRightDocument path={path} />
|
<HeaderRightDocument path={path} isMember={isMemberDivision} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -407,6 +428,7 @@ export default function DocumentDivision() {
|
|||||||
: `${item.name}.${item.extension}`
|
: `${item.name}.${item.extension}`
|
||||||
}
|
}
|
||||||
dateTime={item.createdAt}
|
dateTime={item.createdAt}
|
||||||
|
canChecked={(entityUser.role != "user" && entityUser.role != "coadmin") || isMemberDivision}
|
||||||
onChecked={() => {
|
onChecked={() => {
|
||||||
handleCheckboxChange(index);
|
handleCheckboxChange(index);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
|||||||
import { AntDesign } from "@expo/vector-icons";
|
import { AntDesign } from "@expo/vector-icons";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, SafeAreaView, ScrollView, View } from "react-native";
|
import { Pressable, ScrollView, View } from "react-native";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ export default function AddMemberTask() {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
@@ -111,14 +111,14 @@ export default function AddMemberTask() {
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<InputSearch onChange={(val) => setSearch(val)} value={search} />
|
<InputSearch onChange={(val) => setSearch(val)} value={search} />
|
||||||
|
|
||||||
{
|
{
|
||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -135,7 +135,9 @@ export default function AddMemberTask() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
@@ -170,6 +172,6 @@ export default function AddMemberTask() {
|
|||||||
}
|
}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ export default function DetailTaskDivision() {
|
|||||||
<SectionTanggalTugasTask refreshing={refreshing} isMemberDivision={isMemberDivision} />
|
<SectionTanggalTugasTask refreshing={refreshing} isMemberDivision={isMemberDivision} />
|
||||||
<SectionFileTask refreshing={refreshing} isMemberDivision={isMemberDivision} />
|
<SectionFileTask refreshing={refreshing} isMemberDivision={isMemberDivision} />
|
||||||
<SectionLinkTask refreshing={refreshing} isMemberDivision={isMemberDivision} />
|
<SectionLinkTask refreshing={refreshing} isMemberDivision={isMemberDivision} />
|
||||||
<SectionMemberTask refreshing={refreshing} isMemberDivision={isMemberDivision} />
|
<SectionMemberTask refreshing={refreshing} isAdminDivision={isAdminDivision} />
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
|||||||
import { AntDesign } from "@expo/vector-icons";
|
import { AntDesign } from "@expo/vector-icons";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, SafeAreaView, ScrollView, View } from "react-native";
|
import { Pressable, ScrollView, View } from "react-native";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ export default function AddMemberCreateTask() {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
@@ -81,14 +81,14 @@ export default function AddMemberCreateTask() {
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<InputSearch onChange={(val) => setSearch(val)} value={search} />
|
<InputSearch onChange={(val) => setSearch(val)} value={search} />
|
||||||
|
|
||||||
{
|
{
|
||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -105,7 +105,9 @@ export default function AddMemberCreateTask() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
@@ -136,6 +138,6 @@ export default function AddMemberCreateTask() {
|
|||||||
}
|
}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -99,14 +99,18 @@ export default function CreateTaskAddTugas() {
|
|||||||
timeStart: item.timeStart,
|
timeStart: item.timeStart,
|
||||||
timeEnd: item.timeEnd,
|
timeEnd: item.timeEnd,
|
||||||
}))
|
}))
|
||||||
dispatch(setTaskCreate([...taskCreate, {
|
const hasilOrder = [...taskCreate, {
|
||||||
title: title,
|
title: title,
|
||||||
dateStart: from,
|
dateStart: from,
|
||||||
dateEnd: to,
|
dateEnd: to,
|
||||||
dateStartFix: formatDateOnly(range.startDate, "YYYY-MM-DD"),
|
dateStartFix: formatDateOnly(range.startDate, "YYYY-MM-DD"),
|
||||||
dateEndFix: formatDateOnly(range.endDate, "YYYY-MM-DD"),
|
dateEndFix: formatDateOnly(range.endDate, "YYYY-MM-DD"),
|
||||||
dataDetail: dataDetailFix
|
dataDetail: dataDetailFix
|
||||||
}]))
|
}].sort((a, b) => {
|
||||||
|
return new Date(a.dateStartFix).getTime() - new Date(b.dateStartFix).getTime();
|
||||||
|
});
|
||||||
|
|
||||||
|
dispatch(setTaskCreate(hasilOrder))
|
||||||
router.back();
|
router.back();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default function ListTask() {
|
|||||||
return (
|
return (
|
||||||
<View style={[Styles.p15, { flex: 1 }]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10]}>
|
<ScrollView horizontal style={[Styles.mb10]} showsHorizontalScrollIndicator={false}>
|
||||||
<ButtonTab
|
<ButtonTab
|
||||||
active={statusFix}
|
active={statusFix}
|
||||||
value="0"
|
value="0"
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ export default function AddMemberDivision() {
|
|||||||
setData(responsemember.data.filter((i: any) => i.idUserRole != 'supadmin'))
|
setData(responsemember.data.filter((i: any) => i.idUserRole != 'supadmin'))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +97,7 @@ export default function AddMemberDivision() {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
@@ -112,14 +114,14 @@ export default function AddMemberDivision() {
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<InputSearch onChange={(val) => handleSearch(val)} value={search} />
|
<InputSearch onChange={(val) => handleSearch(val)} value={search} />
|
||||||
|
|
||||||
{
|
{
|
||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -136,7 +138,9 @@ export default function AddMemberDivision() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
@@ -171,6 +175,6 @@ export default function AddMemberDivision() {
|
|||||||
}
|
}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ import { apiGetDivisionOneDetail } from "@/lib/api"
|
|||||||
import { useAuthSession } from "@/providers/AuthProvider"
|
import { useAuthSession } from "@/providers/AuthProvider"
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router"
|
import { router, Stack, useLocalSearchParams } from "expo-router"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { SafeAreaView, ScrollView, View } from "react-native"
|
import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native"
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
id: string,
|
id: string,
|
||||||
@@ -26,11 +26,12 @@ export default function DetailDivisionFitur() {
|
|||||||
const { id } = useLocalSearchParams<{ id: string }>()
|
const { id } = useLocalSearchParams<{ id: string }>()
|
||||||
const [data, setData] = useState<Props>()
|
const [data, setData] = useState<Props>()
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDivisionOneDetail({ user: hasil, id })
|
const response = await apiGetDivisionOneDetail({ user: hasil, id })
|
||||||
setData(response.data.division)
|
setData(response.data.division)
|
||||||
@@ -42,9 +43,16 @@ export default function DetailDivisionFitur() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad()
|
handleLoad(true)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
handleLoad(false)
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -55,13 +63,21 @@ export default function DetailDivisionFitur() {
|
|||||||
headerRight: () => <HeaderRightDivisionDetail id={id} />,
|
headerRight: () => <HeaderRightDivisionDetail id={id} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
<CaraouselHome />
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
<CaraouselHome refreshing={refreshing} />
|
||||||
<View style={[Styles.ph15, Styles.mb100]}>
|
<View style={[Styles.ph15, Styles.mb100]}>
|
||||||
<FiturDivisionDetail />
|
<FiturDivisionDetail refreshing={refreshing}/>
|
||||||
<TaskDivisionDetail />
|
<TaskDivisionDetail refreshing={refreshing}/>
|
||||||
<FileDivisionDetail />
|
<FileDivisionDetail refreshing={refreshing}/>
|
||||||
<DiscussionDivisionDetail />
|
<DiscussionDivisionDetail refreshing={refreshing}/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ import Text from "@/components/Text"
|
|||||||
import { ColorsStatus } from "@/constants/ColorsStatus"
|
import { ColorsStatus } from "@/constants/ColorsStatus"
|
||||||
import { ConstEnv } from "@/constants/ConstEnv"
|
import { ConstEnv } from "@/constants/ConstEnv"
|
||||||
import Styles from "@/constants/Styles"
|
import Styles from "@/constants/Styles"
|
||||||
import { apiDeleteMemberDivision, apiGetDivisionOneDetail, apiUpdateStatusAdminDivision } from "@/lib/api"
|
import { apiDeleteMemberDivision, apiGetDivisionOneDetail, apiGetDivisionOneFeature, apiUpdateStatusAdminDivision } from "@/lib/api"
|
||||||
import { useAuthSession } from "@/providers/AuthProvider"
|
import { useAuthSession } from "@/providers/AuthProvider"
|
||||||
import { Feather, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
|
import { Feather, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router"
|
import { router, Stack, useLocalSearchParams } from "expo-router"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { Pressable, SafeAreaView, ScrollView, View } from "react-native"
|
import { Pressable, RefreshControl, SafeAreaView, ScrollView, View } from "react-native"
|
||||||
import Toast from "react-native-toast-message"
|
import Toast from "react-native-toast-message"
|
||||||
import { useSelector } from "react-redux"
|
import { useSelector } from "react-redux"
|
||||||
|
|
||||||
@@ -39,6 +39,8 @@ type PropsMember = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function InformationDivision() {
|
export default function InformationDivision() {
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
const { id } = useLocalSearchParams<{ id: string }>()
|
const { id } = useLocalSearchParams<{ id: string }>()
|
||||||
const [isModal, setModal] = useState(false)
|
const [isModal, setModal] = useState(false)
|
||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
@@ -48,6 +50,8 @@ export default function InformationDivision() {
|
|||||||
const update = useSelector((state: any) => state.divisionUpdate)
|
const update = useSelector((state: any) => state.divisionUpdate)
|
||||||
const arrSkeleton = Array.from({ length: 5 }, (_, index) => index)
|
const arrSkeleton = Array.from({ length: 5 }, (_, index) => index)
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
const [isMemberDivision, setIsMemberDivision] = useState(false)
|
||||||
|
const [isAdminDivision, setIsAdminDivision] = useState(false)
|
||||||
const [dataMemberChoose, setDataMemberChoose] = useState({
|
const [dataMemberChoose, setDataMemberChoose] = useState({
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
@@ -113,12 +117,42 @@ export default function InformationDivision() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
handleLoad(false)
|
||||||
|
handleCheckMember()
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
|
async function handleCheckMember() {
|
||||||
|
try {
|
||||||
|
const hasil = await decryptToken(String(token?.current));
|
||||||
|
const response = await apiGetDivisionOneFeature({
|
||||||
|
id,
|
||||||
|
user: hasil,
|
||||||
|
cat: "check-member",
|
||||||
|
});
|
||||||
|
|
||||||
|
const response2 = await apiGetDivisionOneFeature({
|
||||||
|
id,
|
||||||
|
user: hasil,
|
||||||
|
cat: "check-admin",
|
||||||
|
});
|
||||||
|
setIsMemberDivision(response.data);
|
||||||
|
setIsAdminDivision(response2.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad(false)
|
handleLoad(false)
|
||||||
}, [refresh, update])
|
}, [refresh, update])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad(true)
|
handleLoad(true)
|
||||||
|
handleCheckMember()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
function handleChooseMember(item: PropsMember) {
|
function handleChooseMember(item: PropsMember) {
|
||||||
@@ -133,10 +167,18 @@ export default function InformationDivision() {
|
|||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
headerTitle: 'Informasi Divisi',
|
headerTitle: 'Informasi Divisi',
|
||||||
headerTitleAlign: 'center',
|
headerTitleAlign: 'center',
|
||||||
headerRight: () => <HeaderRightDivisionInfo id={id} active={dataDetail?.isActive} />,
|
headerRight: () => ((entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision) && <HeaderRightDivisionInfo id={id} active={dataDetail?.isActive} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView style={[Styles.h100]}>
|
<ScrollView
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15]}>
|
||||||
{
|
{
|
||||||
dataDetail?.isActive == false && (
|
dataDetail?.isActive == false && (
|
||||||
@@ -161,6 +203,7 @@ export default function InformationDivision() {
|
|||||||
<Text style={[Styles.textDefault, Styles.mv05]}>{dataMember.length} Anggota</Text>
|
<Text style={[Styles.textDefault, Styles.mv05]}>{dataMember.length} Anggota</Text>
|
||||||
<View style={[Styles.wrapPaper]}>
|
<View style={[Styles.wrapPaper]}>
|
||||||
{
|
{
|
||||||
|
((entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision) &&
|
||||||
dataDetail?.isActive && (
|
dataDetail?.isActive && (
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
onPress={() => { router.push(`/division/${id}/add-member`) }}
|
onPress={() => { router.push(`/division/${id}/add-member`) }}
|
||||||
@@ -188,7 +231,7 @@ export default function InformationDivision() {
|
|||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
key={index}
|
key={index}
|
||||||
borderType="bottom"
|
borderType="bottom"
|
||||||
onPress={() => { dataDetail?.isActive && handleChooseMember(item) }}
|
onPress={() => { dataDetail?.isActive && (isAdminDivision || (entityUser.role != "user" && entityUser.role != "coadmin")) && handleChooseMember(item) }}
|
||||||
icon={
|
icon={
|
||||||
<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} size="sm" />
|
<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} size="sm" />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
|
import AlertKonfirmasi from "@/components/alertKonfirmasi";
|
||||||
import ButtonBackHeader from "@/components/buttonBackHeader";
|
import ButtonBackHeader from "@/components/buttonBackHeader";
|
||||||
import ButtonNextHeader from "@/components/buttonNextHeader";
|
import ButtonNextHeader from "@/components/buttonNextHeader";
|
||||||
import { InputForm } from "@/components/inputForm";
|
import { InputForm } from "@/components/inputForm";
|
||||||
import ModalSelect from "@/components/modalSelect";
|
import ModalSelect from "@/components/modalSelect";
|
||||||
import SelectForm from "@/components/selectForm";
|
import SelectForm from "@/components/selectForm";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
|
import { apiCheckDivisionName } from "@/lib/api";
|
||||||
import { setFormCreateDivision } from "@/lib/divisionCreate";
|
import { setFormCreateDivision } from "@/lib/divisionCreate";
|
||||||
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { SafeAreaView, ScrollView, View } from "react-native";
|
import { SafeAreaView, ScrollView, View } from "react-native";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
export default function CreateDivision() {
|
export default function CreateDivision() {
|
||||||
const [isSelect, setSelect] = useState(false);
|
const { token, decryptToken } = useAuthSession()
|
||||||
const [chooseGroup, setChooseGroup] = useState({ val: "", label: "" });
|
const [isSelect, setSelect] = useState(false)
|
||||||
const dispatch = useDispatch();
|
const [chooseGroup, setChooseGroup] = useState({ val: "", label: "" })
|
||||||
const update = useSelector((state: any) => state.divisionCreate);
|
const dispatch = useDispatch()
|
||||||
|
const update = useSelector((state: any) => state.divisionCreate)
|
||||||
const entityUser = useSelector((state: any) => state.user)
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
const userLogin = useSelector((state: any) => state.entities)
|
const userLogin = useSelector((state: any) => state.entities)
|
||||||
|
const [loadingBtn, setLoadingBtn] = useState(false)
|
||||||
const [error, setError] = useState({
|
const [error, setError] = useState({
|
||||||
idGroup: false,
|
idGroup: false,
|
||||||
name: false,
|
name: false,
|
||||||
@@ -54,7 +60,35 @@ export default function CreateDivision() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSetData() {
|
async function handleCheckName() {
|
||||||
|
try {
|
||||||
|
setLoadingBtn(true)
|
||||||
|
const hasil = await decryptToken(String(token?.current))
|
||||||
|
const response = await apiCheckDivisionName({ data: { ...dataForm }, user: hasil })
|
||||||
|
if (response.success) {
|
||||||
|
if (!response.available) {
|
||||||
|
AlertKonfirmasi({
|
||||||
|
title: 'Peringatan',
|
||||||
|
desc: 'Nama divisi sudah ada. Apakah anda yakin ingin membuat divisi dengan nama yang sama?',
|
||||||
|
onPress: () => {
|
||||||
|
handleSetData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
handleSetData()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.show({ type: 'small', text1: response.message, })
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoadingBtn(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleSetData() {
|
||||||
dispatch(setFormCreateDivision({ ...update, data: dataForm }))
|
dispatch(setFormCreateDivision({ ...update, data: dataForm }))
|
||||||
router.push(`./create/add-member`)
|
router.push(`./create/add-member`)
|
||||||
}
|
}
|
||||||
@@ -80,8 +114,8 @@ export default function CreateDivision() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonNextHeader
|
<ButtonNextHeader
|
||||||
onPress={() => { handleSetData() }}
|
onPress={() => { handleCheckName() }}
|
||||||
disable={error.idGroup || error.name || chooseGroup.val == "" || chooseGroup.val == "null" || dataForm.name == "" || dataForm.name == "null"}
|
disable={loadingBtn || error.idGroup || error.name || chooseGroup.val == "" || chooseGroup.val == "null" || dataForm.name == "" || dataForm.name == "null"}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { setFormCreateDivision } from "@/lib/divisionCreate";
|
|||||||
import { setUpdateDivision } from "@/lib/divisionUpdate";
|
import { setUpdateDivision } from "@/lib/divisionUpdate";
|
||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { AntDesign } from "@expo/vector-icons";
|
import { AntDesign } from "@expo/vector-icons";
|
||||||
|
import { StackActions, useNavigation } from "@react-navigation/native";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, SafeAreaView, ScrollView, View } from "react-native";
|
import { Pressable, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
@@ -23,6 +24,7 @@ type Props = {
|
|||||||
|
|
||||||
export default function CreateDivisionAddAdmin() {
|
export default function CreateDivisionAddAdmin() {
|
||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
|
const navigation = useNavigation()
|
||||||
const { id } = useLocalSearchParams<{ id: string }>()
|
const { id } = useLocalSearchParams<{ id: string }>()
|
||||||
const [dataOld, setDataOld] = useState<Props[]>([])
|
const [dataOld, setDataOld] = useState<Props[]>([])
|
||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
@@ -57,7 +59,8 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
Toast.show({ type: 'small', text1: 'Berhasil membuat divisi', })
|
Toast.show({ type: 'small', text1: 'Berhasil membuat divisi', })
|
||||||
dispatch(setFormCreateDivision({ admin: [], member: [], data: { idGroup: '', name: '', desc: '' } }))
|
dispatch(setFormCreateDivision({ admin: [], member: [], data: { idGroup: '', name: '', desc: '' } }))
|
||||||
dispatch(setUpdateDivision(!updateDivision))
|
dispatch(setUpdateDivision(!updateDivision))
|
||||||
router.replace(`/division/`)
|
navigation.dispatch(StackActions.pop(3))
|
||||||
|
// router.replace(`/division/`)
|
||||||
} else {
|
} else {
|
||||||
Toast.show({ type: 'small', text1: response.message, })
|
Toast.show({ type: 'small', text1: response.message, })
|
||||||
}
|
}
|
||||||
@@ -71,7 +74,7 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
@@ -88,7 +91,7 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
@@ -123,6 +126,6 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
}
|
}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
|||||||
import { AntDesign } from "@expo/vector-icons";
|
import { AntDesign } from "@expo/vector-icons";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, SafeAreaView, ScrollView, View } from "react-native";
|
import { Pressable, ScrollView, View } from "react-native";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -60,7 +60,7 @@ export default function CreateDivisionAddMember() {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
@@ -74,14 +74,14 @@ export default function CreateDivisionAddMember() {
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<InputSearch onChange={(val) => setSearch(val)} value={search} />
|
<InputSearch onChange={(val) => setSearch(val)} value={search} />
|
||||||
|
|
||||||
{
|
{
|
||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -98,7 +98,9 @@ export default function CreateDivisionAddMember() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
@@ -133,6 +135,6 @@ export default function CreateDivisionAddMember() {
|
|||||||
}
|
}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -8,13 +8,17 @@ import { ConstEnv } from "@/constants/ConstEnv";
|
|||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { apiEditProfile, apiGetProfile } from "@/lib/api";
|
import { apiEditProfile, apiGetProfile } from "@/lib/api";
|
||||||
import { setEntities } from "@/lib/entitiesSlice";
|
import { setEntities } from "@/lib/entitiesSlice";
|
||||||
|
import { validateName } from "@/lib/fun_validateName";
|
||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||||
|
import { useHeaderHeight } from "@react-navigation/elements";
|
||||||
import * as ImagePicker from "expo-image-picker";
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
Image,
|
Image,
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
Pressable,
|
Pressable,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
@@ -37,6 +41,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function EditProfile() {
|
export default function EditProfile() {
|
||||||
|
const headerHeight = useHeaderHeight()
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const entities = useSelector((state: any) => state.entities)
|
const entities = useSelector((state: any) => state.entities)
|
||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
@@ -105,7 +110,7 @@ export default function EditProfile() {
|
|||||||
}
|
}
|
||||||
} else if (cat == "name") {
|
} else if (cat == "name") {
|
||||||
setData({ ...data, name: val });
|
setData({ ...data, name: val });
|
||||||
if (val == "") {
|
if (!validateName(val)) {
|
||||||
setError({ ...error, name: true });
|
setError({ ...error, name: true });
|
||||||
} else {
|
} else {
|
||||||
setError({ ...error, name: false });
|
setError({ ...error, name: false });
|
||||||
@@ -160,8 +165,8 @@ export default function EditProfile() {
|
|||||||
if (imgForm != undefined) {
|
if (imgForm != undefined) {
|
||||||
fd.append("file", {
|
fd.append("file", {
|
||||||
uri: imgForm.uri,
|
uri: imgForm.uri,
|
||||||
type: imgForm.mimeType,
|
type: imgForm.mimeType || "image/jpeg",
|
||||||
name: imgForm.fileName,
|
name: imgForm.fileName || "image.jpg",
|
||||||
} as any);
|
} as any);
|
||||||
} else {
|
} else {
|
||||||
fd.append("file", "undefined",);
|
fd.append("file", "undefined",);
|
||||||
@@ -193,9 +198,9 @@ export default function EditProfile() {
|
|||||||
const pickImageAsync = async () => {
|
const pickImageAsync = async () => {
|
||||||
let result = await ImagePicker.launchImageLibraryAsync({
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
mediaTypes: ["images"],
|
mediaTypes: ["images"],
|
||||||
allowsEditing: false,
|
allowsEditing: true,
|
||||||
quality: 1,
|
quality: 0.9,
|
||||||
aspect: [1, 1],
|
aspect: [1, 1]
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
@@ -231,116 +236,122 @@ export default function EditProfile() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView style={[Styles.h100]}>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15]}>
|
style={[Styles.h100]}
|
||||||
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
{
|
keyboardVerticalOffset={headerHeight}
|
||||||
selectedImage != undefined ? (
|
>
|
||||||
<Pressable onPress={pickImageAsync}>
|
<ScrollView showsVerticalScrollIndicator={false}>
|
||||||
<Image
|
<View style={[Styles.p15]}>
|
||||||
src={
|
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
||||||
typeof selectedImage === "string"
|
{
|
||||||
? selectedImage
|
selectedImage != undefined ? (
|
||||||
: selectedImage.uri
|
<Pressable onPress={pickImageAsync}>
|
||||||
}
|
<Image
|
||||||
style={[Styles.userProfileBig]}
|
src={
|
||||||
onError={() => { setErrorImg(true) }}
|
typeof selectedImage === "string"
|
||||||
/>
|
? selectedImage
|
||||||
<View style={[Styles.absoluteIconPicker]}>
|
: selectedImage.uri
|
||||||
<MaterialCommunityIcons name="image" color={'white'} size={15} />
|
}
|
||||||
</View>
|
style={[Styles.userProfileBig]}
|
||||||
</Pressable>
|
onError={() => { setErrorImg(true) }}
|
||||||
) : (
|
/>
|
||||||
<Pressable onPress={pickImageAsync}>
|
<View style={[Styles.absoluteIconPicker]}>
|
||||||
<Image
|
<MaterialCommunityIcons name="image" color={'white'} size={15} />
|
||||||
source={errorImg ? require("../../assets/images/user.jpg") : { uri: `${ConstEnv.url_storage}/files/${data?.img}` }}
|
</View>
|
||||||
style={[Styles.userProfileBig]}
|
</Pressable>
|
||||||
onError={() => { setErrorImg(true) }}
|
) : (
|
||||||
/>
|
<Pressable onPress={pickImageAsync}>
|
||||||
<View style={[Styles.absoluteIconPicker]}>
|
<Image
|
||||||
<MaterialCommunityIcons name="image" color={'white'} size={15} />
|
source={errorImg ? require("../../assets/images/user.jpg") : { uri: `${ConstEnv.url_storage}/files/${data?.img}` }}
|
||||||
</View>
|
style={[Styles.userProfileBig]}
|
||||||
</Pressable>
|
onError={() => { setErrorImg(true) }}
|
||||||
)
|
/>
|
||||||
}
|
<View style={[Styles.absoluteIconPicker]}>
|
||||||
|
<MaterialCommunityIcons name="image" color={'white'} size={15} />
|
||||||
|
</View>
|
||||||
|
</Pressable>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<SelectForm
|
||||||
|
label="Jabatan"
|
||||||
|
placeholder="Pilih Jabatan"
|
||||||
|
value={choosePosition.label}
|
||||||
|
required
|
||||||
|
onPress={() => {
|
||||||
|
setValChoose(choosePosition.val);
|
||||||
|
setValSelect("position");
|
||||||
|
setSelect(true);
|
||||||
|
}}
|
||||||
|
error={error.position}
|
||||||
|
errorText="Jabatan tidak boleh kosong"
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="NIK"
|
||||||
|
type="numeric"
|
||||||
|
placeholder="NIK"
|
||||||
|
required
|
||||||
|
value={data?.nik}
|
||||||
|
error={error.nik}
|
||||||
|
errorText="NIK Harus 16 Karakter"
|
||||||
|
onChange={val => {
|
||||||
|
validationForm("nik", val)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="Nama"
|
||||||
|
type="default"
|
||||||
|
placeholder="Nama"
|
||||||
|
required
|
||||||
|
value={data?.name}
|
||||||
|
error={error.name}
|
||||||
|
errorText="Nama harus 3–50 karakter (huruf, angka, spasi, dan simbol ringan (. , ' _ -))"
|
||||||
|
onChange={val => {
|
||||||
|
validationForm("name", val)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="Email"
|
||||||
|
type="default"
|
||||||
|
placeholder="Email"
|
||||||
|
required
|
||||||
|
value={data?.email}
|
||||||
|
error={error.email}
|
||||||
|
errorText="Email tidak valid"
|
||||||
|
onChange={val => {
|
||||||
|
validationForm("email", val)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="Nomor Telepon"
|
||||||
|
type="numeric"
|
||||||
|
placeholder="8XX-XXX-XXX"
|
||||||
|
required
|
||||||
|
itemLeft={<Text>+62</Text>}
|
||||||
|
value={data?.phone}
|
||||||
|
error={error.phone}
|
||||||
|
errorText="Nomor Telepon tidak valid"
|
||||||
|
onChange={val => {
|
||||||
|
validationForm("phone", val)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<SelectForm
|
||||||
|
label="Jenis Kelamin"
|
||||||
|
placeholder="Pilih Jenis Kelamin"
|
||||||
|
value={chooseGender.label}
|
||||||
|
required
|
||||||
|
onPress={() => {
|
||||||
|
setValChoose(chooseGender.val);
|
||||||
|
setValSelect("gender");
|
||||||
|
setSelect(true);
|
||||||
|
}}
|
||||||
|
error={error.gender}
|
||||||
|
errorText="Jenis Kelamin tidak boleh kosong"
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
<SelectForm
|
</ScrollView>
|
||||||
label="Jabatan"
|
</KeyboardAvoidingView>
|
||||||
placeholder="Pilih Jabatan"
|
|
||||||
value={choosePosition.label}
|
|
||||||
required
|
|
||||||
onPress={() => {
|
|
||||||
setValChoose(choosePosition.val);
|
|
||||||
setValSelect("position");
|
|
||||||
setSelect(true);
|
|
||||||
}}
|
|
||||||
error={error.position}
|
|
||||||
errorText="Jabatan tidak boleh kosong"
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="NIK"
|
|
||||||
type="numeric"
|
|
||||||
placeholder="NIK"
|
|
||||||
required
|
|
||||||
value={data?.nik}
|
|
||||||
error={error.nik}
|
|
||||||
errorText="NIK Harus 16 Karakter"
|
|
||||||
onChange={val => {
|
|
||||||
validationForm("nik", val)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="Nama"
|
|
||||||
type="default"
|
|
||||||
placeholder="Nama"
|
|
||||||
required
|
|
||||||
value={data?.name}
|
|
||||||
error={error.name}
|
|
||||||
errorText="Nama tidak boleh kosong"
|
|
||||||
onChange={val => {
|
|
||||||
validationForm("name", val)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="Email"
|
|
||||||
type="default"
|
|
||||||
placeholder="Email"
|
|
||||||
required
|
|
||||||
value={data?.email}
|
|
||||||
error={error.email}
|
|
||||||
errorText="Email tidak valid"
|
|
||||||
onChange={val => {
|
|
||||||
validationForm("email", val)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="Nomor Telepon"
|
|
||||||
type="numeric"
|
|
||||||
placeholder="8XX-XXX-XXX"
|
|
||||||
required
|
|
||||||
itemLeft={<Text>+62</Text>}
|
|
||||||
value={data?.phone}
|
|
||||||
error={error.phone}
|
|
||||||
errorText="Nomor Telepon tidak valid"
|
|
||||||
onChange={val => {
|
|
||||||
validationForm("phone", val)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<SelectForm
|
|
||||||
label="Jenis Kelamin"
|
|
||||||
placeholder="Pilih Jenis Kelamin"
|
|
||||||
value={chooseGender.label}
|
|
||||||
required
|
|
||||||
onPress={() => {
|
|
||||||
setValChoose(chooseGender.val);
|
|
||||||
setValSelect("gender");
|
|
||||||
setSelect(true);
|
|
||||||
}}
|
|
||||||
error={error.gender}
|
|
||||||
errorText="Jenis Kelamin tidak boleh kosong"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<ModalSelect
|
<ModalSelect
|
||||||
category={valSelect}
|
category={valSelect}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import { apiGetProfile } from "@/lib/api";
|
|||||||
import { setEntities } from "@/lib/entitiesSlice";
|
import { setEntities } from "@/lib/entitiesSlice";
|
||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
import { useEffect } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Platform, SafeAreaView, ScrollView, View } from "react-native";
|
import { Platform, RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
@@ -24,6 +24,7 @@ export default function Home() {
|
|||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const { token, decryptToken, signOut } = useAuthSession()
|
const { token, decryptToken, signOut } = useAuthSession()
|
||||||
const insets = useSafeAreaInsets()
|
const insets = useSafeAreaInsets()
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleUserLogin()
|
handleUserLogin()
|
||||||
@@ -38,6 +39,13 @@ export default function Home() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
handleUserLogin()
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -52,16 +60,24 @@ export default function Home() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
<CaraouselHome />
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
<CaraouselHome refreshing={refreshing}/>
|
||||||
<View style={[Styles.ph15, Styles.mb100]}>
|
<View style={[Styles.ph15, Styles.mb100]}>
|
||||||
<FiturHome />
|
<FiturHome />
|
||||||
<ProjectHome />
|
<ProjectHome refreshing={refreshing}/>
|
||||||
<DivisionHome />
|
<DivisionHome refreshing={refreshing}/>
|
||||||
<ChartProgresHome />
|
<ChartProgresHome refreshing={refreshing}/>
|
||||||
<ChartDokumenHome />
|
<ChartDokumenHome refreshing={refreshing}/>
|
||||||
<EventHome />
|
<EventHome refreshing={refreshing}/>
|
||||||
<DisccussionHome />
|
<DisccussionHome refreshing={refreshing}/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import Text from "@/components/Text";
|
|||||||
import { ColorsStatus } from "@/constants/ColorsStatus";
|
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { apiCreateUser } from "@/lib/api";
|
import { apiCreateUser } from "@/lib/api";
|
||||||
|
import { validateName } from "@/lib/fun_validateName";
|
||||||
import { setUpdateMember } from "@/lib/memberSlice";
|
import { setUpdateMember } from "@/lib/memberSlice";
|
||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||||
@@ -100,7 +101,7 @@ export default function CreateMember() {
|
|||||||
}
|
}
|
||||||
} else if (cat == "name") {
|
} else if (cat == "name") {
|
||||||
setDataForm({ ...dataForm, name: val });
|
setDataForm({ ...dataForm, name: val });
|
||||||
if (val == "") {
|
if (!validateName(val)) {
|
||||||
setError({ ...error, name: true });
|
setError({ ...error, name: true });
|
||||||
} else {
|
} else {
|
||||||
setError({ ...error, name: false });
|
setError({ ...error, name: false });
|
||||||
@@ -166,8 +167,8 @@ export default function CreateMember() {
|
|||||||
if (imgForm != undefined) {
|
if (imgForm != undefined) {
|
||||||
fd.append("file", {
|
fd.append("file", {
|
||||||
uri: imgForm.uri,
|
uri: imgForm.uri,
|
||||||
type: imgForm.mimeType,
|
type: imgForm.mimeType || "image/jpeg",
|
||||||
name: imgForm.fileName,
|
name: imgForm.fileName || "image.jpg",
|
||||||
} as any)
|
} as any)
|
||||||
} else {
|
} else {
|
||||||
fd.append("file", "undefined")
|
fd.append("file", "undefined")
|
||||||
@@ -193,9 +194,9 @@ export default function CreateMember() {
|
|||||||
const pickImageAsync = async () => {
|
const pickImageAsync = async () => {
|
||||||
let result = await ImagePicker.launchImageLibraryAsync({
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
mediaTypes: ["images"],
|
mediaTypes: ["images"],
|
||||||
allowsEditing: false,
|
allowsEditing: true,
|
||||||
quality: 1,
|
quality: 0.9,
|
||||||
aspect: [1, 1],
|
aspect: [1, 1]
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
@@ -231,7 +232,7 @@ export default function CreateMember() {
|
|||||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
keyboardVerticalOffset={headerHeight}
|
keyboardVerticalOffset={headerHeight}
|
||||||
>
|
>
|
||||||
<ScrollView>
|
<ScrollView showsVerticalScrollIndicator={false}>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15]}>
|
||||||
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
||||||
{selectedImage != undefined ? (
|
{selectedImage != undefined ? (
|
||||||
@@ -309,7 +310,7 @@ export default function CreateMember() {
|
|||||||
placeholder="Nama"
|
placeholder="Nama"
|
||||||
required
|
required
|
||||||
error={error.name}
|
error={error.name}
|
||||||
errorText="Nama tidak boleh kosong"
|
errorText="Nama harus 3–50 karakter (huruf, angka, spasi, dan simbol ringan (. , ' _ -))"
|
||||||
onChange={val => {
|
onChange={val => {
|
||||||
validationForm("name", val)
|
validationForm("name", val)
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import Text from "@/components/Text";
|
|||||||
import { ConstEnv } from "@/constants/ConstEnv";
|
import { ConstEnv } from "@/constants/ConstEnv";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { apiEditUser, apiGetProfile } from "@/lib/api";
|
import { apiEditUser, apiGetProfile } from "@/lib/api";
|
||||||
|
import { validateName } from "@/lib/fun_validateName";
|
||||||
import { setUpdateMember } from "@/lib/memberSlice";
|
import { setUpdateMember } from "@/lib/memberSlice";
|
||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||||
@@ -132,7 +133,7 @@ export default function EditMember() {
|
|||||||
}
|
}
|
||||||
} else if (cat == "name") {
|
} else if (cat == "name") {
|
||||||
setData({ ...data, name: val });
|
setData({ ...data, name: val });
|
||||||
if (val == "") {
|
if (!validateName(val)) {
|
||||||
setError({ ...error, name: true });
|
setError({ ...error, name: true });
|
||||||
} else {
|
} else {
|
||||||
setError({ ...error, name: false });
|
setError({ ...error, name: false });
|
||||||
@@ -187,8 +188,8 @@ export default function EditMember() {
|
|||||||
if (imgForm != undefined) {
|
if (imgForm != undefined) {
|
||||||
fd.append("file", {
|
fd.append("file", {
|
||||||
uri: imgForm.uri,
|
uri: imgForm.uri,
|
||||||
type: imgForm.mimeType,
|
type: imgForm.mimeType || "image/jpeg",
|
||||||
name: imgForm.fileName,
|
name: imgForm.fileName || "image.jpg",
|
||||||
} as any);
|
} as any);
|
||||||
} else {
|
} else {
|
||||||
fd.append("file", "undefined",);
|
fd.append("file", "undefined",);
|
||||||
@@ -220,9 +221,9 @@ export default function EditMember() {
|
|||||||
const pickImageAsync = async () => {
|
const pickImageAsync = async () => {
|
||||||
let result = await ImagePicker.launchImageLibraryAsync({
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
mediaTypes: ["images"],
|
mediaTypes: ["images"],
|
||||||
allowsEditing: false,
|
allowsEditing: true,
|
||||||
quality: 1,
|
quality: 0.9,
|
||||||
aspect: [1, 1],
|
aspect: [1, 1]
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
@@ -264,8 +265,8 @@ export default function EditMember() {
|
|||||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
keyboardVerticalOffset={headerHeight}
|
keyboardVerticalOffset={headerHeight}
|
||||||
>
|
>
|
||||||
<ScrollView>
|
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15]}>
|
||||||
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
||||||
{
|
{
|
||||||
errorImg ?
|
errorImg ?
|
||||||
@@ -348,7 +349,7 @@ export default function EditMember() {
|
|||||||
required
|
required
|
||||||
value={data?.name}
|
value={data?.name}
|
||||||
error={error.name}
|
error={error.name}
|
||||||
errorText="Nama tidak boleh kosong"
|
errorText="Nama harus 3–50 karakter (huruf, angka, spasi, dan simbol ringan (. , ' _ -))"
|
||||||
onChange={val => {
|
onChange={val => {
|
||||||
validationForm("name", val)
|
validationForm("name", val)
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { pushToPage } from "@/lib/pushToPage";
|
|||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { Feather } from "@expo/vector-icons";
|
import { Feather } from "@expo/vector-icons";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { SafeAreaView, View, VirtualizedList } from "react-native";
|
import { RefreshControl, SafeAreaView, View, VirtualizedList } from "react-native";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -31,6 +31,7 @@ export default function Notification() {
|
|||||||
const arrSkeleton = Array.from({ length: 5 }, (_, index) => index)
|
const arrSkeleton = Array.from({ length: 5 }, (_, index) => index)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const updateNotification = useSelector((state: any) => state.notificationUpdate)
|
const updateNotification = useSelector((state: any) => state.notificationUpdate)
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
async function handleLoad(loading: boolean, thisPage: number) {
|
async function handleLoad(loading: boolean, thisPage: number) {
|
||||||
try {
|
try {
|
||||||
@@ -88,33 +89,12 @@ export default function Notification() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// function pushToPage(category: string, idContent: string) {
|
const handleRefresh = async () => {
|
||||||
// const cat = category.split('/')
|
setRefreshing(true)
|
||||||
// if (cat.length > 1) {
|
handleLoad(false, 1)
|
||||||
// if (cat[2] == 'calendar') {
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
// router.push(`/division/${cat[1]}/calendar/${idContent}`)
|
setRefreshing(false)
|
||||||
// } else if (cat[2] == 'discussion') {
|
};
|
||||||
// router.push(`/division/${cat[1]}/discussion/${idContent}`)
|
|
||||||
// } else if (cat[2] == 'document') {
|
|
||||||
// router.push(`/division/${cat[1]}/document/${idContent}`)
|
|
||||||
// } else if (cat[2] == 'task') {
|
|
||||||
// router.push(`/division/${cat[1]}/task/${idContent}`)
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// if (cat[0] == 'announcement') {
|
|
||||||
// router.push(`/announcement/${idContent}`)
|
|
||||||
// } else if (cat[0] == 'discussion-general') {
|
|
||||||
// router.push(`/discussion/${idContent}`)
|
|
||||||
// } else if (cat[0] == 'division') {
|
|
||||||
// router.push(`/division/${idContent}`)
|
|
||||||
// } else if (cat[0] == 'member') {
|
|
||||||
// router.push(`/member/${idContent}`)
|
|
||||||
// } else if (cat[0] == 'project') {
|
|
||||||
// router.push(`/project/${idContent}`)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
@@ -156,6 +136,12 @@ export default function Notification() {
|
|||||||
onEndReached={loadMoreData}
|
onEndReached={loadMoreData}
|
||||||
onEndReachedThreshold={0.5}
|
onEndReachedThreshold={0.5}
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
|
||||||
|
|||||||
@@ -189,7 +189,10 @@ export default function Index() {
|
|||||||
return (
|
return (
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
key={index}
|
key={index}
|
||||||
onPress={() => { handleChooseData(item.id, item.name, item.isActive, item.idGroup) }}
|
onPress={() => {
|
||||||
|
entityUser.role != "user" &&
|
||||||
|
handleChooseData(item.id, item.name, item.isActive, item.idGroup)
|
||||||
|
}}
|
||||||
borderType="all"
|
borderType="all"
|
||||||
icon={
|
icon={
|
||||||
<View style={[Styles.iconContent, ColorsStatus.lightGreen]}>
|
<View style={[Styles.iconContent, ColorsStatus.lightGreen]}>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default function Profile() {
|
|||||||
/>
|
/>
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView style={[Styles.h100]}>
|
||||||
<View style={{ flexDirection: 'column' }}>
|
<View style={{ flexDirection: 'column' }}>
|
||||||
<View style={[Styles.wrapHeadViewMember]}>
|
<View style={[Styles.wrapHeadViewMember]}>
|
||||||
<Image
|
<Image
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
|||||||
import { AntDesign } from "@expo/vector-icons";
|
import { AntDesign } from "@expo/vector-icons";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, SafeAreaView, ScrollView, View } from "react-native";
|
import { Pressable, ScrollView, View } from "react-native";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ export default function AddMemberProject() {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
@@ -111,13 +111,13 @@ export default function AddMemberProject() {
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<InputSearch onChange={(val) => handleSearch(val)} value={search} />
|
<InputSearch onChange={(val) => handleSearch(val)} value={search} />
|
||||||
{
|
{
|
||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -134,40 +134,48 @@ export default function AddMemberProject() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
data.map((item: any, index: any) => {
|
<View style={[Styles.mb100]}>
|
||||||
const found = dataOld.some((i: any) => i.idUser == item.id)
|
{
|
||||||
return (
|
data.map((item: any, index: any) => {
|
||||||
<Pressable
|
const found = dataOld.some((i: any) => i.idUser == item.id)
|
||||||
key={index}
|
return (
|
||||||
style={[Styles.itemSelectModal]}
|
<Pressable
|
||||||
onPress={() => {
|
key={index}
|
||||||
!found && onChoose(item.id, item.name, item.img)
|
style={[Styles.itemSelectModal]}
|
||||||
}}
|
onPress={() => {
|
||||||
>
|
!found && onChoose(item.id, item.name, item.img)
|
||||||
<View style={[Styles.rowItemsCenter, Styles.w80]}>
|
}}
|
||||||
<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} border />
|
>
|
||||||
<View style={[Styles.ml10]}>
|
<View style={[Styles.rowItemsCenter, Styles.w80]}>
|
||||||
<Text style={[Styles.textDefault]} numberOfLines={1}>{item.name}</Text>
|
<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} border />
|
||||||
|
<View style={[Styles.ml10]}>
|
||||||
|
<Text style={[Styles.textDefault]} numberOfLines={1}>{item.name}</Text>
|
||||||
|
{
|
||||||
|
found && <Text style={[Styles.textInformation, Styles.cGray]}>sudah menjadi anggota</Text>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
{
|
{
|
||||||
found && <Text style={[Styles.textInformation, Styles.cGray]}>sudah menjadi anggota</Text>
|
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'} />
|
||||||
}
|
}
|
||||||
</View>
|
</Pressable>
|
||||||
</View>
|
)
|
||||||
{
|
}
|
||||||
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'} />
|
)
|
||||||
}
|
}
|
||||||
</Pressable>
|
</View>
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, { textAlign: 'center' }]}>Tidak ada data</Text>
|
<Text style={[Styles.textDefault, { textAlign: 'center' }]}>Tidak ada data</Text>
|
||||||
}
|
}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -88,8 +88,11 @@ export default function ProjectCancel() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
|
<View style={[Styles.p15]}>
|
||||||
<InputForm
|
<InputForm
|
||||||
label="Alasan Pembatalan"
|
label="Alasan Pembatalan"
|
||||||
type="default"
|
type="default"
|
||||||
@@ -99,6 +102,7 @@ export default function ProjectCancel() {
|
|||||||
error={error}
|
error={error}
|
||||||
errorText="Alasan pembatalan harus diisi"
|
errorText="Alasan pembatalan harus diisi"
|
||||||
onChange={(val) => onValidation(val)}
|
onChange={(val) => onValidation(val)}
|
||||||
|
multiline
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -107,8 +107,11 @@ export default function ReportProject() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
|
<View style={[Styles.p15]}>
|
||||||
<InputForm
|
<InputForm
|
||||||
label="Laporan Kegiatan"
|
label="Laporan Kegiatan"
|
||||||
type="default"
|
type="default"
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export default function CreateProject() {
|
|||||||
const taskCreate = useSelector((state: any) => state.taskCreate);
|
const taskCreate = useSelector((state: any) => state.taskCreate);
|
||||||
const update = useSelector((state: any) => state.projectUpdate)
|
const update = useSelector((state: any) => state.projectUpdate)
|
||||||
const entityUser = useSelector((state: any) => state.user);
|
const entityUser = useSelector((state: any) => state.user);
|
||||||
|
const userLogin = useSelector((state: any) => state.entities)
|
||||||
const [fileForm, setFileForm] = useState<any[]>([])
|
const [fileForm, setFileForm] = useState<any[]>([])
|
||||||
const [indexDelFile, setIndexDelFile] = useState<number>(0)
|
const [indexDelFile, setIndexDelFile] = useState<number>(0)
|
||||||
const [disableBtn, setDisableBtn] = useState(true)
|
const [disableBtn, setDisableBtn] = useState(true)
|
||||||
@@ -86,7 +87,7 @@ export default function CreateProject() {
|
|||||||
} else {
|
} else {
|
||||||
setError(error => ({ ...error, title: false }))
|
setError(error => ({ ...error, title: false }))
|
||||||
}
|
}
|
||||||
} else if (cat == "task" && hitung > 1) {
|
} else if (cat == "task" && hitung > 2) {
|
||||||
if (taskCreate.length == 0) {
|
if (taskCreate.length == 0) {
|
||||||
setError(error => ({ ...error, task: true }))
|
setError(error => ({ ...error, task: true }))
|
||||||
} else {
|
} else {
|
||||||
@@ -114,6 +115,13 @@ export default function CreateProject() {
|
|||||||
validationForm('task', '');
|
validationForm('task', '');
|
||||||
}, [taskCreate]);
|
}, [taskCreate]);
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (entityUser.role != "supadmin" && entityUser.role != "developer") {
|
||||||
|
validationForm('group', userLogin.idGroup, userLogin.group);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
@@ -205,8 +213,11 @@ export default function CreateProject() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
showsVerticalScrollIndicator={false}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
|
<View style={[Styles.p15]}>
|
||||||
{
|
{
|
||||||
(entityUser.role == "supadmin" || entityUser.role == "developer")
|
(entityUser.role == "supadmin" || entityUser.role == "developer")
|
||||||
&&
|
&&
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export default function AddMemberCreateProject() {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
@@ -88,14 +88,14 @@ export default function AddMemberCreateProject() {
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<InputSearch onChange={(val) => setSearch(val)} value={search} />
|
<InputSearch onChange={(val) => setSearch(val)} value={search} />
|
||||||
|
|
||||||
{
|
{
|
||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -112,7 +112,9 @@ export default function AddMemberCreateProject() {
|
|||||||
:
|
:
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
data.length > 0 ?
|
data.length > 0 ?
|
||||||
@@ -143,6 +145,6 @@ export default function AddMemberCreateProject() {
|
|||||||
}
|
}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -99,14 +99,19 @@ export default function CreateProjectAddTask() {
|
|||||||
timeStart: item.timeStart,
|
timeStart: item.timeStart,
|
||||||
timeEnd: item.timeEnd,
|
timeEnd: item.timeEnd,
|
||||||
}))
|
}))
|
||||||
dispatch(setTaskCreate([...taskCreate, {
|
|
||||||
|
const hasilOrder = [...taskCreate, {
|
||||||
title: title,
|
title: title,
|
||||||
dateStart: from,
|
dateStart: from,
|
||||||
dateEnd: to,
|
dateEnd: to,
|
||||||
dateStartFix: formatDateOnly(range.startDate, "YYYY-MM-DD"),
|
dateStartFix: formatDateOnly(range.startDate, "YYYY-MM-DD"),
|
||||||
dateEndFix: formatDateOnly(range.endDate, "YYYY-MM-DD"),
|
dateEndFix: formatDateOnly(range.endDate, "YYYY-MM-DD"),
|
||||||
dataDetail: dataDetailFix
|
dataDetail: dataDetailFix
|
||||||
}]))
|
}].sort((a, b) => {
|
||||||
|
return new Date(a.dateStartFix).getTime() - new Date(b.dateStartFix).getTime();
|
||||||
|
});
|
||||||
|
|
||||||
|
dispatch(setTaskCreate(hasilOrder))
|
||||||
router.back();
|
router.back();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export default function ListProject() {
|
|||||||
return (
|
return (
|
||||||
<View style={[Styles.p15, { flex: 1 }]}>
|
<View style={[Styles.p15, { flex: 1 }]}>
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10]}>
|
<ScrollView horizontal style={[Styles.mb10]} showsHorizontalScrollIndicator={false}>
|
||||||
<ButtonTab
|
<ButtonTab
|
||||||
active={statusFix}
|
active={statusFix}
|
||||||
value="0"
|
value="0"
|
||||||
@@ -193,16 +193,19 @@ export default function ListProject() {
|
|||||||
</Pressable>
|
</Pressable>
|
||||||
</View>
|
</View>
|
||||||
<View style={[Styles.mv05]}>
|
<View style={[Styles.mv05]}>
|
||||||
<Text>Filter :
|
{
|
||||||
{
|
entityUser.role != 'cosupadmin' && entityUser.role != 'admin' &&
|
||||||
(entityUser.role == "supadmin" || entityUser.role == "developer") && nameGroup
|
<Text>Filter :
|
||||||
}
|
{
|
||||||
{
|
(entityUser.role == "supadmin" || entityUser.role == "developer") && nameGroup
|
||||||
(entityUser.role == 'user' || entityUser.role == 'coadmin' || entityUser.role == 'cosupadmin')
|
}
|
||||||
? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? 'Kegiatan Saya' : 'Semua Kegiatan'
|
{
|
||||||
: ''
|
(entityUser.role == 'user' || entityUser.role == 'coadmin')
|
||||||
}
|
? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? 'Kegiatan Saya' : 'Semua Kegiatan'
|
||||||
</Text>
|
: ''
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={[{ flex: 2 }]}>
|
<View style={[{ flex: 2 }]}>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import BorderBottomItem from "@/components/borderBottomItem";
|
import BorderBottomItem from "@/components/borderBottomItem";
|
||||||
import ButtonBackHeader from "@/components/buttonBackHeader";
|
import ButtonBackHeader from "@/components/buttonBackHeader";
|
||||||
|
import ImageUser from "@/components/imageNew";
|
||||||
import InputSearch from "@/components/inputSearch";
|
import InputSearch from "@/components/inputSearch";
|
||||||
import Text from '@/components/Text';
|
import Text from '@/components/Text';
|
||||||
import { ColorsStatus } from "@/constants/ColorsStatus";
|
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||||
@@ -9,8 +10,8 @@ import { apiGetSearch } from "@/lib/api";
|
|||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { AntDesign, MaterialIcons } from "@expo/vector-icons";
|
import { AntDesign, MaterialIcons } from "@expo/vector-icons";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { FlatList, Image, SafeAreaView, View } from "react-native";
|
import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
type PropsUser = {
|
type PropsUser = {
|
||||||
@@ -40,10 +41,13 @@ export default function Search() {
|
|||||||
const [dataUser, setDataUser] = useState<PropsUser[]>([])
|
const [dataUser, setDataUser] = useState<PropsUser[]>([])
|
||||||
const [dataDivisi, setDataDivisi] = useState<PropDivisi[]>([])
|
const [dataDivisi, setDataDivisi] = useState<PropDivisi[]>([])
|
||||||
const [dataProject, setDataProject] = useState<PropProject[]>([])
|
const [dataProject, setDataProject] = useState<PropProject[]>([])
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
const [search, setSearch] = useState('')
|
||||||
|
|
||||||
async function handleSearch(cari: string) {
|
async function handleSearch(cari: string) {
|
||||||
try {
|
try {
|
||||||
if (cari.length > 3) {
|
setSearch(cari)
|
||||||
|
if (cari.length >= 3) {
|
||||||
const user = await decryptToken(String(token?.current))
|
const user = await decryptToken(String(token?.current))
|
||||||
const hasil = await apiGetSearch({ text: cari, user: user })
|
const hasil = await apiGetSearch({ text: cari, user: user })
|
||||||
if (hasil.success) {
|
if (hasil.success) {
|
||||||
@@ -65,6 +69,14 @@ export default function Search() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
handleSearch(search)
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
@@ -80,41 +92,44 @@ export default function Search() {
|
|||||||
{
|
{
|
||||||
dataProject.length + dataDivisi.length + dataUser.length > 0
|
dataProject.length + dataDivisi.length + dataUser.length > 0
|
||||||
?
|
?
|
||||||
<View style={[Styles.wrapPaper, Styles.mb100]}>
|
<ScrollView
|
||||||
|
style={[Styles.h100]}
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
{
|
{
|
||||||
dataUser.length > 0 &&
|
dataUser.length > 0 &&
|
||||||
<View style={[Styles.mb05]}>
|
<View style={[Styles.mv05, Styles.p10]}>
|
||||||
<Text>ANGGOTA</Text>
|
<Text>ANGGOTA</Text>
|
||||||
<FlatList
|
{
|
||||||
data={dataUser}
|
dataUser.map((item, index) => (
|
||||||
keyExtractor={(item) => String(item.id)}
|
|
||||||
renderItem={({ item }) => (
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
|
key={index}
|
||||||
borderType="bottom"
|
borderType="bottom"
|
||||||
icon={<Image
|
icon={<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} />}
|
||||||
source={{ uri: `${ConstEnv.url_storage}/files/${item.img}` }}
|
|
||||||
style={[Styles.userProfileSmall]}
|
|
||||||
/>}
|
|
||||||
title={item.name}
|
title={item.name}
|
||||||
subtitle={`${item.group}-${item.position}`}
|
subtitle={`${item.group}-${item.position}`}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
router.push(`/member/${item.id}`)
|
router.push(`/member/${item.id}`)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
))
|
||||||
/>
|
}
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
dataDivisi.length > 0 &&
|
dataDivisi.length > 0 &&
|
||||||
<View style={[Styles.mb05]}>
|
<View style={[Styles.mv05, Styles.p10]}>
|
||||||
<Text>DIVISI</Text>
|
<Text>DIVISI</Text>
|
||||||
<FlatList
|
{
|
||||||
data={dataDivisi}
|
dataDivisi.map((item, index) => (
|
||||||
keyExtractor={(item) => String(item.id)}
|
|
||||||
renderItem={({ item }) => (
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
|
key={index}
|
||||||
borderType="bottom"
|
borderType="bottom"
|
||||||
icon={
|
icon={
|
||||||
<View style={[Styles.iconContent, ColorsStatus.primary]}>
|
<View style={[Styles.iconContent, ColorsStatus.primary]}>
|
||||||
@@ -127,21 +142,20 @@ export default function Search() {
|
|||||||
router.push(`/division/${item.id}`)
|
router.push(`/division/${item.id}`)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
))
|
||||||
/>
|
}
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
dataProject.length > 0 &&
|
dataProject.length > 0 &&
|
||||||
<View style={[Styles.mb10]}>
|
<View style={[Styles.mv05, Styles.p10]}>
|
||||||
<Text>KEGIATAN</Text>
|
<Text>KEGIATAN</Text>
|
||||||
<FlatList
|
{
|
||||||
data={dataProject}
|
dataProject.map((item, index) => (
|
||||||
keyExtractor={(item) => String(item.id)}
|
|
||||||
renderItem={({ item }) => (
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
|
key={index}
|
||||||
borderType="bottom"
|
borderType="bottom"
|
||||||
icon={
|
icon={
|
||||||
<View style={[Styles.iconContent, ColorsStatus.primary]}>
|
<View style={[Styles.iconContent, ColorsStatus.primary]}>
|
||||||
@@ -154,13 +168,11 @@ export default function Search() {
|
|||||||
router.push(`/project/${item.id}`)
|
router.push(`/project/${item.id}`)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
))
|
||||||
/>
|
}
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
</View>
|
|
||||||
:
|
:
|
||||||
<View style={[Styles.contentItemCenter, Styles.mt10]}>
|
<View style={[Styles.contentItemCenter, Styles.mt10]}>
|
||||||
<Text style={[Styles.textInformation, Styles.cGray]}>Tidak ada data</Text>
|
<Text style={[Styles.textInformation, Styles.cGray]}>Tidak ada data</Text>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 27 KiB |
@@ -42,7 +42,7 @@ export default function ViewLogin({ onValidate }: Props) {
|
|||||||
return Toast.show({ type: 'small', text1: response.message, position: 'top' })
|
return Toast.show({ type: 'small', text1: response.message, position: 'top' })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan', position: 'top' })
|
return Toast.show({ type: 'small', text1: `Terjadi kesalahan, coba lagi`, position: 'top' })
|
||||||
} finally {
|
} finally {
|
||||||
setLoadingLogin(false)
|
setLoadingLogin(false)
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ export default function ViewLogin({ onValidate }: Props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<StatusBar style={Platform.OS === 'ios' ? 'auto' : 'light'} translucent={false} backgroundColor="black" />
|
<StatusBar style={Platform.OS === 'ios' ? 'dark' : 'light'} translucent={false} backgroundColor="black" />
|
||||||
<ToastCustom />
|
<ToastCustom />
|
||||||
<View style={[Styles.p20, Styles.h100]}>
|
<View style={[Styles.p20, Styles.h100]}>
|
||||||
<View style={{ alignItems: "center", marginTop: 70, marginBottom: 50 }}>
|
<View style={{ alignItems: "center", marginTop: 70, marginBottom: 50 }}>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export default function ViewVerification({ phone, otp }: Props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StatusBar style={Platform.OS === 'ios' ? 'auto' : 'light'} translucent={false} backgroundColor="black" />
|
<StatusBar style={Platform.OS === 'ios' ? 'dark' : 'light'} translucent={false} backgroundColor="black" />
|
||||||
<ToastCustom />
|
<ToastCustom />
|
||||||
<View style={Styles.wrapLogin} >
|
<View style={Styles.wrapLogin} >
|
||||||
<View style={{ alignItems: "center", marginTop: 70, marginBottom: 50 }}>
|
<View style={{ alignItems: "center", marginTop: 70, marginBottom: 50 }}>
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ export default function DiscussionItem({ title, user, date, onPress }: Props) {
|
|||||||
<Pressable style={[Styles.wrapItemDiscussion]} onPress={onPress}>
|
<Pressable style={[Styles.wrapItemDiscussion]} onPress={onPress}>
|
||||||
<View style={[Styles.rowItemsCenter, Styles.mb10]}>
|
<View style={[Styles.rowItemsCenter, Styles.mb10]}>
|
||||||
<Ionicons name="chatbox-ellipses-outline" size={22} color="black" style={Styles.mr10} />
|
<Ionicons name="chatbox-ellipses-outline" size={22} color="black" style={Styles.mr10} />
|
||||||
<Text style={{ fontWeight: 'bold' }} numberOfLines={1} ellipsizeMode="tail">{title}</Text>
|
<View style={[{flex:1}]}>
|
||||||
|
<Text style={{ fontWeight: 'bold' }} numberOfLines={1} ellipsizeMode="tail">{title}</Text>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={Styles.rowSpaceBetween}>
|
<View style={Styles.rowSpaceBetween}>
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ export default function HeaderDiscussionGeneral() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
{
|
||||||
|
entityUser.role != "user" && entityUser.role != "coadmin" &&
|
||||||
|
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||||
|
}
|
||||||
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={setVisible} title="Menu">
|
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={setVisible} title="Menu">
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
|
|||||||
@@ -16,15 +16,15 @@ type Props = {
|
|||||||
date: string;
|
date: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function DiscussionDivisionDetail() {
|
export default function DiscussionDivisionDetail({ refreshing }: { refreshing: boolean }) {
|
||||||
const { token, decryptToken } = useAuthSession();
|
const { token, decryptToken } = useAuthSession();
|
||||||
const { id } = useLocalSearchParams<{ id: string }>();
|
const { id } = useLocalSearchParams<{ id: string }>();
|
||||||
const [data, setData] = useState<Props[]>([]);
|
const [data, setData] = useState<Props[]>([]);
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiGetDivisionOneFeature({
|
const response = await apiGetDivisionOneFeature({
|
||||||
user: hasil,
|
user: hasil,
|
||||||
@@ -40,8 +40,15 @@ export default function DiscussionDivisionDetail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad();
|
if (refreshing)
|
||||||
}, []);
|
handleLoad(false)
|
||||||
|
}, [refreshing])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleLoad(true)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[Styles.mb15]}>
|
<View style={[Styles.mb15]}>
|
||||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv10]}>Diskusi</Text>
|
<Text style={[Styles.textDefaultSemiBold, Styles.mv10]}>Diskusi</Text>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ type Props = {
|
|||||||
idStorage: string
|
idStorage: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function FileDivisionDetail() {
|
export default function FileDivisionDetail({ refreshing }: { refreshing: boolean }) {
|
||||||
const ref = React.useRef<ICarouselInstance>(null);
|
const ref = React.useRef<ICarouselInstance>(null);
|
||||||
const width = Dimensions.get("window").width;
|
const width = Dimensions.get("window").width;
|
||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
@@ -33,9 +33,9 @@ export default function FileDivisionDetail() {
|
|||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [loadingOpen, setLoadingOpen] = useState(false)
|
const [loadingOpen, setLoadingOpen] = useState(false)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDivisionOneFeature({ user: hasil, id, cat: 'new-file' })
|
const response = await apiGetDivisionOneFeature({ user: hasil, id, cat: 'new-file' })
|
||||||
setData(response.data)
|
setData(response.data)
|
||||||
@@ -47,7 +47,12 @@ export default function FileDivisionDetail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad()
|
if (refreshing)
|
||||||
|
handleLoad(false)
|
||||||
|
}, [refreshing])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleLoad(true)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ type Props = {
|
|||||||
kalender: number
|
kalender: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function FiturDivisionDetail() {
|
export default function FiturDivisionDetail({ refreshing }: { refreshing: boolean }) {
|
||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const { id } = useLocalSearchParams<{ id: string }>()
|
const { id } = useLocalSearchParams<{ id: string }>()
|
||||||
const [data, setData] = useState<Props>({
|
const [data, setData] = useState<Props>({
|
||||||
@@ -36,7 +36,10 @@ export default function FiturDivisionDetail() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (refreshing)
|
||||||
|
handleLoad()
|
||||||
|
}, [refreshing])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad()
|
handleLoad()
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type Props = {
|
|||||||
projectTitle: string
|
projectTitle: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function TaskDivisionDetail() {
|
export default function TaskDivisionDetail({ refreshing }: { refreshing: boolean }) {
|
||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const { id } = useLocalSearchParams<{ id: string }>()
|
const { id } = useLocalSearchParams<{ id: string }>()
|
||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
@@ -26,9 +26,9 @@ export default function TaskDivisionDetail() {
|
|||||||
const width = Dimensions.get("window").width;
|
const width = Dimensions.get("window").width;
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDivisionOneFeature({ user: hasil, id, cat: 'today-task' })
|
const response = await apiGetDivisionOneFeature({ user: hasil, id, cat: 'today-task' })
|
||||||
setData(response.data)
|
setData(response.data)
|
||||||
@@ -40,7 +40,12 @@ export default function TaskDivisionDetail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad()
|
if (refreshing)
|
||||||
|
handleLoad(false)
|
||||||
|
}, [refreshing])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleLoad(true)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { InputForm } from "../inputForm";
|
|||||||
import MenuItemRow from "../menuItemRow";
|
import MenuItemRow from "../menuItemRow";
|
||||||
import ModalFloat from "../modalFloat";
|
import ModalFloat from "../modalFloat";
|
||||||
|
|
||||||
export default function HeaderRightDocument({ path }: { path: string }) {
|
export default function HeaderRightDocument({ path, isMember }: { path: string, isMember: boolean }) {
|
||||||
const [isVisible, setVisible] = useState(false);
|
const [isVisible, setVisible] = useState(false);
|
||||||
const [newFolder, setNewFolder] = useState(false);
|
const [newFolder, setNewFolder] = useState(false);
|
||||||
const { id } = useLocalSearchParams<{ id: string }>();
|
const { id } = useLocalSearchParams<{ id: string }>();
|
||||||
@@ -25,6 +25,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
const update = useSelector((state: any) => state.dokumenUpdate)
|
const update = useSelector((state: any) => state.dokumenUpdate)
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
const [loadingFolder, setLoadingFolder] = useState(false)
|
const [loadingFolder, setLoadingFolder] = useState(false)
|
||||||
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
|
|
||||||
async function handleCreateFolder() {
|
async function handleCreateFolder() {
|
||||||
try {
|
try {
|
||||||
@@ -102,11 +103,14 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ButtonMenuHeader
|
{
|
||||||
onPress={() => {
|
((entityUser.role != "user" && entityUser.role != "coadmin") || isMember) &&
|
||||||
setVisible(true);
|
<ButtonMenuHeader
|
||||||
}}
|
onPress={() => {
|
||||||
/>
|
setVisible(true);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
<DrawerBottom
|
<DrawerBottom
|
||||||
animation="slide"
|
animation="slide"
|
||||||
isVisible={isVisible}
|
isVisible={isVisible}
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ type Props = {
|
|||||||
checked?: boolean
|
checked?: boolean
|
||||||
onChecked?: () => void
|
onChecked?: () => void
|
||||||
onPress?: () => void
|
onPress?: () => void
|
||||||
|
canChecked?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ItemFile({ category, checked, dateTime, title, onChecked, onPress }: Props) {
|
export default function ItemFile({ category, checked, dateTime, title, onChecked, onPress, canChecked }: Props) {
|
||||||
return (
|
return (
|
||||||
<View style={[Styles.wrapItemBorderBottom]}>
|
<View style={[Styles.wrapItemBorderBottom]}>
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
<View style={[Styles.rowItemsCenter]}>
|
||||||
@@ -43,18 +44,22 @@ export default function ItemFile({ category, checked, dateTime, title, onChecked
|
|||||||
|
|
||||||
</Pressable>
|
</Pressable>
|
||||||
<View style={[Styles.rowSpaceBetween, { flex: 1, alignItems: 'center' }]}>
|
<View style={[Styles.rowSpaceBetween, { flex: 1, alignItems: 'center' }]}>
|
||||||
<Pressable style={[Styles.ml10, {flex:1},]} onPress={onPress}>
|
<Pressable style={[Styles.ml10, { flex: 1 },]} onPress={onPress}>
|
||||||
<Text style={[Styles.textDefault]} numberOfLines={1} ellipsizeMode="tail">{title}</Text>
|
<Text style={[Styles.textDefault]} numberOfLines={1} ellipsizeMode="tail">{title}</Text>
|
||||||
<Text style={[Styles.textInformation]}>{dateTime}</Text>
|
<Text style={[Styles.textInformation]}>{dateTime}</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
<Pressable onPress={onChecked}>
|
{
|
||||||
{
|
!canChecked ? <></>
|
||||||
checked
|
:
|
||||||
? <MaterialCommunityIcons name="checkbox-marked-circle" size={25} color={'black'} />
|
<Pressable onPress={onChecked}>
|
||||||
: <MaterialCommunityIcons name="checkbox-blank-circle-outline" size={25} color={'#ced4da'} />
|
{
|
||||||
}
|
checked
|
||||||
|
? <MaterialCommunityIcons name="checkbox-marked-circle" size={25} color={'black'} />
|
||||||
|
: <MaterialCommunityIcons name="checkbox-blank-circle-outline" size={25} color={'#ced4da'} />
|
||||||
|
}
|
||||||
|
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export default function DrawerBottom({ isVisible, setVisible, title, children, a
|
|||||||
backdropTransitionInTiming={500}
|
backdropTransitionInTiming={500}
|
||||||
backdropTransitionOutTiming={500}
|
backdropTransitionOutTiming={500}
|
||||||
useNativeDriverForBackdrop={true}
|
useNativeDriverForBackdrop={true}
|
||||||
|
propagateSwipe={true}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
keyboard ?
|
keyboard ?
|
||||||
@@ -62,7 +63,7 @@ export default function DrawerBottom({ isVisible, setVisible, title, children, a
|
|||||||
<MaterialIcons name="close" color="black" size={22} />
|
<MaterialIcons name="close" color="black" size={22} />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</View>
|
</View>
|
||||||
<View style={Styles.contentContainer}>
|
<View style={[Styles.contentContainer, { flex: 1 }]}>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default function EventItem({ category, title, user, jamAwal, jamAkhir, on
|
|||||||
return (
|
return (
|
||||||
<Pressable style={[Styles.itemEvent, { backgroundColor: category == 'orange' ? '#FED6C5' : '#D8D8F1' }]} onPress={onPress}>
|
<Pressable style={[Styles.itemEvent, { backgroundColor: category == 'orange' ? '#FED6C5' : '#D8D8F1' }]} onPress={onPress}>
|
||||||
<View style={[Styles.dividerEvent, { backgroundColor: category == 'orange' ? '#FB804C' : '#535FCA' }]} />
|
<View style={[Styles.dividerEvent, { backgroundColor: category == 'orange' ? '#FB804C' : '#535FCA' }]} />
|
||||||
<View>
|
<View style={[Styles.w90]}>
|
||||||
<Text>{jamAwal} - {jamAkhir}</Text>
|
<Text>{jamAwal} - {jamAkhir}</Text>
|
||||||
<Text numberOfLines={1} ellipsizeMode="tail" style={[Styles.textDefaultSemiBold, Styles.mv05]}>{title}</Text>
|
<Text numberOfLines={1} ellipsizeMode="tail" style={[Styles.textDefaultSemiBold, Styles.mv05]}>{title}</Text>
|
||||||
<Text numberOfLines={1} ellipsizeMode="tail">Dibuat oleh : {user}</Text>
|
<Text numberOfLines={1} ellipsizeMode="tail">Dibuat oleh : {user}</Text>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Carousel, { ICarouselInstance } from "react-native-reanimated-carousel";
|
|||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import Text from "../Text";
|
import Text from "../Text";
|
||||||
|
|
||||||
export default function CaraouselHome() {
|
export default function CaraouselHome({ refreshing }: { refreshing: boolean }) {
|
||||||
const { decryptToken, token } = useAuthSession()
|
const { decryptToken, token } = useAuthSession()
|
||||||
const ref = React.useRef<ICarouselInstance>(null);
|
const ref = React.useRef<ICarouselInstance>(null);
|
||||||
const width = Dimensions.get("window").width;
|
const width = Dimensions.get("window").width;
|
||||||
@@ -37,6 +37,11 @@ export default function CaraouselHome() {
|
|||||||
dispatch(setEntityUser({ role: response.data.idUserRole, admin: false }))
|
dispatch(setEntityUser({ role: response.data.idUserRole, admin: false }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (refreshing)
|
||||||
|
handleBannerView()
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleBannerView()
|
handleBannerView()
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ type Props = {
|
|||||||
frontColor: string;
|
frontColor: string;
|
||||||
}[]
|
}[]
|
||||||
|
|
||||||
export default function ChartDokumenHome() {
|
export default function ChartDokumenHome({ refreshing }: { refreshing: boolean }) {
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const { decryptToken, token } = useAuthSession()
|
const { decryptToken, token } = useAuthSession()
|
||||||
const [data, setData] = useState<Props>([])
|
const [data, setData] = useState<Props>([])
|
||||||
@@ -25,9 +25,9 @@ export default function ChartDokumenHome() {
|
|||||||
const width = Dimensions.get("window").width;
|
const width = Dimensions.get("window").width;
|
||||||
|
|
||||||
|
|
||||||
async function handleData() {
|
async function handleData(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDataHome({ cat: "dokumen", user: hasil })
|
const response = await apiGetDataHome({ cat: "dokumen", user: hasil })
|
||||||
const maxValue = response.data.reduce((max: number, obj: { value: number; }) => Math.max(max, obj.value), -Infinity);
|
const maxValue = response.data.reduce((max: number, obj: { value: number; }) => Math.max(max, obj.value), -Infinity);
|
||||||
@@ -47,7 +47,12 @@ export default function ChartDokumenHome() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleData()
|
if (refreshing)
|
||||||
|
handleData(false)
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleData(true)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ type Props = {
|
|||||||
color: string;
|
color: string;
|
||||||
}[]
|
}[]
|
||||||
|
|
||||||
export default function ChartProgresHome() {
|
export default function ChartProgresHome({ refreshing }: { refreshing: boolean }) {
|
||||||
const { decryptToken, token } = useAuthSession()
|
const { decryptToken, token } = useAuthSession()
|
||||||
const [data, setData] = useState<Props>([])
|
const [data, setData] = useState<Props>([])
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
async function handleData() {
|
async function handleData(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDataHome({ cat: "progress", user: hasil })
|
const response = await apiGetDataHome({ cat: "progress", user: hasil })
|
||||||
const convertedArray = response.data.map((item: { color: any; text: any; value: any; }) => ({
|
const convertedArray = response.data.map((item: { color: any; text: any; value: any; }) => ({
|
||||||
@@ -37,7 +37,12 @@ export default function ChartProgresHome() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleData()
|
if (refreshing)
|
||||||
|
handleData(false)
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleData(true)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ type Props = {
|
|||||||
user: string
|
user: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DisccussionHome() {
|
export default function DisccussionHome({ refreshing }: { refreshing: boolean }) {
|
||||||
const { decryptToken, token } = useAuthSession()
|
const { decryptToken, token } = useAuthSession()
|
||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
|
|
||||||
async function handleData() {
|
async function handleData(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDataHome({ cat: "discussion", user: hasil })
|
const response = await apiGetDataHome({ cat: "discussion", user: hasil })
|
||||||
setData(response.data)
|
setData(response.data)
|
||||||
@@ -37,7 +37,12 @@ export default function DisccussionHome() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleData()
|
if (refreshing)
|
||||||
|
handleData(false)
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleData(true)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type Props = {
|
|||||||
jumlah: number
|
jumlah: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DivisionHome() {
|
export default function DivisionHome({ refreshing }: { refreshing: boolean }) {
|
||||||
const { decryptToken, token } = useAuthSession()
|
const { decryptToken, token } = useAuthSession()
|
||||||
const ref = React.useRef<ICarouselInstance>(null)
|
const ref = React.useRef<ICarouselInstance>(null)
|
||||||
const width = Dimensions.get("window").width
|
const width = Dimensions.get("window").width
|
||||||
@@ -23,9 +23,9 @@ export default function DivisionHome() {
|
|||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const arrSkeleton = Array.from({ length: 2 }, (_, index) => index)
|
const arrSkeleton = Array.from({ length: 2 }, (_, index) => index)
|
||||||
|
|
||||||
async function handleData() {
|
async function handleData(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDataHome({ cat: "division", user: hasil })
|
const response = await apiGetDataHome({ cat: "division", user: hasil })
|
||||||
setData(response.data)
|
setData(response.data)
|
||||||
@@ -37,14 +37,19 @@ export default function DivisionHome() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleData()
|
if (refreshing)
|
||||||
|
handleData(false)
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleData(true)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[Styles.mb15]}>
|
<View style={[Styles.mb15]}>
|
||||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv10]}>Divisi Teraktif</Text>
|
<Text style={[Styles.textDefaultSemiBold, Styles.mb10]}>Divisi Teraktif</Text>
|
||||||
{
|
{
|
||||||
loading ?
|
loading ?
|
||||||
arrSkeleton.map((item, index) => (
|
arrSkeleton.map((item, index) => (
|
||||||
|
|||||||
@@ -22,14 +22,14 @@ type Props = {
|
|||||||
user_name: string
|
user_name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function EventHome() {
|
export default function EventHome({ refreshing }: { refreshing: boolean }) {
|
||||||
const { decryptToken, token } = useAuthSession()
|
const { decryptToken, token } = useAuthSession()
|
||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
async function handleData() {
|
async function handleData(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDataHome({ cat: "event", user: hasil })
|
const response = await apiGetDataHome({ cat: "event", user: hasil })
|
||||||
setData(response.data)
|
setData(response.data)
|
||||||
@@ -41,7 +41,12 @@ export default function EventHome() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleData()
|
if (refreshing)
|
||||||
|
handleData(false)
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleData(true)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -20,16 +20,16 @@ type Props = {
|
|||||||
createdAt: string
|
createdAt: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ProjectHome() {
|
export default function ProjectHome({ refreshing }: { refreshing: boolean }) {
|
||||||
const { decryptToken, token } = useAuthSession()
|
const { decryptToken, token } = useAuthSession()
|
||||||
const ref = React.useRef<ICarouselInstance>(null);
|
const ref = React.useRef<ICarouselInstance>(null);
|
||||||
const width = Dimensions.get("window").width;
|
const width = Dimensions.get("window").width;
|
||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
async function handleData() {
|
async function handleData(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDataHome({ cat: "kegiatan", user: hasil })
|
const response = await apiGetDataHome({ cat: "kegiatan", user: hasil })
|
||||||
setData(response.data)
|
setData(response.data)
|
||||||
@@ -41,12 +41,17 @@ export default function ProjectHome() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleData()
|
if (refreshing)
|
||||||
|
handleData(false)
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleData(true)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[Styles.mb15]}>
|
<View style={[Styles.mb15]}>
|
||||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv10]}>Kegiatan Terupdate</Text>
|
<Text style={[Styles.textDefaultSemiBold, Styles.mb10]}>Kegiatan Terupdate</Text>
|
||||||
{
|
{
|
||||||
loading ? (<Skeleton width={100} height={150} borderRadius={10} widthType="percent" />)
|
loading ? (<Skeleton width={100} height={150} borderRadius={10} widthType="percent" />)
|
||||||
:
|
:
|
||||||
@@ -57,7 +62,7 @@ export default function ProjectHome() {
|
|||||||
width={width * 0.8}
|
width={width * 0.8}
|
||||||
height={235}
|
height={235}
|
||||||
data={data}
|
data={data}
|
||||||
loop={true}
|
loop={false}
|
||||||
autoPlay={false}
|
autoPlay={false}
|
||||||
autoPlayReverse={false}
|
autoPlayReverse={false}
|
||||||
pagingEnabled={true}
|
pagingEnabled={true}
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ export function InputDate({ label, value, placeholder, onChange, info, disable,
|
|||||||
display="spinner"
|
display="spinner"
|
||||||
onChange={(event, date) => { onChangeDate(event.type, date) }}
|
onChange={(event, date) => { onChangeDate(event.type, date) }}
|
||||||
onTouchCancel={() => setModal(false)}
|
onTouchCancel={() => setModal(false)}
|
||||||
|
textColor="black"
|
||||||
/>
|
/>
|
||||||
</ModalFloat>
|
</ModalFloat>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -40,10 +40,15 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
|
|||||||
<View style={[
|
<View style={[
|
||||||
Styles.inputRoundForm,
|
Styles.inputRoundForm,
|
||||||
itemRight != undefined ? Styles.inputRoundFormRight : Styles.inputRoundFormLeft,
|
itemRight != undefined ? Styles.inputRoundFormRight : Styles.inputRoundFormLeft,
|
||||||
|
multiline && { alignItems: 'flex-end' },
|
||||||
round && Styles.round30,
|
round && Styles.round30,
|
||||||
{ backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' },
|
{ backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' },
|
||||||
error && { borderColor: "red" },
|
error && { borderColor: "red" },
|
||||||
Platform.OS == 'ios' ? { paddingVertical: 10 } : { paddingVertical: 0 },
|
Platform.OS == 'ios' ? { paddingVertical: 10 } : { paddingVertical: 0, minHeight: 40 },
|
||||||
|
{ alignItems: 'center' },
|
||||||
|
multiline
|
||||||
|
? { alignItems: "flex-end" } // multiline: tombol send di bawah
|
||||||
|
: { alignItems: "center" }, // default: tetap di tengah
|
||||||
]}>
|
]}>
|
||||||
{itemRight != undefined ? itemRight : itemLeft}
|
{itemRight != undefined ? itemRight : itemLeft}
|
||||||
<TextInput
|
<TextInput
|
||||||
@@ -53,7 +58,14 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
|
|||||||
keyboardType={type}
|
keyboardType={type}
|
||||||
onChangeText={onChange}
|
onChangeText={onChange}
|
||||||
placeholderTextColor={'gray'}
|
placeholderTextColor={'gray'}
|
||||||
style={[Styles.mh05, { width: width ? lebar * width / 100 : lebar * 0.78, color: 'black' }, Platform.OS == 'ios' ? { paddingVertical: 1 } : { paddingVertical: 5 }]}
|
multiline={multiline}
|
||||||
|
numberOfLines={3}
|
||||||
|
style={[
|
||||||
|
Styles.mh05,
|
||||||
|
multiline && { height: '100%', maxHeight: 100 },
|
||||||
|
{ width: width ? lebar * width / 100 : lebar * 0.78, color: 'black' },
|
||||||
|
Platform.OS == 'ios' ? { paddingVertical: 1, paddingTop: 3 } : { paddingVertical: 0 },
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
{error && (<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>{errorText}</Text>)}
|
{error && (<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>{errorText}</Text>)}
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ export default function HeaderMemberList() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
{
|
||||||
|
entityUser.role != "user" &&
|
||||||
|
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||||
|
}
|
||||||
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={() => setVisible(false)} title="Menu">
|
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={() => setVisible(false)} title="Menu">
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export default function ModalFilter({ open, close, page, category }: Props) {
|
|||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const entities = useSelector((state: any) => state.filterGroup)
|
const entities = useSelector((state: any) => state.filterGroup)
|
||||||
|
const update = useSelector((state: any) => state.groupUpdate)
|
||||||
const [chooseGroup, setChooseGroup] = useState('')
|
const [chooseGroup, setChooseGroup] = useState('')
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
@@ -42,10 +43,8 @@ export default function ModalFilter({ open, close, page, category }: Props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (entities.length == 0) {
|
|
||||||
handleLoad()
|
handleLoad()
|
||||||
}
|
}, [dispatch, update]);
|
||||||
}, [dispatch]);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
|||||||
selectMember.length > 0
|
selectMember.length > 0
|
||||||
?
|
?
|
||||||
<View>
|
<View>
|
||||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
|
||||||
{
|
{
|
||||||
selectMember.map((item: any, index: any) => (
|
selectMember.map((item: any, index: any) => (
|
||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
@@ -154,7 +154,7 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
|||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
<ScrollView>
|
<ScrollView showsVerticalScrollIndicator={false}>
|
||||||
<View>
|
<View>
|
||||||
{
|
{
|
||||||
category != 'status-task' ?
|
category != 'status-task' ?
|
||||||
|
|||||||
@@ -30,16 +30,20 @@ export default function HeaderRightProjectList() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
<MenuItemRow
|
{
|
||||||
icon={<AntDesign name="filter" color="black" size={25} />}
|
(entityUser.role == "user" || entityUser.role == "coadmin" || entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
||||||
title="Filter"
|
<MenuItemRow
|
||||||
onPress={() => {
|
icon={<AntDesign name="filter" color="black" size={25} />}
|
||||||
setVisible(false)
|
title="Filter"
|
||||||
setTimeout(() => {
|
onPress={() => {
|
||||||
setFilter(true)
|
setVisible(false)
|
||||||
}, 600)
|
setTimeout(() => {
|
||||||
}}
|
setFilter(true)
|
||||||
/>
|
}, 600)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
<ModalFilter
|
<ModalFilter
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ type Props = {
|
|||||||
position: string;
|
position: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function SectionMemberTask({ refreshing, isMemberDivision }: { refreshing: boolean, isMemberDivision: boolean }) {
|
export default function SectionMemberTask({ refreshing, isAdminDivision }: { refreshing: boolean, isAdminDivision: boolean }) {
|
||||||
const [isModal, setModal] = useState(false);
|
const [isModal, setModal] = useState(false);
|
||||||
const entityUser = useSelector((state: any) => state.user);
|
const entityUser = useSelector((state: any) => state.user);
|
||||||
const { token, decryptToken } = useAuthSession();
|
const { token, decryptToken } = useAuthSession();
|
||||||
@@ -168,7 +168,7 @@ export default function SectionMemberTask({ refreshing, isMemberDivision }: { re
|
|||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
(entityUser.role != "user" && entityUser.role != "coadmin") || isMemberDivision
|
(entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision
|
||||||
?
|
?
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
icon={
|
icon={
|
||||||
|
|||||||
1
constants/OnlySpaceOrEnter.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const regexOnlySpacesOrEnter = /^[\s\r\n]+$/;
|
||||||
@@ -79,6 +79,12 @@ const Styles = StyleSheet.create({
|
|||||||
mb10: {
|
mb10: {
|
||||||
marginBottom: 10
|
marginBottom: 10
|
||||||
},
|
},
|
||||||
|
mb12: {
|
||||||
|
marginBottom: 12
|
||||||
|
},
|
||||||
|
mb13: {
|
||||||
|
marginBottom: 13
|
||||||
|
},
|
||||||
mb15: {
|
mb15: {
|
||||||
marginBottom: 15
|
marginBottom: 15
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict/>
|
<dict>
|
||||||
</plist>
|
<key>aps-environment</key>
|
||||||
|
<string>development</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 13 KiB |
@@ -19,7 +19,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.2</string>
|
<string>2.0.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1</string>
|
<string>3</string>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
@@ -65,6 +65,10 @@
|
|||||||
<array>
|
<array>
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>UIBackgroundModes</key>
|
||||||
|
<array>
|
||||||
|
<string>remote-notification</string>
|
||||||
|
</array>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
<string>SplashScreen</string>
|
<string>SplashScreen</string>
|
||||||
<key>UIRequiredDeviceCapabilities</key>
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ export const apiGetDivisionGroup = async ({ user }: { user: string }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const apiCreateAnnouncement = async ({ data }: { data: { title: string, desc: string, user: string, groups: any[] } }) => {
|
export const apiCreateAnnouncement = async ({ data }: { data: { title: string, desc: string, user: string, groups: any[] } }) => {
|
||||||
const response = await api.post(`/mobile/announcement/`, data)
|
const response = await api.post(`/mobile/announcement`, data)
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -425,6 +425,10 @@ export const apiCreateDivision = async (data: { data: { idGroup: string, name: s
|
|||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const apiCheckDivisionName = async (data: { data: { idGroup: string, name: string, desc: string }, user: string }) => {
|
||||||
|
const response = await api.put(`/mobile/division`, data)
|
||||||
|
return response.data;
|
||||||
|
};
|
||||||
|
|
||||||
export const apiGetDiscussion = async ({ user, search, division, active, page }: { user: string, search: string, division: string, active?: string, page?: number }) => {
|
export const apiGetDiscussion = async ({ user, search, division, active, page }: { user: string, search: string, division: string, active?: string, page?: number }) => {
|
||||||
const response = await api.get(`mobile/discussion?user=${user}&active=${active}&search=${search}&division=${division}&page=${page}`);
|
const response = await api.get(`mobile/discussion?user=${user}&active=${active}&search=${search}&division=${division}&page=${page}`);
|
||||||
|
|||||||
18
lib/fun_validateName.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Validasi Display Name
|
||||||
|
* Aturan:
|
||||||
|
* - 2 sampai 50 karakter
|
||||||
|
* - Huruf, angka, spasi, titik, koma, apostrof, underscore, dan dash
|
||||||
|
* - Tidak boleh semua spasi
|
||||||
|
*/
|
||||||
|
export const validateName = (name: string): boolean => {
|
||||||
|
const trimmed = name.trim();
|
||||||
|
|
||||||
|
// Jika kosong setelah di-trim → invalid
|
||||||
|
if (!trimmed) return false;
|
||||||
|
|
||||||
|
// Regex: hanya huruf, angka, spasi, titik, koma, apostrof, underscore, dash
|
||||||
|
const regex = /^[a-zA-Z0-9\s._,'-]{3,50}$/;
|
||||||
|
|
||||||
|
return regex.test(trimmed);
|
||||||
|
};
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
import { getApp, getApps, initializeApp } from '@react-native-firebase/app';
|
import { getApp, getApps, initializeApp } from '@react-native-firebase/app';
|
||||||
import { getMessaging, registerDeviceForRemoteMessages, setAutoInitEnabled } from '@react-native-firebase/messaging';
|
import {
|
||||||
|
getMessaging,
|
||||||
|
getToken as getMessagingToken,
|
||||||
|
setAutoInitEnabled,
|
||||||
|
} from '@react-native-firebase/messaging';
|
||||||
import * as Notifications from 'expo-notifications';
|
import * as Notifications from 'expo-notifications';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { PermissionsAndroid, Platform } from 'react-native';
|
import { PermissionsAndroid, Platform } from 'react-native';
|
||||||
|
|
||||||
// Your Firebase project configuration
|
// Firebase config
|
||||||
const RNfirebaseConfig = {
|
const RNfirebaseConfig = {
|
||||||
apiKey: "AIzaSyB2hbsW91J3oRQx4_jgrCCNY0tNt5-21e8",
|
apiKey: "AIzaSyB2hbsW91J3oRQx4_jgrCCNY0tNt5-21e8",
|
||||||
authDomain: "googleapis.com",
|
authDomain: "googleapis.com",
|
||||||
@@ -15,14 +19,15 @@ const RNfirebaseConfig = {
|
|||||||
databaseURL: "https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app/"
|
databaseURL: "https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app/"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const initializeFirebase = async () => {
|
const initializeFirebase = async () => {
|
||||||
try {
|
try {
|
||||||
const app = getApps().length ? getApp() : initializeApp(RNfirebaseConfig);
|
const app = getApps().length ? getApp() : initializeApp(RNfirebaseConfig);
|
||||||
const mess = getMessaging(app);
|
const mess = getMessaging(app);
|
||||||
await registerDeviceForRemoteMessages(mess);
|
// await registerDeviceForRemoteMessages(mess);
|
||||||
setAutoInitEnabled(mess, true);
|
// `registerDeviceForRemoteMessages` tidak perlu lagi
|
||||||
return mess
|
await setAutoInitEnabled(mess, true);
|
||||||
|
|
||||||
|
return mess;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to initialize Firebase:', error);
|
console.error('Failed to initialize Firebase:', error);
|
||||||
}
|
}
|
||||||
@@ -31,17 +36,16 @@ const initializeFirebase = async () => {
|
|||||||
export const requestPermission = async () => {
|
export const requestPermission = async () => {
|
||||||
try {
|
try {
|
||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
const cek = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS)
|
const cek = await PermissionsAndroid.check(
|
||||||
|
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
|
||||||
|
);
|
||||||
if (!cek) {
|
if (!cek) {
|
||||||
const granted = await PermissionsAndroid.request(
|
const granted = await PermissionsAndroid.request(
|
||||||
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
|
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
|
||||||
);
|
);
|
||||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
return granted === PermissionsAndroid.RESULTS.GRANTED;
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
return true
|
return true;
|
||||||
} else if (Platform.OS === 'ios') {
|
} else if (Platform.OS === 'ios') {
|
||||||
const { status } = await Notifications.requestPermissionsAsync();
|
const { status } = await Notifications.requestPermissionsAsync();
|
||||||
return status === 'granted';
|
return status === 'granted';
|
||||||
@@ -54,10 +58,13 @@ export const requestPermission = async () => {
|
|||||||
export const getToken = async () => {
|
export const getToken = async () => {
|
||||||
try {
|
try {
|
||||||
const mess = await initializeFirebase();
|
const mess = await initializeFirebase();
|
||||||
const token = await mess?.getToken();
|
if (!mess) return null;
|
||||||
|
|
||||||
|
// pakai modular API
|
||||||
|
const token = await getMessagingToken(mess);
|
||||||
return token;
|
return token;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error getting token:", error);
|
console.error('Error getting token:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -73,4 +80,4 @@ export const useNotification = () => {
|
|||||||
|
|
||||||
initializeAndSetup();
|
initializeAndSetup();
|
||||||
}, []);
|
}, []);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
|
|||||||
import CryptoES from "crypto-es";
|
import CryptoES from "crypto-es";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
import { createContext, MutableRefObject, ReactNode, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
import { createContext, MutableRefObject, ReactNode, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
||||||
import { Platform } from 'react-native';
|
|
||||||
|
|
||||||
const AuthContext = createContext<{
|
const AuthContext = createContext<{
|
||||||
signIn: (arg0: string) => void;
|
signIn: (arg0: string) => void;
|
||||||
@@ -57,13 +56,13 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea
|
|||||||
const permission = await requestPermission()
|
const permission = await requestPermission()
|
||||||
if (permission) {
|
if (permission) {
|
||||||
try {
|
try {
|
||||||
// COMING SOON
|
// if (Platform.OS === 'android') {
|
||||||
if (Platform.OS === 'android') {
|
const tokenDevice = await getToken()
|
||||||
const tokenDevice = await getToken()
|
const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) })
|
||||||
const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) })
|
// }else{
|
||||||
}else{
|
// const tokenDevice = await getToken()
|
||||||
const register = await apiRegisteredToken({ user: hasil, token: "" })
|
// const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) })
|
||||||
}
|
// }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
@@ -82,13 +81,12 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea
|
|||||||
const signOut = useCallback(async () => {
|
const signOut = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const hasil = await decryptToken(String(tokenRef.current))
|
const hasil = await decryptToken(String(tokenRef.current))
|
||||||
// COMING SOON
|
// if (Platform.OS === 'android') {
|
||||||
if (Platform.OS === 'android') {
|
const token = await getToken()
|
||||||
const token = await getToken()
|
const response = await apiUnregisteredToken({ user: hasil, token: String(token) })
|
||||||
const response = await apiUnregisteredToken({ user: hasil, token: String(token) })
|
// }else{
|
||||||
}else{
|
// const response = await apiUnregisteredToken({ user: hasil, token: "" })
|
||||||
const response = await apiUnregisteredToken({ user: hasil, token: "" })
|
// }
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||