Compare commits
7 Commits
amalia/29-
...
amalia/01-
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d72c365da | |||
| 589068703d | |||
| 7c713cc6e0 | |||
| d3c63fbcdd | |||
| ea29785a34 | |||
| e7ef09e9aa | |||
| 5898655fac |
1
app.json
1
app.json
@@ -42,6 +42,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"expo-font",
|
"expo-font",
|
||||||
|
"expo-image-picker",
|
||||||
"expo-web-browser",
|
"expo-web-browser",
|
||||||
[
|
[
|
||||||
"@react-native-firebase/app",
|
"@react-native-firebase/app",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { apiGetAnnouncementOne } from "@/lib/api";
|
|||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
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 { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Dimensions, SafeAreaView, ScrollView, View } from "react-native";
|
import { Dimensions, 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";
|
||||||
@@ -51,6 +51,11 @@ export default function DetailAnnouncement() {
|
|||||||
handleLoad(true)
|
handleLoad(true)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
function hasHtmlTags(text: string) {
|
||||||
|
const htmlRegex = /<[a-z][\s\S]*>/i;
|
||||||
|
return htmlRegex.test(text);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -84,10 +89,15 @@ export default function DetailAnnouncement() {
|
|||||||
<Text style={[Styles.textDefaultSemiBold]}>{data?.title}</Text>
|
<Text style={[Styles.textDefaultSemiBold]}>{data?.title}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={[Styles.mt10]}>
|
<View style={[Styles.mt10]}>
|
||||||
<RenderHTML
|
{
|
||||||
contentWidth={contentWidth}
|
hasHtmlTags(data?.desc) ?
|
||||||
source={{ html: data?.desc }}
|
<RenderHTML
|
||||||
/>
|
contentWidth={contentWidth}
|
||||||
|
source={{ html: data?.desc }}
|
||||||
|
/>
|
||||||
|
:
|
||||||
|
<Text>{data?.desc}</Text>
|
||||||
|
}
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default function EditBanner() {
|
|||||||
const pickImageAsync = async () => {
|
const pickImageAsync = async () => {
|
||||||
let result = await ImagePicker.launchImageLibraryAsync({
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
mediaTypes: ["images"],
|
mediaTypes: ["images"],
|
||||||
allowsEditing: true,
|
allowsEditing: false,
|
||||||
quality: 1,
|
quality: 1,
|
||||||
aspect: [1535, 450],
|
aspect: [1535, 450],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default function CreateBanner() {
|
|||||||
const pickImageAsync = async () => {
|
const pickImageAsync = async () => {
|
||||||
let result = await ImagePicker.launchImageLibraryAsync({
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
mediaTypes: ["images"],
|
mediaTypes: ["images"],
|
||||||
allowsEditing: true,
|
allowsEditing: false,
|
||||||
quality: 1,
|
quality: 1,
|
||||||
aspect: [1535, 450],
|
aspect: [1535, 450],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export default function BannerList() {
|
|||||||
onRefresh={handleRefresh}
|
onRefresh={handleRefresh}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
style={[{height:'100%'}]}
|
style={[Styles.h100]}
|
||||||
>
|
>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
{entities.map((index: any, key: number) => (
|
{entities.map((index: any, key: number) => (
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { InputForm } from "@/components/inputForm";
|
|||||||
import LabelStatus from "@/components/labelStatus";
|
import LabelStatus from "@/components/labelStatus";
|
||||||
import Skeleton from "@/components/skeleton";
|
import Skeleton from "@/components/skeleton";
|
||||||
import SkeletonContent from "@/components/skeletonContent";
|
import SkeletonContent from "@/components/skeletonContent";
|
||||||
|
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 { apiGetDiscussionGeneralOne, apiSendDiscussionGeneralCommentar } from "@/lib/api";
|
import { apiGetDiscussionGeneralOne, apiSendDiscussionGeneralCommentar } from "@/lib/api";
|
||||||
@@ -14,8 +15,7 @@ import { Ionicons, MaterialIcons } from "@expo/vector-icons";
|
|||||||
import { firebase } from '@react-native-firebase/database';
|
import { firebase } from '@react-native-firebase/database';
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, ScrollView, View } from "react-native";
|
import { KeyboardAvoidingView, Platform, Pressable, ScrollView, View } from "react-native";
|
||||||
import Text from '@/components/Text';
|
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -195,30 +195,34 @@ export default function DetailDiscussionGeneral() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<View style={[
|
<KeyboardAvoidingView
|
||||||
Styles.contentItemCenter,
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
Styles.absolute0,
|
keyboardVerticalOffset={110}
|
||||||
Styles.w100,
|
>
|
||||||
{ backgroundColor: "#f4f4f4" },
|
<View style={[
|
||||||
]}>
|
Styles.contentItemCenter,
|
||||||
<InputForm
|
Styles.w100,
|
||||||
disable={(data?.status === 2 || !data?.isActive || (!memberDiscussion && (entityUser.role == "user" || entityUser.role == "coadmin")))}
|
{ backgroundColor: "#f4f4f4" },
|
||||||
type="default"
|
]}>
|
||||||
round
|
<InputForm
|
||||||
placeholder="Kirim Komentar"
|
disable={(data?.status === 2 || !data?.isActive || (!memberDiscussion && (entityUser.role == "user" || entityUser.role == "coadmin")))}
|
||||||
bg="white"
|
type="default"
|
||||||
onChange={setKomentar}
|
round
|
||||||
value={komentar}
|
placeholder="Kirim Komentar"
|
||||||
itemRight={
|
bg="white"
|
||||||
<Pressable onPress={() => {
|
onChange={setKomentar}
|
||||||
(komentar != '' && data?.status === 1 && data?.isActive && (memberDiscussion || (entityUser.role != "user" && entityUser.role != "coadmin")))
|
value={komentar}
|
||||||
&& handleKomentar()
|
itemRight={
|
||||||
}}>
|
<Pressable onPress={() => {
|
||||||
<MaterialIcons name="send" size={25} style={(komentar == '' || data?.status === 2 || !data?.isActive || (!memberDiscussion && (entityUser.role == "user" || entityUser.role == "coadmin"))) ? Styles.cGray : Styles.cDefault} />
|
(komentar != '' && data?.status === 1 && data?.isActive && (memberDiscussion || (entityUser.role != "user" && entityUser.role != "coadmin")))
|
||||||
</Pressable>
|
&& handleKomentar()
|
||||||
}
|
}}>
|
||||||
/>
|
<MaterialIcons name="send" size={25} style={(komentar == '' || data?.status === 2 || !data?.isActive || (!memberDiscussion && (entityUser.role == "user" || entityUser.role == "coadmin"))) ? Styles.cGray : Styles.cDefault} />
|
||||||
</View>
|
</Pressable>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
</View >
|
</View >
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export default function AddMemberDiscussionDetail() {
|
|||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
key={index}
|
key={index}
|
||||||
label={item.name}
|
label={item.name}
|
||||||
src={item.img}
|
src={`https://wibu-storage.wibudev.com/api/files/${item.img}`}
|
||||||
onClick={() => onChoose(item.idUser, item.name, item.img)}
|
onClick={() => onChoose(item.idUser, item.name, item.img)}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ export default function CreateDiscussionGeneral() {
|
|||||||
checkForm();
|
checkForm();
|
||||||
}, [error, dataForm]);
|
}, [error, dataForm]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dispatch(setMemberChoose([]))
|
||||||
|
}, [])
|
||||||
|
|
||||||
function handleBack() {
|
function handleBack() {
|
||||||
dispatch(setMemberChoose([]))
|
dispatch(setMemberChoose([]))
|
||||||
@@ -101,9 +104,12 @@ export default function CreateDiscussionGeneral() {
|
|||||||
dispatch(setUpdateDiscussionGeneralDetail(!update))
|
dispatch(setUpdateDiscussionGeneralDetail(!update))
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
||||||
router.back()
|
router.back()
|
||||||
|
} else {
|
||||||
|
Toast.show({ type: 'small', text1: response.message, })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +174,7 @@ export default function CreateDiscussionGeneral() {
|
|||||||
error={error.desc}
|
error={error.desc}
|
||||||
errorText="Diskusi tidak boleh kosong"
|
errorText="Diskusi tidak boleh kosong"
|
||||||
onChange={(val) => { validationForm("desc", val) }}
|
onChange={(val) => { validationForm("desc", val) }}
|
||||||
|
multiline
|
||||||
/>
|
/>
|
||||||
<ButtonSelect
|
<ButtonSelect
|
||||||
value="Pilih Anggota"
|
value="Pilih Anggota"
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ export default function EditDiscussionGeneral() {
|
|||||||
value={dataForm.desc}
|
value={dataForm.desc}
|
||||||
errorText="Diskusi tidak boleh kosong"
|
errorText="Diskusi tidak boleh kosong"
|
||||||
onChange={(val) => validationForm("desc", val)}
|
onChange={(val) => validationForm("desc", val)}
|
||||||
|
multiline
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import DrawerBottom from "@/components/drawerBottom"
|
|||||||
import ImageUser from "@/components/imageNew"
|
import ImageUser from "@/components/imageNew"
|
||||||
import MenuItemRow from "@/components/menuItemRow"
|
import MenuItemRow from "@/components/menuItemRow"
|
||||||
import Skeleton from "@/components/skeleton"
|
import Skeleton from "@/components/skeleton"
|
||||||
|
import Text from "@/components/Text"
|
||||||
import Styles from "@/constants/Styles"
|
import Styles from "@/constants/Styles"
|
||||||
import { apiDeleteCalendarMember, apiGetCalendarOne, apiGetDivisionOneFeature } from "@/lib/api"
|
import { apiDeleteCalendarMember, apiGetCalendarOne, apiGetDivisionOneFeature } from "@/lib/api"
|
||||||
import { setUpdateCalendar } from "@/lib/calendarUpdate"
|
import { setUpdateCalendar } from "@/lib/calendarUpdate"
|
||||||
@@ -13,7 +14,7 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
|||||||
import { MaterialCommunityIcons } from "@expo/vector-icons"
|
import { MaterialCommunityIcons } from "@expo/vector-icons"
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router"
|
import { router, Stack, useLocalSearchParams } from "expo-router"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { SafeAreaView, ScrollView, Text, View } from "react-native"
|
import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native"
|
||||||
import Toast from "react-native-toast-message"
|
import Toast from "react-native-toast-message"
|
||||||
import { useDispatch, useSelector } from "react-redux"
|
import { useDispatch, useSelector } from "react-redux"
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ export default function DetailEventCalendar() {
|
|||||||
const entityUser = useSelector((state: any) => state.user);
|
const entityUser = useSelector((state: any) => state.user);
|
||||||
const [isMemberDivision, setIsMemberDivision] = useState(false);
|
const [isMemberDivision, setIsMemberDivision] = useState(false);
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const arrSkeleton = Array.from({ length: 5 })
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
async function handleCheckMember() {
|
async function handleCheckMember() {
|
||||||
try {
|
try {
|
||||||
@@ -69,9 +70,9 @@ export default function DetailEventCalendar() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad(loading:boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiGetCalendarOne({
|
const response = await apiGetCalendarOne({
|
||||||
user: hasil,
|
user: hasil,
|
||||||
@@ -105,7 +106,7 @@ export default function DetailEventCalendar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad();
|
handleLoad(true);
|
||||||
handleCheckMember()
|
handleCheckMember()
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -133,6 +134,15 @@ export default function DetailEventCalendar() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
handleLoad(false)
|
||||||
|
handleLoadMember()
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -143,7 +153,15 @@ export default function DetailEventCalendar() {
|
|||||||
headerRight: () => (entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision ? <></> : <HeaderRightCalendarDetail id={String(data?.idCalendar)} idReminder={String(detail)} />
|
headerRight: () => (entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision ? <></> : <HeaderRightCalendarDetail id={String(data?.idCalendar)} idReminder={String(detail)} />
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
style={[Styles.h100]}
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15]}>
|
||||||
<View style={[Styles.wrapPaper, Styles.mb15]}>
|
<View style={[Styles.wrapPaper, Styles.mb15]}>
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import { stringToDateTime } from "@/lib/fun_stringToDate";
|
|||||||
import { Stack, router, useLocalSearchParams } from "expo-router";
|
import { Stack, router, useLocalSearchParams } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import {
|
import {
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
View
|
View
|
||||||
@@ -141,94 +143,99 @@ export default function CalendarDivisionCreate() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
<InputForm
|
keyboardVerticalOffset={110}
|
||||||
label="Nama Acara"
|
>
|
||||||
type="default"
|
<ScrollView>
|
||||||
placeholder="Nama Acara"
|
<View style={[Styles.p15]}>
|
||||||
required
|
<InputForm
|
||||||
bg="white"
|
label="Nama Acara"
|
||||||
value={data.title}
|
type="default"
|
||||||
onChange={(val) => validationForm("title", val)}
|
placeholder="Nama Acara"
|
||||||
error={error.title}
|
required
|
||||||
errorText="Nama acara tidak boleh kosong"
|
bg="white"
|
||||||
/>
|
value={data.title}
|
||||||
<InputDate
|
onChange={(val) => validationForm("title", val)}
|
||||||
onChange={(val) => validationForm("dateStart", val)}
|
error={error.title}
|
||||||
mode="date"
|
errorText="Nama acara tidak boleh kosong"
|
||||||
value={data.dateStart}
|
/>
|
||||||
label="Tanggal Acara"
|
<InputDate
|
||||||
required
|
onChange={(val) => validationForm("dateStart", val)}
|
||||||
error={error.dateStart}
|
mode="date"
|
||||||
errorText="Tanggal acara tidak boleh kosong"
|
value={data.dateStart}
|
||||||
placeholder="Pilih Tanggal Acara"
|
label="Tanggal Acara"
|
||||||
/>
|
required
|
||||||
<View style={[Styles.rowSpaceBetween, Styles.mv10]}>
|
error={error.dateStart}
|
||||||
<View style={[{ width: "48%" }]}>
|
errorText="Tanggal acara tidak boleh kosong"
|
||||||
<InputDate
|
placeholder="Pilih Tanggal Acara"
|
||||||
onChange={(val) => validationForm("timeStart", val)}
|
/>
|
||||||
mode="time"
|
<View style={[Styles.rowSpaceBetween, Styles.mv10]}>
|
||||||
value={data.timeStart}
|
<View style={[{ width: "48%" }]}>
|
||||||
label="Waktu Awal"
|
<InputDate
|
||||||
required
|
onChange={(val) => validationForm("timeStart", val)}
|
||||||
error={error.timeStart}
|
mode="time"
|
||||||
errorText="Waktu awal tidak valid"
|
value={data.timeStart}
|
||||||
placeholder="--:--"
|
label="Waktu Awal"
|
||||||
/>
|
required
|
||||||
</View>
|
error={error.timeStart}
|
||||||
<View style={[{ width: "48%" }]}>
|
errorText="Waktu awal tidak valid"
|
||||||
<InputDate
|
placeholder="--:--"
|
||||||
onChange={(val) => validationForm("timeEnd", val)}
|
/>
|
||||||
mode="time"
|
</View>
|
||||||
value={data.timeEnd}
|
<View style={[{ width: "48%" }]}>
|
||||||
label="Waktu Akhir"
|
<InputDate
|
||||||
required
|
onChange={(val) => validationForm("timeEnd", val)}
|
||||||
error={error.timeEnd}
|
mode="time"
|
||||||
errorText="Waktu akhir tidak valid"
|
value={data.timeEnd}
|
||||||
placeholder="--:--"
|
label="Waktu Akhir"
|
||||||
/>
|
required
|
||||||
|
error={error.timeEnd}
|
||||||
|
errorText="Waktu akhir tidak valid"
|
||||||
|
placeholder="--:--"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
<InputForm
|
||||||
|
label="Link Meet"
|
||||||
|
type="default"
|
||||||
|
placeholder="Link Meet"
|
||||||
|
bg="white"
|
||||||
|
value={data.linkMeet}
|
||||||
|
onChange={(val) => validationForm("linkMeet", val)}
|
||||||
|
/>
|
||||||
|
<SelectForm
|
||||||
|
bg="white"
|
||||||
|
label="Ulangi Acara"
|
||||||
|
placeholder="Ulangi Acara"
|
||||||
|
value={choose.label}
|
||||||
|
required
|
||||||
|
onPress={() => { setSelect(true) }}
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="Jumlah Pengulangan"
|
||||||
|
type="numeric"
|
||||||
|
placeholder="Jumlah Pengulangan"
|
||||||
|
required
|
||||||
|
bg="white"
|
||||||
|
value={String(data.repeatValue)}
|
||||||
|
onChange={(val) => validationForm("repeatValue", val)}
|
||||||
|
error={error.repeatValue}
|
||||||
|
errorText="Jumlah pengulangan tidak valid"
|
||||||
|
disable={choose.val == "once"}
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="Deskripsi"
|
||||||
|
type="default"
|
||||||
|
placeholder="Deskripsi"
|
||||||
|
bg="white"
|
||||||
|
value={data.desc}
|
||||||
|
onChange={(val) => validationForm("desc", val)}
|
||||||
|
multiline
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
<InputForm
|
</ScrollView>
|
||||||
label="Link Meet"
|
</KeyboardAvoidingView>
|
||||||
type="default"
|
|
||||||
placeholder="Link Meet"
|
|
||||||
bg="white"
|
|
||||||
value={data.linkMeet}
|
|
||||||
onChange={(val) => validationForm("linkMeet", val)}
|
|
||||||
/>
|
|
||||||
<SelectForm
|
|
||||||
bg="white"
|
|
||||||
label="Ulangi Acara"
|
|
||||||
placeholder="Ulangi Acara"
|
|
||||||
value={choose.label}
|
|
||||||
required
|
|
||||||
onPress={() => { setSelect(true) }}
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="Jumlah Pengulangan"
|
|
||||||
type="numeric"
|
|
||||||
placeholder="Jumlah Pengulangan"
|
|
||||||
required
|
|
||||||
bg="white"
|
|
||||||
value={String(data.repeatValue)}
|
|
||||||
onChange={(val) => validationForm("repeatValue", val)}
|
|
||||||
error={error.repeatValue}
|
|
||||||
errorText="Jumlah pengulangan tidak valid"
|
|
||||||
disable={choose.val == "once"}
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="Deskripsi"
|
|
||||||
type="default"
|
|
||||||
placeholder="Deskripsi"
|
|
||||||
bg="white"
|
|
||||||
value={data.desc}
|
|
||||||
onChange={(val) => validationForm("desc", val)}
|
|
||||||
multiline
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<ModalSelect
|
<ModalSelect
|
||||||
category={"type-event-repeat"}
|
category={"type-event-repeat"}
|
||||||
|
|||||||
@@ -144,7 +144,9 @@ export default function CalendarDivision() {
|
|||||||
refreshing={refreshing}
|
refreshing={refreshing}
|
||||||
onRefresh={handleRefresh}
|
onRefresh={handleRefresh}
|
||||||
/>
|
/>
|
||||||
}>
|
}
|
||||||
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
<View style={[Styles.p15]}>
|
<View style={[Styles.p15]}>
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
<Datepicker
|
<Datepicker
|
||||||
@@ -155,6 +157,13 @@ export default function CalendarDivision() {
|
|||||||
onChange={({ date }) => setSelected(date)}
|
onChange={({ date }) => setSelected(date)}
|
||||||
styles={{
|
styles={{
|
||||||
selected: Styles.selectedDate,
|
selected: Styles.selectedDate,
|
||||||
|
month_label: Styles.cBlack,
|
||||||
|
month_selector_label: Styles.cBlack,
|
||||||
|
year_label: Styles.cBlack,
|
||||||
|
year_selector_label: Styles.cBlack,
|
||||||
|
day_label: Styles.cBlack,
|
||||||
|
time_label: Styles.cBlack,
|
||||||
|
weekday_label: Styles.cBlack,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { Ionicons, MaterialIcons } from "@expo/vector-icons";
|
|||||||
import { firebase } from "@react-native-firebase/database";
|
import { firebase } from "@react-native-firebase/database";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, ScrollView, View } from "react-native";
|
import { KeyboardAvoidingView, Platform, Pressable, RefreshControl, ScrollView, View } from "react-native";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -58,6 +58,7 @@ export default function DiscussionDetail() {
|
|||||||
const [loadingKomentar, setLoadingKomentar] = useState(true)
|
const [loadingKomentar, setLoadingKomentar] = useState(true)
|
||||||
const arrSkeleton = Array.from({ length: 3 })
|
const arrSkeleton = Array.from({ length: 3 })
|
||||||
const reference = firebase.app().database('https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app').ref(`/discussion-division/${detail}`);
|
const reference = firebase.app().database('https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app').ref(`/discussion-division/${detail}`);
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -165,6 +166,15 @@ export default function DiscussionDetail() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
handleLoad(false)
|
||||||
|
handleLoadComment(false)
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -189,7 +199,14 @@ export default function DiscussionDetail() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
{
|
{
|
||||||
loading ?
|
loading ?
|
||||||
@@ -264,63 +281,68 @@ export default function DiscussionDetail() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<View
|
<KeyboardAvoidingView
|
||||||
style={[
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
Styles.contentItemCenter,
|
keyboardVerticalOffset={110}
|
||||||
Styles.absolute0,
|
|
||||||
Styles.w100,
|
|
||||||
{ backgroundColor: "#f4f4f4" },
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
<InputForm
|
<View
|
||||||
disable={
|
style={[
|
||||||
data?.status == 2 ||
|
Styles.contentItemCenter,
|
||||||
data?.isActive == false ||
|
Styles.w100,
|
||||||
((entityUser.role == "user" || entityUser.role == "coadmin") &&
|
{ backgroundColor: "#f4f4f4" },
|
||||||
!isMemberDivision)
|
]}
|
||||||
}
|
>
|
||||||
bg="white"
|
<InputForm
|
||||||
type="default"
|
disable={
|
||||||
round
|
data?.status == 2 ||
|
||||||
placeholder="Kirim Komentar"
|
data?.isActive == false ||
|
||||||
onChange={setKomentar}
|
((entityUser.role == "user" || entityUser.role == "coadmin") &&
|
||||||
value={komentar}
|
!isMemberDivision)
|
||||||
itemRight={
|
}
|
||||||
<Pressable
|
bg="white"
|
||||||
onPress={() => {
|
type="default"
|
||||||
komentar != "" &&
|
round
|
||||||
!loadingSend &&
|
placeholder="Kirim Komentar"
|
||||||
data?.status != 2 &&
|
onChange={setKomentar}
|
||||||
data?.isActive &&
|
value={komentar}
|
||||||
(((entityUser.role == "user" ||
|
itemRight={
|
||||||
entityUser.role == "coadmin") &&
|
<Pressable
|
||||||
isMemberDivision) ||
|
onPress={() => {
|
||||||
entityUser.role == "admin" ||
|
komentar != "" &&
|
||||||
entityUser.role == "supadmin" ||
|
!loadingSend &&
|
||||||
entityUser.role == "developer" ||
|
data?.status != 2 &&
|
||||||
entityUser.role == "cosupadmin") &&
|
data?.isActive &&
|
||||||
handleKomentar();
|
(((entityUser.role == "user" ||
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MaterialIcons
|
|
||||||
name="send"
|
|
||||||
size={25}
|
|
||||||
style={
|
|
||||||
komentar == "" ||
|
|
||||||
loadingSend ||
|
|
||||||
data?.status == 2 ||
|
|
||||||
data?.isActive == false ||
|
|
||||||
((entityUser.role == "user" ||
|
|
||||||
entityUser.role == "coadmin") &&
|
entityUser.role == "coadmin") &&
|
||||||
!isMemberDivision)
|
isMemberDivision) ||
|
||||||
? Styles.cGray
|
entityUser.role == "admin" ||
|
||||||
: Styles.cDefault
|
entityUser.role == "supadmin" ||
|
||||||
}
|
entityUser.role == "developer" ||
|
||||||
/>
|
entityUser.role == "cosupadmin") &&
|
||||||
</Pressable>
|
handleKomentar();
|
||||||
}
|
}}
|
||||||
/>
|
>
|
||||||
</View>
|
<MaterialIcons
|
||||||
|
name="send"
|
||||||
|
size={25}
|
||||||
|
style={
|
||||||
|
komentar == "" ||
|
||||||
|
loadingSend ||
|
||||||
|
data?.status == 2 ||
|
||||||
|
data?.isActive == false ||
|
||||||
|
((entityUser.role == "user" ||
|
||||||
|
entityUser.role == "coadmin") &&
|
||||||
|
!isMemberDivision)
|
||||||
|
? Styles.cGray
|
||||||
|
: Styles.cDefault
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Pressable>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -110,10 +110,6 @@ export default function DocumentDivision() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
handleLoad(true);
|
|
||||||
}, [path, update]);
|
|
||||||
|
|
||||||
const handleCheckboxChange = (index: number) => {
|
const handleCheckboxChange = (index: number) => {
|
||||||
setDariSelectAll(false);
|
setDariSelectAll(false);
|
||||||
if (selectedFiles.some((i: any) => i.id == data[index].id)) {
|
if (selectedFiles.some((i: any) => i.id == data[index].id)) {
|
||||||
@@ -243,6 +239,7 @@ export default function DocumentDivision() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleBatal();
|
handleBatal();
|
||||||
|
handleLoad(false)
|
||||||
}, [update]);
|
}, [update]);
|
||||||
|
|
||||||
async function handleShare(selectedDivision: any[]) {
|
async function handleShare(selectedDivision: any[]) {
|
||||||
@@ -270,7 +267,7 @@ export default function DocumentDivision() {
|
|||||||
|
|
||||||
|
|
||||||
const openFile = (item: Props) => {
|
const openFile = (item: Props) => {
|
||||||
setLoadingOpen(true)
|
if (Platform.OS == 'android') setLoadingOpen(true)
|
||||||
let remoteUrl = 'https://wibu-storage.wibudev.com/api/files/' + item.idStorage;
|
let remoteUrl = 'https://wibu-storage.wibudev.com/api/files/' + item.idStorage;
|
||||||
const fileName = item.name + '.' + item.extension;
|
const fileName = item.name + '.' + item.extension;
|
||||||
let localPath = `${FileSystem.documentDirectory}/${fileName}`;
|
let localPath = `${FileSystem.documentDirectory}/${fileName}`;
|
||||||
@@ -278,9 +275,9 @@ export default function DocumentDivision() {
|
|||||||
|
|
||||||
FileSystem.downloadAsync(remoteUrl, localPath).then(async ({ uri }) => {
|
FileSystem.downloadAsync(remoteUrl, localPath).then(async ({ uri }) => {
|
||||||
const contentURL = await FileSystem.getContentUriAsync(uri);
|
const contentURL = await FileSystem.getContentUriAsync(uri);
|
||||||
|
setLoadingOpen(false)
|
||||||
try {
|
try {
|
||||||
if (Platform.OS == 'android') {
|
if (Platform.OS == 'android') {
|
||||||
// open with android intent
|
|
||||||
await startActivityAsync(
|
await startActivityAsync(
|
||||||
'android.intent.action.VIEW',
|
'android.intent.action.VIEW',
|
||||||
{
|
{
|
||||||
@@ -289,16 +286,13 @@ export default function DocumentDivision() {
|
|||||||
type: mimeType as string,
|
type: mimeType as string,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// or
|
|
||||||
// Sharing.shareAsync(localPath);
|
|
||||||
|
|
||||||
} else if (Platform.OS == 'ios') {
|
} else if (Platform.OS == 'ios') {
|
||||||
Sharing.shareAsync(localPath);
|
Sharing.shareAsync(localPath);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Alert.alert('INFO', 'Gagal membuka file, tidak ada aplikasi yang dapat membuka file ini');
|
Alert.alert('INFO', 'Gagal membuka file, tidak ada aplikasi yang dapat membuka file ini');
|
||||||
} finally {
|
} finally {
|
||||||
setLoadingOpen(false)
|
if (Platform.OS == 'android') setLoadingOpen(false)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -310,6 +304,10 @@ export default function DocumentDivision() {
|
|||||||
setRefreshing(false)
|
setRefreshing(false)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleLoad(true);
|
||||||
|
}, [path]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -351,7 +349,7 @@ export default function DocumentDivision() {
|
|||||||
/>
|
/>
|
||||||
<ModalLoading isVisible={loadingOpen} setVisible={setLoadingOpen} />
|
<ModalLoading isVisible={loadingOpen} setVisible={setLoadingOpen} />
|
||||||
<ScrollView
|
<ScrollView
|
||||||
style={{ height: "100%" }}
|
style={[Styles.h100]}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl
|
<RefreshControl
|
||||||
refreshing={refreshing}
|
refreshing={refreshing}
|
||||||
@@ -375,7 +373,7 @@ export default function DocumentDivision() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{item.id != "home" && (
|
{item.id != "home" && (
|
||||||
<AntDesign name="right" style={[Styles.mh05, Styles.mt02]} />
|
<AntDesign name="right" style={[Styles.mh05, Styles.mt02]} color="black" />
|
||||||
)}
|
)}
|
||||||
<Text> {item.name} </Text>
|
<Text> {item.name} </Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
@@ -538,13 +536,11 @@ export default function DocumentDivision() {
|
|||||||
<DrawerBottom
|
<DrawerBottom
|
||||||
animation="slide"
|
animation="slide"
|
||||||
isVisible={modalMore}
|
isVisible={modalMore}
|
||||||
setVisible={setModalMore}
|
setVisible={() => { setModalMore(false) }}
|
||||||
title=""
|
title=""
|
||||||
>
|
>
|
||||||
<ModalMore
|
<ModalMore
|
||||||
onClose={() => {
|
onClose={() => { setModalMore(false); }}
|
||||||
setModalMore(false);
|
|
||||||
}}
|
|
||||||
data={selectedFiles}
|
data={selectedFiles}
|
||||||
share={shareSelected}
|
share={shareSelected}
|
||||||
/>
|
/>
|
||||||
@@ -553,10 +549,8 @@ export default function DocumentDivision() {
|
|||||||
<ModalFloat
|
<ModalFloat
|
||||||
title="Ganti Nama"
|
title="Ganti Nama"
|
||||||
isVisible={isRename}
|
isVisible={isRename}
|
||||||
setVisible={setRename}
|
setVisible={() => { setRename(false) }}
|
||||||
onSubmit={() => {
|
onSubmit={() => { handleRename() }}
|
||||||
handleRename();
|
|
||||||
}}
|
|
||||||
disableSubmit={bodyRename.name == ""}
|
disableSubmit={bodyRename.name == ""}
|
||||||
>
|
>
|
||||||
<View>
|
<View>
|
||||||
@@ -576,7 +570,7 @@ export default function DocumentDivision() {
|
|||||||
title="Bagikan"
|
title="Bagikan"
|
||||||
category="share-division"
|
category="share-division"
|
||||||
open={isShare}
|
open={isShare}
|
||||||
close={setShare}
|
close={() => { setShare(false) }}
|
||||||
onSelect={(value) => {
|
onSelect={(value) => {
|
||||||
handleShare(value)
|
handleShare(value)
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -36,16 +36,18 @@ export default function TaskDivisionAddFile() {
|
|||||||
const pickDocumentAsync = async () => {
|
const pickDocumentAsync = async () => {
|
||||||
let result = await DocumentPicker.getDocumentAsync({
|
let result = await DocumentPicker.getDocumentAsync({
|
||||||
type: ["*/*"],
|
type: ["*/*"],
|
||||||
multiple: false,
|
multiple: true,
|
||||||
});
|
});
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
if (result.assets?.[0].uri) {
|
for (let i = 0; i < result.assets?.length; i++) {
|
||||||
const check = await handleCheckFile(result.assets?.[0]);
|
if (result.assets?.[i].uri) {
|
||||||
if (check) {
|
const check = await handleCheckFile(result.assets?.[i]);
|
||||||
setFileForm([...fileForm, result.assets?.[0]]);
|
if (check) {
|
||||||
setListFile([...listFile, result.assets?.[0].name]);
|
setFileForm((prev) => [...prev, result.assets?.[i]]);
|
||||||
} else {
|
setListFile((prev) => [...prev, result.assets?.[i].name]);
|
||||||
Toast.show({ type: 'small', text1: 'File sudah ada', })
|
} else {
|
||||||
|
Toast.show({ type: 'small', text1: 'File sudah ada', })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import dayjs from "dayjs";
|
|||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
SafeAreaView,
|
KeyboardAvoidingView, Platform, SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
View
|
View
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
@@ -121,59 +121,65 @@ export default function TaskDivisionAddTask() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
keyboardVerticalOffset={110}
|
||||||
<DateTimePicker
|
>
|
||||||
mode="range"
|
<ScrollView>
|
||||||
startDate={range.startDate}
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
endDate={range.endDate}
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
onChange={(param) => setRange(param)}
|
<DateTimePicker
|
||||||
styles={{
|
mode="range"
|
||||||
selected: Styles.selectedDate,
|
startDate={range.startDate}
|
||||||
selected_label: Styles.cWhite,
|
endDate={range.endDate}
|
||||||
range_fill: Styles.selectRangeDate,
|
onChange={(param) => setRange(param)}
|
||||||
|
styles={{
|
||||||
|
selected: Styles.selectedDate,
|
||||||
|
selected_label: Styles.cWhite,
|
||||||
|
range_fill: Styles.selectRangeDate,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<View style={[Styles.mv10]}>
|
||||||
|
<View style={[Styles.rowSpaceBetween]}>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{from}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{to}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<InputForm
|
||||||
|
label="Judul Tugas"
|
||||||
|
type="default"
|
||||||
|
placeholder="Judul Tugas"
|
||||||
|
required
|
||||||
|
bg="white"
|
||||||
|
value={title}
|
||||||
|
error={error.title}
|
||||||
|
errorText="Judul tidak boleh kosong"
|
||||||
|
onChange={(e) => {
|
||||||
|
onValidation("title", e)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={[Styles.mv10]}>
|
</ScrollView>
|
||||||
<View style={[Styles.rowSpaceBetween]}>
|
</KeyboardAvoidingView>
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{from}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{to}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
{
|
|
||||||
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
|
||||||
}
|
|
||||||
</View>
|
|
||||||
<InputForm
|
|
||||||
label="Judul Tugas"
|
|
||||||
type="default"
|
|
||||||
placeholder="Judul Tugas"
|
|
||||||
required
|
|
||||||
bg="white"
|
|
||||||
value={title}
|
|
||||||
error={error.title}
|
|
||||||
errorText="Judul tidak boleh kosong"
|
|
||||||
onChange={(e) => {
|
|
||||||
onValidation("title", e)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { apiGetTaskOne } from "@/lib/api";
|
|||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { SafeAreaView, ScrollView, View } from "react-native";
|
import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -29,6 +29,7 @@ export default function DetailTaskDivision() {
|
|||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [progress, setProgress] = useState(0)
|
const [progress, setProgress] = useState(0)
|
||||||
const update = useSelector((state: any) => state.taskUpdate)
|
const update = useSelector((state: any) => state.taskUpdate)
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
|
|
||||||
async function handleLoad(cat: 'data' | 'progress') {
|
async function handleLoad(cat: 'data' | 'progress') {
|
||||||
@@ -56,6 +57,14 @@ export default function DetailTaskDivision() {
|
|||||||
handleLoad('progress')
|
handleLoad('progress')
|
||||||
}, [update.progress])
|
}, [update.progress])
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
await handleLoad('data')
|
||||||
|
await handleLoad('progress')
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -66,15 +75,22 @@ export default function DetailTaskDivision() {
|
|||||||
headerRight: () => <HeaderRightTaskDetail id={detail} division={id} status={data?.status} />,
|
headerRight: () => <HeaderRightTaskDetail id={detail} division={id} status={data?.status} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
{
|
{
|
||||||
data?.reason != null && data?.reason != "" && <SectionCancel text={data?.reason} />
|
data?.reason != null && data?.reason != "" && <SectionCancel text={data?.reason} />
|
||||||
}
|
}
|
||||||
<SectionProgress text={`Kemajuan Kegiatan ${progress}%`} progress={progress} />
|
<SectionProgress text={`Kemajuan Kegiatan ${progress}%`} progress={progress} />
|
||||||
<SectionTanggalTugasTask />
|
<SectionTanggalTugasTask refreshing={refreshing}/>
|
||||||
<SectionFileTask />
|
<SectionFileTask refreshing={refreshing}/>
|
||||||
<SectionMemberTask />
|
<SectionMemberTask refreshing={refreshing}/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -52,11 +52,13 @@ export default function CreateTaskDivision() {
|
|||||||
const pickDocumentAsync = async () => {
|
const pickDocumentAsync = async () => {
|
||||||
let result = await DocumentPicker.getDocumentAsync({
|
let result = await DocumentPicker.getDocumentAsync({
|
||||||
type: ["*/*"],
|
type: ["*/*"],
|
||||||
multiple: false
|
multiple: true
|
||||||
});
|
});
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
if (result.assets[0].uri) {
|
for (let i = 0; i < result.assets?.length; i++) {
|
||||||
setFileForm([...fileForm, result.assets[0]])
|
if (result.assets[i].uri) {
|
||||||
|
setFileForm((prev) => [...prev, result.assets[i]])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import dayjs from "dayjs";
|
|||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
View
|
View
|
||||||
@@ -97,59 +99,64 @@ export default function CreateTaskAddTugas() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
keyboardVerticalOffset={110}
|
||||||
<DateTimePicker
|
>
|
||||||
mode="range"
|
<ScrollView>
|
||||||
startDate={range.startDate}
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
endDate={range.endDate}
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
onChange={(param) => setRange(param)}
|
<DateTimePicker
|
||||||
styles={{
|
mode="range"
|
||||||
selected: Styles.selectedDate,
|
startDate={range.startDate}
|
||||||
selected_label: Styles.cWhite,
|
endDate={range.endDate}
|
||||||
range_fill: Styles.selectRangeDate,
|
onChange={(param) => setRange(param)}
|
||||||
|
styles={{
|
||||||
|
selected: Styles.selectedDate,
|
||||||
|
selected_label: Styles.cWhite,
|
||||||
|
range_fill: Styles.selectRangeDate,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<View style={[Styles.mv10]}>
|
||||||
|
<View style={[Styles.rowSpaceBetween]}>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{from}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{to}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<InputForm
|
||||||
|
label="Judul Tugas"
|
||||||
|
type="default"
|
||||||
|
placeholder="Judul Tugas"
|
||||||
|
required
|
||||||
|
bg="white"
|
||||||
|
value={title}
|
||||||
|
error={error.title}
|
||||||
|
errorText="Judul tidak boleh kosong"
|
||||||
|
onChange={(e) => {
|
||||||
|
onValidation("title", e)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={[Styles.mv10]}>
|
</ScrollView>
|
||||||
<View style={[Styles.rowSpaceBetween]}>
|
</KeyboardAvoidingView>
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{from}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{to}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
{
|
|
||||||
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
|
||||||
}
|
|
||||||
</View>
|
|
||||||
<InputForm
|
|
||||||
label="Judul Tugas"
|
|
||||||
type="default"
|
|
||||||
placeholder="Judul Tugas"
|
|
||||||
required
|
|
||||||
bg="white"
|
|
||||||
value={title}
|
|
||||||
error={error.title}
|
|
||||||
errorText="Judul tidak boleh kosong"
|
|
||||||
onChange={(e) => {
|
|
||||||
onValidation("title", e)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ export default function ListTask() {
|
|||||||
:
|
:
|
||||||
data.length > 0 ? (
|
data.length > 0 ? (
|
||||||
isList ? (
|
isList ? (
|
||||||
<View>
|
<View style={[Styles.h100]}>
|
||||||
<VirtualizedList
|
<VirtualizedList
|
||||||
data={data}
|
data={data}
|
||||||
getItemCount={() => data.length}
|
getItemCount={() => data.length}
|
||||||
@@ -241,7 +241,7 @@ export default function ListTask() {
|
|||||||
))} */}
|
))} */}
|
||||||
</View>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
<View>
|
<View style={[Styles.h100]}>
|
||||||
<VirtualizedList
|
<VirtualizedList
|
||||||
data={data}
|
data={data}
|
||||||
getItemCount={() => data.length}
|
getItemCount={() => data.length}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import dayjs from "dayjs";
|
|||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
View
|
View
|
||||||
@@ -39,9 +41,9 @@ export default function UpdateProjectTaskDivision() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const from = range.startDate
|
const from = range.startDate
|
||||||
? dayjs(range.startDate).format("MMM DD, YYYY")
|
? dayjs(range.startDate).format("DD-MM-YYYY")
|
||||||
: "";
|
: "";
|
||||||
const to = range.endDate ? dayjs(range.endDate).format("MMM DD, YYYY") : "";
|
const to = range.endDate ? dayjs(range.endDate).format("DD-MM-YYYY") : "";
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
try {
|
try {
|
||||||
@@ -141,65 +143,71 @@ export default function UpdateProjectTaskDivision() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
keyboardVerticalOffset={110}
|
||||||
{!loading && (
|
>
|
||||||
<DateTimePicker
|
<ScrollView>
|
||||||
mode="range"
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
startDate={range.startDate}
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
endDate={range.endDate}
|
{!loading && (
|
||||||
onChange={(param) => setRange(param)}
|
<DateTimePicker
|
||||||
month={month}
|
mode="range"
|
||||||
year={year}
|
startDate={range.startDate}
|
||||||
styles={{
|
endDate={range.endDate}
|
||||||
selected: Styles.selectedDate,
|
onChange={(param) => setRange(param)}
|
||||||
selected_label: Styles.cWhite,
|
month={month}
|
||||||
range_fill: Styles.selectRangeDate,
|
year={year}
|
||||||
}}
|
styles={{
|
||||||
/>
|
selected: Styles.selectedDate,
|
||||||
)}
|
selected_label: Styles.cWhite,
|
||||||
</View>
|
range_fill: Styles.selectRangeDate,
|
||||||
<View style={[Styles.mv10]}>
|
}}
|
||||||
<View style={[Styles.rowSpaceBetween]}>
|
/>
|
||||||
<View style={[{ width: "48%" }]}>
|
)}
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{from}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{to}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
{(error.endDate || error.startDate) && (
|
<View style={[Styles.mv10]}>
|
||||||
<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]} >
|
<View style={[Styles.rowSpaceBetween]}>
|
||||||
Tanggal tidak boleh kosong
|
<View style={[{ width: "48%" }]}>
|
||||||
</Text>
|
<Text style={[Styles.mb05]}>
|
||||||
)}
|
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{from}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{to}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{(error.endDate || error.startDate) && (
|
||||||
|
<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]} >
|
||||||
|
Tanggal tidak boleh kosong
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
<InputForm
|
||||||
|
label="Judul Tugas"
|
||||||
|
type="default"
|
||||||
|
placeholder="Judul Tugas"
|
||||||
|
required
|
||||||
|
bg="white"
|
||||||
|
value={title}
|
||||||
|
error={error.title}
|
||||||
|
errorText="Judul tidak boleh kosong"
|
||||||
|
onChange={(e) => {
|
||||||
|
onValidation("title", e)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
<InputForm
|
</ScrollView>
|
||||||
label="Judul Tugas"
|
</KeyboardAvoidingView>
|
||||||
type="default"
|
|
||||||
placeholder="Judul Tugas"
|
|
||||||
required
|
|
||||||
bg="white"
|
|
||||||
value={title}
|
|
||||||
error={error.title}
|
|
||||||
errorText="Judul tidak boleh kosong"
|
|
||||||
onChange={(e) => {
|
|
||||||
onValidation("title", e)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export default function AddMemberDivision() {
|
|||||||
<ImageWithLabel
|
<ImageWithLabel
|
||||||
key={index}
|
key={index}
|
||||||
label={item.name}
|
label={item.name}
|
||||||
src={item.img}
|
src={`https://wibu-storage.wibudev.com/api/files/${item.img}`}
|
||||||
onClick={() => onChoose(item.idUser, item.name, item.img)}
|
onClick={() => onChoose(item.idUser, item.name, item.img)}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -134,11 +134,11 @@ export default function InformationDivision() {
|
|||||||
headerRight: () => <HeaderRightDivisionInfo id={id} active={dataDetail?.isActive} />,
|
headerRight: () => <HeaderRightDivisionInfo id={id} active={dataDetail?.isActive} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView style={[Styles.h100]}>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15]}>
|
||||||
{
|
{
|
||||||
dataDetail?.isActive == false && (
|
dataDetail?.isActive == false && (
|
||||||
<SectionCancel title={'Divisi dinonaktifkan'} />
|
<SectionCancel title={'Divisi nonaktif'} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<View style={[Styles.mb15]}>
|
<View style={[Styles.mb15]}>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import InputSearch from "@/components/inputSearch";
|
|||||||
import PaperGridContent from "@/components/paperGridContent";
|
import PaperGridContent from "@/components/paperGridContent";
|
||||||
import Skeleton from "@/components/skeleton";
|
import Skeleton from "@/components/skeleton";
|
||||||
import SkeletonTwoItem from "@/components/skeletonTwoItem";
|
import SkeletonTwoItem from "@/components/skeletonTwoItem";
|
||||||
|
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 { apiGetDivision } from "@/lib/api";
|
import { apiGetDivision } from "@/lib/api";
|
||||||
@@ -18,7 +19,6 @@ import {
|
|||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, RefreshControl, View, VirtualizedList } from "react-native";
|
import { Pressable, RefreshControl, View, VirtualizedList } from "react-native";
|
||||||
import Text from "@/components/Text";
|
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -218,7 +218,7 @@ export default function ListDivision() {
|
|||||||
</View>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
isList ? (
|
isList ? (
|
||||||
<View style={[Styles.mb50]}>
|
<View style={[Styles.h100]}>
|
||||||
<VirtualizedList
|
<VirtualizedList
|
||||||
data={data}
|
data={data}
|
||||||
style={[{ paddingBottom: 100 }]}
|
style={[{ paddingBottom: 100 }]}
|
||||||
@@ -253,7 +253,7 @@ export default function ListDivision() {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
<View>
|
<View style={[Styles.h100]}>
|
||||||
<VirtualizedList
|
<VirtualizedList
|
||||||
data={data}
|
data={data}
|
||||||
style={[{ paddingBottom: 100 }]}
|
style={[{ paddingBottom: 100 }]}
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ 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: true,
|
allowsEditing: false,
|
||||||
quality: 1,
|
quality: 1,
|
||||||
aspect: [1, 1],
|
aspect: [1, 1],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -112,32 +112,33 @@ export default function Index() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<ScrollView
|
<View style={[Styles.p15]}>
|
||||||
refreshControl={
|
<View style={[Styles.wrapBtnTab]}>
|
||||||
<RefreshControl
|
<ButtonTab
|
||||||
refreshing={refreshing}
|
active={status == "false" ? "false" : "true"}
|
||||||
onRefresh={handleRefresh}
|
value="true"
|
||||||
/>
|
onPress={() => { setStatus("true") }}
|
||||||
}
|
label="Aktif"
|
||||||
>
|
icon={<Feather name="check-circle" color={status == "true" ? 'white' : 'black'} size={20} />}
|
||||||
<View style={[Styles.p15]}>
|
n={2} />
|
||||||
<View style={[Styles.wrapBtnTab]}>
|
<ButtonTab
|
||||||
<ButtonTab
|
active={status == "false" ? "false" : "true"}
|
||||||
active={status == "false" ? "false" : "true"}
|
value="false"
|
||||||
value="true"
|
onPress={() => { setStatus("false") }}
|
||||||
onPress={() => { setStatus("true") }}
|
label="Tidak Aktif"
|
||||||
label="Aktif"
|
icon={<AntDesign name="closecircleo" color={status == "false" ? 'white' : 'black'} size={20} />}
|
||||||
icon={<Feather name="check-circle" color={status == "true" ? 'white' : 'black'} size={20} />}
|
n={2} />
|
||||||
n={2} />
|
</View>
|
||||||
<ButtonTab
|
<InputSearch onChange={setSearch} />
|
||||||
active={status == "false" ? "false" : "true"}
|
<ScrollView
|
||||||
value="false"
|
refreshControl={
|
||||||
onPress={() => { setStatus("false") }}
|
<RefreshControl
|
||||||
label="Tidak Aktif"
|
refreshing={refreshing}
|
||||||
icon={<AntDesign name="closecircleo" color={status == "false" ? 'white' : 'black'} size={20} />}
|
onRefresh={handleRefresh}
|
||||||
n={2} />
|
/>
|
||||||
</View>
|
}
|
||||||
<InputSearch onChange={setSearch} />
|
style={[Styles.h100]}
|
||||||
|
>
|
||||||
<View>
|
<View>
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -173,8 +174,8 @@ export default function Index() {
|
|||||||
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</ScrollView>
|
||||||
</ScrollView>
|
</View>
|
||||||
|
|
||||||
<DrawerBottom animation="slide" isVisible={isModal} setVisible={() => setModal(false)} title={titleChoose}>
|
<DrawerBottom animation="slide" isVisible={isModal} setVisible={() => setModal(false)} title={titleChoose}>
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
@@ -203,7 +204,7 @@ export default function Index() {
|
|||||||
</View>
|
</View>
|
||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
|
|
||||||
<DrawerBottom animation="none" height={30} isVisible={isVisibleEdit} setVisible={() => setVisibleEdit(false)} title="Edit Lembaga Desa">
|
<DrawerBottom animation="none" keyboard height={30} isVisible={isVisibleEdit} setVisible={() => setVisibleEdit(false)} title="Edit Lembaga Desa">
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<View>
|
<View>
|
||||||
<InputForm type="default" placeholder="Nama Lembaga Desa" required label="Lembaga Desa" value={titleChoose} onChange={setTitleChoose} />
|
<InputForm type="default" placeholder="Nama Lembaga Desa" required label="Lembaga Desa" value={titleChoose} onChange={setTitleChoose} />
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Styles from "@/constants/Styles";
|
|||||||
import { apiGetProfile } from "@/lib/api";
|
import { apiGetProfile } from "@/lib/api";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { SafeAreaView, ScrollView, View } from "react-native";
|
import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -34,10 +34,11 @@ export default function MemberDetail() {
|
|||||||
const [isEdit, setEdit] = useState(true)
|
const [isEdit, setEdit] = useState(true)
|
||||||
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 [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad(loading: boolean) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(loading)
|
||||||
const response = await apiGetProfile({ id: id })
|
const response = await apiGetProfile({ id: id })
|
||||||
setData(response.data)
|
setData(response.data)
|
||||||
setEdit(valueRoleUser.filter((v) => v.login == entityUser.role)[0]?.data.some((i: any) => i.id == response.data.idUserRole))
|
setEdit(valueRoleUser.filter((v) => v.login == entityUser.role)[0]?.data.some((i: any) => i.id == response.data.idUserRole))
|
||||||
@@ -50,9 +51,17 @@ export default function MemberDetail() {
|
|||||||
|
|
||||||
|
|
||||||
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
|
||||||
@@ -64,48 +73,54 @@ export default function MemberDetail() {
|
|||||||
headerShadowVisible: false
|
headerShadowVisible: false
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
<View style={{ flexDirection: 'column' }}>
|
style={[Styles.h100]}
|
||||||
<View style={[Styles.wrapHeadViewMember]}>
|
refreshControl={
|
||||||
{
|
<RefreshControl
|
||||||
loading ?
|
refreshing={refreshing}
|
||||||
<>
|
onRefresh={handleRefresh}
|
||||||
<Skeleton width={100} height={100} borderRadius={100} />
|
/>
|
||||||
<Skeleton width={200} height={10} borderRadius={5} />
|
}
|
||||||
<Skeleton width={150} height={10} borderRadius={5} />
|
>
|
||||||
</>
|
<View style={[Styles.wrapHeadViewMember,]}>
|
||||||
:
|
{
|
||||||
<>
|
loading ?
|
||||||
<ImageUser src={`https://wibu-storage.wibudev.com/api/files/${data?.img}`} size="lg" />
|
<>
|
||||||
<Text style={[Styles.textSubtitle, Styles.cWhite, Styles.mt10]}>{data?.name}</Text>
|
<Skeleton width={100} height={100} borderRadius={100} />
|
||||||
<Text style={[Styles.textMediumNormal, Styles.cWhite]}>{data?.role}</Text>
|
<Skeleton width={200} height={10} borderRadius={5} />
|
||||||
</>
|
<Skeleton width={150} height={10} borderRadius={5} />
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
<ImageUser src={`https://wibu-storage.wibudev.com/api/files/${data?.img}`} size="lg" />
|
||||||
|
<Text style={[Styles.textSubtitle, Styles.cWhite, Styles.mt10]}>{data?.name}</Text>
|
||||||
|
<Text style={[Styles.textMediumNormal, Styles.cWhite]}>{data?.role}</Text>
|
||||||
|
</>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
</View>
|
||||||
|
<View style={[Styles.p15]}>
|
||||||
|
<View style={[Styles.rowSpaceBetween]}>
|
||||||
|
<Text style={[Styles.textDefaultSemiBold]}>Informasi</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={[Styles.p15]}>
|
{
|
||||||
<View style={[Styles.rowSpaceBetween]}>
|
loading ?
|
||||||
<Text style={[Styles.textDefaultSemiBold]}>Informasi</Text>
|
arrSkeleton.map((item, index) => {
|
||||||
</View>
|
return (
|
||||||
{
|
<Skeleton key={index} width={100} widthType="percent" height={25} borderRadius={5} />
|
||||||
loading ?
|
)
|
||||||
arrSkeleton.map((item, index) => {
|
})
|
||||||
return (
|
:
|
||||||
<Skeleton key={index} width={100} widthType="percent" height={25} borderRadius={5} />
|
<>
|
||||||
)
|
<ItemDetailMember category="nik" value={data?.nik} />
|
||||||
})
|
<ItemDetailMember category="group" value={data?.group} />
|
||||||
:
|
<ItemDetailMember category="position" value={data?.position} />
|
||||||
<>
|
<ItemDetailMember category="phone" value={`+62${data?.phone}`} />
|
||||||
<ItemDetailMember category="nik" value={data?.nik} />
|
<ItemDetailMember category="email" value={data?.email} />
|
||||||
<ItemDetailMember category="group" value={data?.group} />
|
<ItemDetailMember category="gender" value={data?.gender == "F" ? "Perempuan" : "Laki-Laki"} />
|
||||||
<ItemDetailMember category="position" value={data?.position} />
|
</>
|
||||||
<ItemDetailMember category="phone" value={`+62${data?.phone}`} />
|
}
|
||||||
<ItemDetailMember category="email" value={data?.email} />
|
|
||||||
<ItemDetailMember category="gender" value={data?.gender == "F" ? "Perempuan" : "Laki-Laki"} />
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ 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,
|
||||||
@@ -34,6 +36,7 @@ export default function CreateMember() {
|
|||||||
const [chooseGender, setChooseGender] = useState({ val: "", label: "" });
|
const [chooseGender, setChooseGender] = useState({ val: "", label: "" });
|
||||||
const [selectedImage, setSelectedImage] = useState<string | undefined>(undefined);
|
const [selectedImage, setSelectedImage] = useState<string | undefined>(undefined);
|
||||||
const entityUser = useSelector((state: any) => state.user);
|
const entityUser = useSelector((state: any) => state.user);
|
||||||
|
const entities = useSelector((state: any) => state.entities)
|
||||||
const [isSelect, setSelect] = useState(false);
|
const [isSelect, setSelect] = useState(false);
|
||||||
const [disableBtn, setDisableBtn] = useState(true)
|
const [disableBtn, setDisableBtn] = useState(true)
|
||||||
const [valChoose, setValChoose] = useState("")
|
const [valChoose, setValChoose] = useState("")
|
||||||
@@ -140,6 +143,12 @@ export default function CreateMember() {
|
|||||||
checkForm()
|
checkForm()
|
||||||
}, [error, dataForm])
|
}, [error, dataForm])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(entityUser.role !="supadmin" && entityUser.role != "developer"){
|
||||||
|
validationForm("group", entities.idGroup, entities.group)
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
@@ -160,7 +169,7 @@ export default function CreateMember() {
|
|||||||
fd.append("file", "undefined")
|
fd.append("file", "undefined")
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await apiCreateUser(fd)
|
const response = await apiCreateUser({data: fd})
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
||||||
dispatch(setUpdateMember(!update))
|
dispatch(setUpdateMember(!update))
|
||||||
@@ -177,7 +186,7 @@ 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: true,
|
allowsEditing: false,
|
||||||
quality: 1,
|
quality: 1,
|
||||||
aspect: [1, 1],
|
aspect: [1, 1],
|
||||||
});
|
});
|
||||||
@@ -213,132 +222,139 @@ export default function CreateMember() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
style={[Styles.h100]}
|
||||||
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
{selectedImage != undefined ? (
|
keyboardVerticalOffset={110}
|
||||||
<Pressable onPress={pickImageAsync}>
|
>
|
||||||
<Image src={selectedImage} style={[Styles.userProfileBig]} />
|
<ScrollView>
|
||||||
</Pressable>
|
<View style={[Styles.p15]}>
|
||||||
) : (
|
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
||||||
<Pressable
|
{selectedImage != undefined ? (
|
||||||
onPress={pickImageAsync}
|
<Pressable onPress={pickImageAsync}>
|
||||||
style={[Styles.iconContent, ColorsStatus.gray]}
|
<Image src={selectedImage} style={[Styles.userProfileBig]} />
|
||||||
>
|
</Pressable>
|
||||||
<MaterialCommunityIcons
|
) : (
|
||||||
name="account-tie"
|
<Pressable
|
||||||
size={100}
|
onPress={pickImageAsync}
|
||||||
color={"gray"}
|
style={[Styles.iconContent, ColorsStatus.gray]}
|
||||||
|
>
|
||||||
|
<MaterialCommunityIcons
|
||||||
|
name="account-tie"
|
||||||
|
size={100}
|
||||||
|
color={"gray"}
|
||||||
|
/>
|
||||||
|
</Pressable>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
{(entityUser.role == "supadmin" ||
|
||||||
|
entityUser.role == "developer") && (
|
||||||
|
<SelectForm
|
||||||
|
label="Lembaga Desa"
|
||||||
|
placeholder="Pilih Lembaga Desa"
|
||||||
|
value={chooseGroup.label}
|
||||||
|
required
|
||||||
|
onPress={() => {
|
||||||
|
setValChoose(chooseGroup.val);
|
||||||
|
setValSelect("group");
|
||||||
|
setSelect(true);
|
||||||
|
}}
|
||||||
|
error={error.group}
|
||||||
|
errorText="Lembaga Desa tidak boleh kosong"
|
||||||
/>
|
/>
|
||||||
</Pressable>
|
)}
|
||||||
)}
|
<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"
|
||||||
|
/>
|
||||||
|
<SelectForm
|
||||||
|
label="User Role"
|
||||||
|
placeholder="Pilih Role"
|
||||||
|
value={chooseRole.label}
|
||||||
|
required
|
||||||
|
onPress={() => {
|
||||||
|
setValChoose(chooseRole.val);
|
||||||
|
setValSelect("role");
|
||||||
|
setSelect(true);
|
||||||
|
}}
|
||||||
|
error={error.role}
|
||||||
|
errorText="Role tidak boleh kosong"
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="NIK"
|
||||||
|
type="numeric"
|
||||||
|
placeholder="NIK"
|
||||||
|
required
|
||||||
|
error={error.nik}
|
||||||
|
errorText="NIK Harus 16 Karakter"
|
||||||
|
onChange={val => {
|
||||||
|
validationForm("nik", val)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="Nama"
|
||||||
|
type="default"
|
||||||
|
placeholder="Nama"
|
||||||
|
required
|
||||||
|
error={error.name}
|
||||||
|
errorText="Nama tidak boleh kosong"
|
||||||
|
onChange={val => {
|
||||||
|
validationForm("name", val)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
label="Email"
|
||||||
|
type="default"
|
||||||
|
placeholder="Email"
|
||||||
|
required
|
||||||
|
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>}
|
||||||
|
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>
|
||||||
{(entityUser.role == "supadmin" ||
|
</ScrollView>
|
||||||
entityUser.role == "developer") && (
|
</KeyboardAvoidingView>
|
||||||
<SelectForm
|
|
||||||
label="Lembaga Desa"
|
|
||||||
placeholder="Pilih Lembaga Desa"
|
|
||||||
value={chooseGroup.label}
|
|
||||||
required
|
|
||||||
onPress={() => {
|
|
||||||
setValChoose(chooseGroup.val);
|
|
||||||
setValSelect("group");
|
|
||||||
setSelect(true);
|
|
||||||
}}
|
|
||||||
error={error.group}
|
|
||||||
errorText="Lembaga Desa tidak boleh kosong"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<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"
|
|
||||||
/>
|
|
||||||
<SelectForm
|
|
||||||
label="User Role"
|
|
||||||
placeholder="Pilih Role"
|
|
||||||
value={chooseRole.label}
|
|
||||||
required
|
|
||||||
onPress={() => {
|
|
||||||
setValChoose(chooseRole.val);
|
|
||||||
setValSelect("role");
|
|
||||||
setSelect(true);
|
|
||||||
}}
|
|
||||||
error={error.role}
|
|
||||||
errorText="Role tidak boleh kosong"
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="NIK"
|
|
||||||
type="numeric"
|
|
||||||
placeholder="NIK"
|
|
||||||
required
|
|
||||||
error={error.nik}
|
|
||||||
errorText="NIK Harus 16 Karakter"
|
|
||||||
onChange={val => {
|
|
||||||
validationForm("nik", val)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="Nama"
|
|
||||||
type="default"
|
|
||||||
placeholder="Nama"
|
|
||||||
required
|
|
||||||
error={error.name}
|
|
||||||
errorText="Nama tidak boleh kosong"
|
|
||||||
onChange={val => {
|
|
||||||
validationForm("name", val)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<InputForm
|
|
||||||
label="Email"
|
|
||||||
type="default"
|
|
||||||
placeholder="Email"
|
|
||||||
required
|
|
||||||
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>}
|
|
||||||
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}
|
||||||
close={setSelect}
|
close={() => { setSelect(false) }}
|
||||||
onSelect={(value) => {
|
onSelect={(value) => {
|
||||||
validationForm(valSelect, value.val, value.label);
|
validationForm(valSelect, value.val, value.label);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import { router, Stack, useLocalSearchParams } 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,
|
||||||
@@ -210,7 +212,7 @@ 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: true,
|
allowsEditing: false,
|
||||||
quality: 1,
|
quality: 1,
|
||||||
aspect: [1, 1],
|
aspect: [1, 1],
|
||||||
});
|
});
|
||||||
@@ -249,131 +251,138 @@ export default function EditMember() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<KeyboardAvoidingView
|
||||||
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
style={[Styles.h100]}
|
||||||
{
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
errorImg ?
|
keyboardVerticalOffset={110}
|
||||||
<Pressable onPress={pickImageAsync}>
|
>
|
||||||
{
|
<ScrollView>
|
||||||
<Image
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
source={errorImg ? require("../../../../assets/images/user.jpg") : { uri: `https://wibu-storage.wibudev.com/api/files/${data?.img}` }}
|
<View style={{ justifyContent: "center", alignItems: "center" }}>
|
||||||
style={[Styles.userProfileBig]}
|
{
|
||||||
onError={() => { setErrorImg(true) }}
|
errorImg ?
|
||||||
/>
|
|
||||||
}
|
|
||||||
</Pressable>
|
|
||||||
:
|
|
||||||
selectedImage != undefined ? (
|
|
||||||
<Pressable onPress={pickImageAsync}>
|
<Pressable onPress={pickImageAsync}>
|
||||||
<Image
|
{
|
||||||
src={
|
<Image
|
||||||
typeof selectedImage === "string"
|
source={errorImg ? require("../../../../assets/images/user.jpg") : { uri: `https://wibu-storage.wibudev.com/api/files/${data?.img}` }}
|
||||||
? selectedImage
|
style={[Styles.userProfileBig]}
|
||||||
: selectedImage.uri
|
onError={() => { setErrorImg(true) }}
|
||||||
}
|
/>
|
||||||
style={[Styles.userProfileBig]}
|
}
|
||||||
onError={() => { setErrorImg(true) }}
|
|
||||||
/>
|
|
||||||
</Pressable>
|
</Pressable>
|
||||||
) : (
|
:
|
||||||
<Image
|
selectedImage != undefined ? (
|
||||||
source={require("../../../../assets/images/user.jpg")}
|
<Pressable onPress={pickImageAsync}>
|
||||||
style={[Styles.userProfileBig]}
|
<Image
|
||||||
/>
|
src={
|
||||||
)
|
typeof selectedImage === "string"
|
||||||
}
|
? selectedImage
|
||||||
|
: selectedImage.uri
|
||||||
|
}
|
||||||
|
style={[Styles.userProfileBig]}
|
||||||
|
onError={() => { setErrorImg(true) }}
|
||||||
|
/>
|
||||||
|
</Pressable>
|
||||||
|
) : (
|
||||||
|
<Image
|
||||||
|
source={require("../../../../assets/images/user.jpg")}
|
||||||
|
style={[Styles.userProfileBig]}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</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"
|
||||||
|
/>
|
||||||
|
<SelectForm
|
||||||
|
label="User Role"
|
||||||
|
placeholder="Pilih Role"
|
||||||
|
value={chooseRole.label}
|
||||||
|
required
|
||||||
|
onPress={() => {
|
||||||
|
setValChoose(chooseRole.val);
|
||||||
|
setValSelect("role");
|
||||||
|
setSelect(true);
|
||||||
|
}}
|
||||||
|
error={error.role}
|
||||||
|
errorText="Role 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>
|
</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"
|
|
||||||
/>
|
|
||||||
<SelectForm
|
|
||||||
label="User Role"
|
|
||||||
placeholder="Pilih Role"
|
|
||||||
value={chooseRole.label}
|
|
||||||
required
|
|
||||||
onPress={() => {
|
|
||||||
setValChoose(chooseRole.val);
|
|
||||||
setValSelect("role");
|
|
||||||
setSelect(true);
|
|
||||||
}}
|
|
||||||
error={error.role}
|
|
||||||
errorText="Role 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}
|
||||||
|
|||||||
@@ -131,38 +131,38 @@ export default function Index() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<ScrollView
|
<View style={[Styles.p15]}>
|
||||||
style={{ height: '100%' }}
|
<View style={[Styles.wrapBtnTab]}>
|
||||||
refreshControl={
|
<ButtonTab
|
||||||
<RefreshControl
|
active={status == "false" ? "false" : "true"}
|
||||||
refreshing={refreshing}
|
value="true"
|
||||||
onRefresh={handleRefresh}
|
onPress={() => { setStatus("true") }}
|
||||||
/>
|
label="Aktif"
|
||||||
}>
|
icon={<Feather name="check-circle" color={status == "true" ? 'white' : 'black'} size={20} />}
|
||||||
<View style={[Styles.p15]}>
|
n={2} />
|
||||||
<View style={[Styles.wrapBtnTab]}>
|
<ButtonTab
|
||||||
<ButtonTab
|
active={status == "false" ? "false" : "true"}
|
||||||
active={status == "false" ? "false" : "true"}
|
value="false"
|
||||||
value="true"
|
onPress={() => { setStatus("false") }}
|
||||||
onPress={() => { setStatus("true") }}
|
label="Tidak Aktif"
|
||||||
label="Aktif"
|
icon={<AntDesign name="closecircleo" color={status == "false" ? 'white' : 'black'} size={20} />}
|
||||||
icon={<Feather name="check-circle" color={status == "true" ? 'white' : 'black'} size={20} />}
|
n={2} />
|
||||||
n={2} />
|
</View>
|
||||||
<ButtonTab
|
<InputSearch onChange={setSearch} />
|
||||||
active={status == "false" ? "false" : "true"}
|
{
|
||||||
value="false"
|
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
||||||
onPress={() => { setStatus("false") }}
|
<View style={[Styles.mv05]}>
|
||||||
label="Tidak Aktif"
|
<Text>Filter : {nameGroup}</Text>
|
||||||
icon={<AntDesign name="closecircleo" color={status == "false" ? 'white' : 'black'} size={20} />}
|
|
||||||
n={2} />
|
|
||||||
</View>
|
</View>
|
||||||
<InputSearch onChange={setSearch} />
|
}
|
||||||
{
|
<ScrollView
|
||||||
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
style={[Styles.h100]}
|
||||||
<View style={[Styles.mv05]}>
|
refreshControl={
|
||||||
<Text>Filter : {nameGroup}</Text>
|
<RefreshControl
|
||||||
</View>
|
refreshing={refreshing}
|
||||||
}
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}>
|
||||||
<View>
|
<View>
|
||||||
{
|
{
|
||||||
loading ?
|
loading ?
|
||||||
@@ -193,8 +193,8 @@ export default function Index() {
|
|||||||
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
|
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</ScrollView>
|
||||||
</ScrollView>
|
</View>
|
||||||
|
|
||||||
<DrawerBottom animation="slide" isVisible={isModal} setVisible={() => setModal(false)} title={chooseData.name}>
|
<DrawerBottom animation="slide" isVisible={isModal} setVisible={() => setModal(false)} title={chooseData.name}>
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
@@ -224,7 +224,7 @@ export default function Index() {
|
|||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
|
|
||||||
|
|
||||||
<DrawerBottom animation="none" height={30} backdropPressable={false} isVisible={isVisibleEdit} setVisible={() => setVisibleEdit(false)} title="Edit Jabatan">
|
<DrawerBottom animation="none" keyboard height={30} backdropPressable={false} isVisible={isVisibleEdit} setVisible={() => setVisibleEdit(false)} title="Edit Jabatan">
|
||||||
<View style={{ justifyContent: 'space-between', flex: 1 }}>
|
<View style={{ justifyContent: 'space-between', flex: 1 }}>
|
||||||
<View>
|
<View>
|
||||||
<InputForm
|
<InputForm
|
||||||
|
|||||||
@@ -30,16 +30,19 @@ export default function ProjectAddFile() {
|
|||||||
const pickDocumentAsync = async () => {
|
const pickDocumentAsync = async () => {
|
||||||
let result = await DocumentPicker.getDocumentAsync({
|
let result = await DocumentPicker.getDocumentAsync({
|
||||||
type: ["*/*"],
|
type: ["*/*"],
|
||||||
multiple: false
|
multiple: true
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
if (result.assets?.[0].uri) {
|
for (let i = 0; i < result.assets?.length; i++) {
|
||||||
const check = await handleCheckFile(result.assets?.[0])
|
if (result.assets?.[i].uri) {
|
||||||
if (check) {
|
const check = await handleCheckFile(result.assets?.[i])
|
||||||
setFileForm([...fileForm, result.assets?.[0]])
|
if (check) {
|
||||||
setListFile([...listFile, result.assets?.[0].name])
|
setFileForm((prev) => [...prev, result.assets?.[i]])
|
||||||
} else {
|
setListFile((prev) => [...prev, result.assets?.[i].name])
|
||||||
Toast.show({ type: 'small', text1: 'File sudah ada', })
|
} else {
|
||||||
|
Toast.show({ type: 'small', text1: 'File yg telah terupload tidak bisa diupload ulang', })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import dayjs from "dayjs";
|
|||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
View
|
View
|
||||||
@@ -101,59 +103,64 @@ export default function ProjectAddTask() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
keyboardVerticalOffset={110}
|
||||||
<DateTimePicker
|
>
|
||||||
mode="range"
|
<ScrollView>
|
||||||
startDate={range.startDate}
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
endDate={range.endDate}
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
onChange={(param) => setRange(param)}
|
<DateTimePicker
|
||||||
styles={{
|
mode="range"
|
||||||
selected: Styles.selectedDate,
|
startDate={range.startDate}
|
||||||
selected_label: Styles.cWhite,
|
endDate={range.endDate}
|
||||||
range_fill: Styles.selectRangeDate,
|
onChange={(param) => setRange(param)}
|
||||||
|
styles={{
|
||||||
|
selected: Styles.selectedDate,
|
||||||
|
selected_label: Styles.cWhite,
|
||||||
|
range_fill: Styles.selectRangeDate,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<View style={[Styles.mv10]}>
|
||||||
|
<View style={[Styles.rowSpaceBetween]}>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{from}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{to}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<InputForm
|
||||||
|
label="Judul Tugas"
|
||||||
|
type="default"
|
||||||
|
placeholder="Judul Tugas"
|
||||||
|
required
|
||||||
|
bg="white"
|
||||||
|
value={title}
|
||||||
|
error={error.title}
|
||||||
|
errorText="Judul tidak boleh kosong"
|
||||||
|
onChange={(e) => {
|
||||||
|
onValidation("title", e)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={[Styles.mv10]}>
|
</ScrollView>
|
||||||
<View style={[Styles.rowSpaceBetween]}>
|
</KeyboardAvoidingView>
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{from}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{to}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
{
|
|
||||||
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
|
||||||
}
|
|
||||||
</View>
|
|
||||||
<InputForm
|
|
||||||
label="Judul Tugas"
|
|
||||||
type="default"
|
|
||||||
placeholder="Judul Tugas"
|
|
||||||
required
|
|
||||||
bg="white"
|
|
||||||
value={title}
|
|
||||||
error={error.title}
|
|
||||||
errorText="Judul tidak boleh kosong"
|
|
||||||
onChange={(e) => {
|
|
||||||
onValidation("title", e)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { apiGetProjectOne } from "@/lib/api";
|
|||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { SafeAreaView, ScrollView, View } from "react-native";
|
import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
|
|
||||||
@@ -37,6 +37,7 @@ export default function DetailProject() {
|
|||||||
const update = useSelector((state: any) => state.projectUpdate)
|
const update = useSelector((state: any) => state.projectUpdate)
|
||||||
const [isMember, setIsMember] = useState(false)
|
const [isMember, setIsMember] = useState(false)
|
||||||
const entityUser = useSelector((state: any) => state.user)
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
|
|
||||||
async function handleLoad(cat: 'data' | 'progress') {
|
async function handleLoad(cat: 'data' | 'progress') {
|
||||||
try {
|
try {
|
||||||
@@ -79,6 +80,14 @@ export default function DetailProject() {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
await handleLoad('data')
|
||||||
|
await handleLoad('progress')
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
setRefreshing(false)
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -89,15 +98,22 @@ export default function DetailProject() {
|
|||||||
headerRight: () => (entityUser.role == "user" || entityUser.role == "coadmin") && !isMember ? null : <HeaderRightProjectDetail id={id} status={data?.status} />,
|
headerRight: () => (entityUser.role == "user" || entityUser.role == "coadmin") && !isMember ? null : <HeaderRightProjectDetail id={id} status={data?.status} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
{
|
{
|
||||||
data?.reason != null && data?.reason != "" && <SectionCancel text={data?.reason} />
|
data?.reason != null && data?.reason != "" && <SectionCancel text={data?.reason} />
|
||||||
}
|
}
|
||||||
<SectionProgress text={`Kemajuan Kegiatan ${progress}%`} progress={progress} />
|
<SectionProgress text={`Kemajuan Kegiatan ${progress}%`} progress={progress} />
|
||||||
<SectionTanggalTugasProject status={data?.status} member={isMember} />
|
<SectionTanggalTugasProject status={data?.status} member={isMember} refreshing={refreshing}/>
|
||||||
<SectionFile status={data?.status} member={isMember} />
|
<SectionFile status={data?.status} member={isMember} refreshing={refreshing} />
|
||||||
<SectionMember status={data?.status} />
|
<SectionMember status={data?.status} refreshing={refreshing} />
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -146,11 +146,13 @@ export default function CreateProject() {
|
|||||||
const pickDocumentAsync = async () => {
|
const pickDocumentAsync = async () => {
|
||||||
let result = await DocumentPicker.getDocumentAsync({
|
let result = await DocumentPicker.getDocumentAsync({
|
||||||
type: ["*/*"],
|
type: ["*/*"],
|
||||||
multiple: false
|
multiple: true
|
||||||
});
|
});
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
if (result.assets[0].uri) {
|
for (let i = 0; i < result.assets?.length; i++) {
|
||||||
setFileForm([...fileForm, result.assets[0]])
|
if (result.assets[i].uri) {
|
||||||
|
setFileForm((prev) => [...prev, result.assets[i]])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import dayjs from "dayjs";
|
|||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
View
|
View
|
||||||
@@ -97,59 +99,64 @@ export default function CreateProjectAddTask() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
keyboardVerticalOffset={110}
|
||||||
<DateTimePicker
|
>
|
||||||
mode="range"
|
<ScrollView>
|
||||||
startDate={range.startDate}
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
endDate={range.endDate}
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
onChange={(param) => setRange(param)}
|
<DateTimePicker
|
||||||
styles={{
|
mode="range"
|
||||||
selected: Styles.selectedDate,
|
startDate={range.startDate}
|
||||||
selected_label: Styles.cWhite,
|
endDate={range.endDate}
|
||||||
range_fill: Styles.selectRangeDate,
|
onChange={(param) => setRange(param)}
|
||||||
|
styles={{
|
||||||
|
selected: Styles.selectedDate,
|
||||||
|
selected_label: Styles.cWhite,
|
||||||
|
range_fill: Styles.selectRangeDate,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<View style={[Styles.mv10]}>
|
||||||
|
<View style={[Styles.rowSpaceBetween]}>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{from}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[{ width: "48%" }]}>
|
||||||
|
<Text style={[Styles.mb05]}>
|
||||||
|
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
||||||
|
</Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: "center" }}>{to}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<InputForm
|
||||||
|
label="Judul Tugas"
|
||||||
|
type="default"
|
||||||
|
placeholder="Judul Tugas"
|
||||||
|
required
|
||||||
|
bg="white"
|
||||||
|
value={title}
|
||||||
|
error={error.title}
|
||||||
|
errorText="Judul tidak boleh kosong"
|
||||||
|
onChange={(e) => {
|
||||||
|
onValidation("title", e)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={[Styles.mv10]}>
|
</ScrollView>
|
||||||
<View style={[Styles.rowSpaceBetween]}>
|
</KeyboardAvoidingView>
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Mulai <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{from}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View style={[{ width: "48%" }]}>
|
|
||||||
<Text style={[Styles.mb05]}>
|
|
||||||
Tanggal Berakhir <Text style={Styles.cError}>*</Text>
|
|
||||||
</Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: "center" }}>{to}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
{
|
|
||||||
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
|
||||||
}
|
|
||||||
</View>
|
|
||||||
<InputForm
|
|
||||||
label="Judul Tugas"
|
|
||||||
type="default"
|
|
||||||
placeholder="Judul Tugas"
|
|
||||||
required
|
|
||||||
bg="white"
|
|
||||||
value={title}
|
|
||||||
error={error.title}
|
|
||||||
errorText="Judul tidak boleh kosong"
|
|
||||||
onChange={(e) => {
|
|
||||||
onValidation("title", e)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export default function ListProject() {
|
|||||||
data.length > 0
|
data.length > 0
|
||||||
?
|
?
|
||||||
isList ? (
|
isList ? (
|
||||||
<View>
|
<View style={[Styles.h100]}>
|
||||||
<VirtualizedList
|
<VirtualizedList
|
||||||
data={data}
|
data={data}
|
||||||
getItemCount={() => data.length}
|
getItemCount={() => data.length}
|
||||||
@@ -280,7 +280,7 @@ export default function ListProject() {
|
|||||||
} */}
|
} */}
|
||||||
</View>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
<View>
|
<View style={[Styles.h100]}>
|
||||||
<VirtualizedList
|
<VirtualizedList
|
||||||
data={data}
|
data={data}
|
||||||
getItemCount={() => data.length}
|
getItemCount={() => data.length}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { SafeAreaView, ScrollView, View } from "react-native";
|
import { KeyboardAvoidingView, Platform, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
import DateTimePicker, { DateType } from "react-native-ui-datepicker";
|
import DateTimePicker, { DateType } from "react-native-ui-datepicker";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
@@ -114,63 +114,68 @@ export default function UpdateProjectTask() {
|
|||||||
/>
|
/>
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<KeyboardAvoidingView
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
keyboardVerticalOffset={110}
|
||||||
{
|
>
|
||||||
!loading
|
<ScrollView>
|
||||||
&&
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
<DateTimePicker
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
mode="range"
|
{
|
||||||
startDate={range.startDate}
|
!loading
|
||||||
endDate={range.endDate}
|
&&
|
||||||
onChange={(param) => setRange(param)}
|
<DateTimePicker
|
||||||
// styles={defaultStyles}
|
mode="range"
|
||||||
month={month}
|
startDate={range.startDate}
|
||||||
year={year}
|
endDate={range.endDate}
|
||||||
styles={{
|
onChange={(param) => setRange(param)}
|
||||||
selected: Styles.selectedDate,
|
// styles={defaultStyles}
|
||||||
selected_label: Styles.cWhite,
|
month={month}
|
||||||
range_fill: Styles.selectRangeDate,
|
year={year}
|
||||||
}}
|
styles={{
|
||||||
/>
|
selected: Styles.selectedDate,
|
||||||
}
|
selected_label: Styles.cWhite,
|
||||||
|
range_fill: Styles.selectRangeDate,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
</View>
|
|
||||||
<View style={[Styles.mv10]}>
|
|
||||||
<View style={[Styles.rowSpaceBetween]}>
|
|
||||||
<View style={[{ width: '48%' }]}>
|
|
||||||
<Text style={[Styles.mb05]}>Tanggal Mulai <Text style={Styles.cError}>*</Text></Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: 'center' }}>{from}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View style={[{ width: '48%' }]}>
|
|
||||||
<Text style={[Styles.mb05]}>Tanggal Berakhir <Text style={Styles.cError}>*</Text></Text>
|
|
||||||
<View style={[Styles.wrapPaper, Styles.p10]}>
|
|
||||||
<Text style={{ textAlign: 'center' }}>{to}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
{
|
<View style={[Styles.mv10]}>
|
||||||
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
<View style={[Styles.rowSpaceBetween]}>
|
||||||
}
|
<View style={[{ width: '48%' }]}>
|
||||||
|
<Text style={[Styles.mb05]}>Tanggal Mulai <Text style={Styles.cError}>*</Text></Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: 'center' }}>{from}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[{ width: '48%' }]}>
|
||||||
|
<Text style={[Styles.mb05]}>Tanggal Berakhir <Text style={Styles.cError}>*</Text></Text>
|
||||||
|
<View style={[Styles.wrapPaper, Styles.p10]}>
|
||||||
|
<Text style={{ textAlign: 'center' }}>{to}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>Tanggal tidak boleh kosong</Text>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<InputForm
|
||||||
|
label="Judul Tugas"
|
||||||
|
type="default"
|
||||||
|
placeholder="Judul Tugas"
|
||||||
|
required
|
||||||
|
bg="white"
|
||||||
|
value={title}
|
||||||
|
error={error.title}
|
||||||
|
errorText="Judul tidak boleh kosong"
|
||||||
|
onChange={(e) => {
|
||||||
|
onValidation("title", e)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
<InputForm
|
</ScrollView>
|
||||||
label="Judul Tugas"
|
</KeyboardAvoidingView>
|
||||||
type="default"
|
|
||||||
placeholder="Judul Tugas"
|
|
||||||
required
|
|
||||||
bg="white"
|
|
||||||
value={title}
|
|
||||||
error={error.title}
|
|
||||||
errorText="Judul tidak boleh kosong"
|
|
||||||
onChange={(e) => {
|
|
||||||
onValidation("title", e)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@ export default function ButtonTab({ active, value, onPress, label, n, icon }: Pr
|
|||||||
return (
|
return (
|
||||||
<TouchableOpacity style={[Styles.btnTab, (active == value) && ColorsStatus.orange, { width: n == 2 ? '50%' : 'auto' }]} onPress={() => { onPress() }}>
|
<TouchableOpacity style={[Styles.btnTab, (active == value) && ColorsStatus.orange, { width: n == 2 ? '50%' : 'auto' }]} onPress={() => { onPress() }}>
|
||||||
{icon}
|
{icon}
|
||||||
<Text style={[Styles.textMediumSemiBold, Styles.ml10, { color: active == value ? 'white' : 'black' }]}>{label}</Text>
|
<Text numberOfLines={1} style={[Styles.textMediumSemiBold, Styles.ml10, { color: active == value ? 'white' : 'black' }]}>{label}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,9 @@ export default function HeaderDiscussionGeneral() {
|
|||||||
title="Filter"
|
title="Filter"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setVisible(false)
|
setVisible(false)
|
||||||
setFilter(true)
|
setTimeout(() => {
|
||||||
|
setFilter(true)
|
||||||
|
}, 600)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ export default function HeaderRightDivisionList() {
|
|||||||
title="Filter"
|
title="Filter"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setVisible(false)
|
setVisible(false)
|
||||||
setFilter(true)
|
setTimeout(() => {
|
||||||
|
setFilter(true)
|
||||||
|
}, 600);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,11 +23,12 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const update = useSelector((state: any) => state.dokumenUpdate)
|
const update = useSelector((state: any) => state.dokumenUpdate)
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleCreateFolder() {
|
async function handleCreateFolder() {
|
||||||
try {
|
try {
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiCreateFolderDocument({ user: hasil, name, path, idDivision: id })
|
const response = await apiCreateFolderDocument({ data: { user: hasil, name, path, idDivision: id } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil membuat folder baru', })
|
Toast.show({ type: 'small', text1: 'Berhasil membuat folder baru', })
|
||||||
dispatch(setUpdateDokumen(!update))
|
dispatch(setUpdateDokumen(!update))
|
||||||
@@ -56,6 +57,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
|
|
||||||
async function handleUploadFile(file: any) {
|
async function handleUploadFile(file: any) {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const fd = new FormData()
|
const fd = new FormData()
|
||||||
fd.append("file", {
|
fd.append("file", {
|
||||||
@@ -85,6 +87,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
} finally {
|
} finally {
|
||||||
setVisible(false)
|
setVisible(false)
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +102,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
<DrawerBottom
|
<DrawerBottom
|
||||||
animation="slide"
|
animation="slide"
|
||||||
isVisible={isVisible}
|
isVisible={isVisible}
|
||||||
setVisible={setVisible}
|
setVisible={() => { setVisible(false) }}
|
||||||
title="Menu"
|
title="Menu"
|
||||||
>
|
>
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
@@ -111,10 +114,12 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
size={25}
|
size={25}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
title="Tambah Dokumen"
|
title="Tambah Folder"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
setNewFolder(true);
|
setTimeout(() => {
|
||||||
|
setNewFolder(true);
|
||||||
|
}, 600);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -128,11 +133,9 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
<ModalFloat
|
<ModalFloat
|
||||||
title="Buat Folder Baru"
|
title="Buat Folder Baru"
|
||||||
isVisible={newFolder}
|
isVisible={newFolder}
|
||||||
setVisible={setNewFolder}
|
setVisible={() => { setNewFolder(false) }}
|
||||||
disableSubmit={name == ""}
|
disableSubmit={name == ""}
|
||||||
onSubmit={() => {
|
onSubmit={() => { handleCreateFolder() }}
|
||||||
handleCreateFolder()
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<View>
|
<View>
|
||||||
<InputForm
|
<InputForm
|
||||||
@@ -140,9 +143,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
placeholder="Nama Folder"
|
placeholder="Nama Folder"
|
||||||
required
|
required
|
||||||
label="Nama Folder"
|
label="Nama Folder"
|
||||||
onChange={(value: string) => {
|
onChange={(value: string) => { setName(value) }}
|
||||||
setName(value);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</ModalFloat>
|
</ModalFloat>
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ import { apiGetDocumentInformasi } from "@/lib/api";
|
|||||||
import { useAuthSession } from "@/providers/AuthProvider";
|
import { useAuthSession } from "@/providers/AuthProvider";
|
||||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Pressable, ScrollView, View } from "react-native";
|
import { ActivityIndicator, Pressable, ScrollView, View } from "react-native";
|
||||||
import { useSharedValue } from "react-native-reanimated";
|
import { useSharedValue } from "react-native-reanimated";
|
||||||
import ItemAccordion from "../itemAccordion";
|
import ItemAccordion from "../itemAccordion";
|
||||||
import ItemDetailMember from "../itemDetailMember";
|
import ItemDetailMember from "../itemDetailMember";
|
||||||
|
import ModalLoading from "../modalLoading";
|
||||||
import Text from "../Text";
|
import Text from "../Text";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -29,9 +30,11 @@ export default function ModalInformasi({ data }: { data: any }) {
|
|||||||
const [dataInformasi, setDataInformasi] = useState<Props>()
|
const [dataInformasi, setDataInformasi] = useState<Props>()
|
||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const [dataShare, setDataShare] = useState<PropsShare[]>([])
|
const [dataShare, setDataShare] = useState<PropsShare[]>([])
|
||||||
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
async function handleInformasi() {
|
async function handleInformasi() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDocumentInformasi({ user: hasil, item: data.id, cat: 'lainnya' })
|
const response = await apiGetDocumentInformasi({ user: hasil, item: data.id, cat: 'lainnya' })
|
||||||
setDataInformasi(response.data)
|
setDataInformasi(response.data)
|
||||||
@@ -40,6 +43,8 @@ export default function ModalInformasi({ data }: { data: any }) {
|
|||||||
setDataShare(responseShare.data)
|
setDataShare(responseShare.data)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,39 +64,47 @@ export default function ModalInformasi({ data }: { data: any }) {
|
|||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View>
|
{
|
||||||
<ItemDetailMember category="dokumen" value={dataInformasi?.category == 'FOLDER' ? dataInformasi?.name : `${dataInformasi?.name}.${dataInformasi?.extension}`} border />
|
loading ? (
|
||||||
<ItemDetailMember category="type" value={dataInformasi?.category} border />
|
<View>
|
||||||
<ItemDetailMember category="location" value={dataInformasi?.path} border />
|
<ActivityIndicator size="large" />
|
||||||
<ItemDetailMember category="owner" value={dataInformasi?.division} border />
|
|
||||||
<ItemDetailMember category="calendar" value={dataInformasi?.createdAt} border />
|
|
||||||
<Pressable style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.wrapItemBorderBottom]} onPress={() => { open.value = !open.value; }}>
|
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
|
||||||
<MaterialCommunityIcons name="share-variant-outline" size={22} color="black" style={[Styles.mr10]} />
|
|
||||||
<Text style={[Styles.textDefault]}>Telah dibagikan ke divisi</Text>
|
|
||||||
</View>
|
</View>
|
||||||
<MaterialCommunityIcons name="chevron-down" size={22} color="black" />
|
) : (
|
||||||
</Pressable>
|
<View>
|
||||||
<ItemAccordion isExpanded={open} viewKey="Accordion" duration={500}>
|
<ItemDetailMember category="dokumen" value={dataInformasi?.category == 'FOLDER' ? dataInformasi?.name : `${dataInformasi?.name}.${dataInformasi?.extension}`} border />
|
||||||
<ScrollView style={[Styles.w100, { height: 200 }]} >
|
<ItemDetailMember category="type" value={dataInformasi?.category} border />
|
||||||
{
|
<ItemDetailMember category="location" value={dataInformasi?.path} border />
|
||||||
dataShare.length > 0 ? (
|
<ItemDetailMember category="owner" value={dataInformasi?.division} border />
|
||||||
dataShare.map((item, index) => (
|
<ItemDetailMember category="calendar" value={dataInformasi?.createdAt} border />
|
||||||
<View key={index} style={[Styles.rowOnly, Styles.ml10, Styles.mt02]}>
|
<Pressable style={[Styles.rowSpaceBetween, Styles.rowItemsCenter, Styles.wrapItemBorderBottom]} onPress={() => { open.value = !open.value; }}>
|
||||||
<MaterialCommunityIcons name="account-group-outline" size={22} color="black" style={[Styles.mr10]} />
|
<View style={[Styles.rowItemsCenter]}>
|
||||||
<Text style={[Styles.textDefault]}>{item.name}</Text>
|
<MaterialCommunityIcons name="share-variant-outline" size={22} color="black" style={[Styles.mr10]} />
|
||||||
</View>
|
<Text style={[Styles.textDefault]}>Telah dibagikan ke divisi</Text>
|
||||||
))
|
</View>
|
||||||
)
|
<MaterialCommunityIcons name="chevron-down" size={22} color="black" />
|
||||||
: (
|
</Pressable>
|
||||||
<View style={[Styles.ml10, Styles.mt02]}>
|
<ItemAccordion isExpanded={open} viewKey="Accordion" duration={500}>
|
||||||
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
|
<ScrollView style={[Styles.w100, { height: 200 }]} >
|
||||||
</View>
|
{
|
||||||
)
|
dataShare.length > 0 ? (
|
||||||
}
|
dataShare.map((item, index) => (
|
||||||
</ScrollView>
|
<View key={index} style={[Styles.rowOnly, Styles.ml10, Styles.mt02]}>
|
||||||
</ItemAccordion>
|
<MaterialCommunityIcons name="account-group-outline" size={22} color="black" style={[Styles.mr10]} />
|
||||||
</View>
|
<Text style={[Styles.textDefault]}>{item.name}</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
)
|
||||||
|
: (
|
||||||
|
<View style={[Styles.ml10, Styles.mt02]}>
|
||||||
|
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</ScrollView>
|
||||||
|
</ItemAccordion>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ export default function ModalMore({
|
|||||||
<DrawerBottom
|
<DrawerBottom
|
||||||
animation="slide"
|
animation="slide"
|
||||||
isVisible={isInformasi}
|
isVisible={isInformasi}
|
||||||
setVisible={setInformasi}
|
setVisible={() => setInformasi(false)}
|
||||||
title="Informasi Dokumen"
|
title="Informasi Dokumen"
|
||||||
height={80}
|
height={80}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
|||||||
import { AntDesign, Ionicons } from "@expo/vector-icons"
|
import { AntDesign, Ionicons } from "@expo/vector-icons"
|
||||||
import { useLocalSearchParams } from "expo-router"
|
import { useLocalSearchParams } from "expo-router"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { Pressable, Text, View } from "react-native"
|
import { Pressable, View } from "react-native"
|
||||||
import BorderBottomItem from "../borderBottomItem"
|
import BorderBottomItem from "../borderBottomItem"
|
||||||
import DrawerBottom from "../drawerBottom"
|
import DrawerBottom from "../drawerBottom"
|
||||||
|
import Text from "../Text"
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
open: boolean
|
open: boolean
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { MaterialIcons } from "@expo/vector-icons";
|
import { MaterialIcons } from "@expo/vector-icons";
|
||||||
import { Pressable, View } from "react-native";
|
import { Dimensions, KeyboardAvoidingView, Platform, Pressable, View } from "react-native";
|
||||||
import Text from "./Text";
|
|
||||||
import Modal from 'react-native-modal';
|
import Modal from 'react-native-modal';
|
||||||
|
import Text from "./Text";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isVisible: boolean
|
isVisible: boolean
|
||||||
@@ -12,28 +12,15 @@ type Props = {
|
|||||||
animation?: 'slide' | 'none' | 'fade'
|
animation?: 'slide' | 'none' | 'fade'
|
||||||
height?: number
|
height?: number
|
||||||
backdropPressable?: boolean
|
backdropPressable?: boolean
|
||||||
|
keyboard?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DrawerBottom({ isVisible, setVisible, title, children, animation, height, backdropPressable = true }: Props) {
|
export default function DrawerBottom({ isVisible, setVisible, title, children, animation, height, backdropPressable = true, keyboard = false }: Props) {
|
||||||
return (
|
const tinggiScreen = Dimensions.get("window").height;
|
||||||
// <Modal
|
const tinggiInput = height != undefined ? height : 25
|
||||||
// animationType={animation}
|
const tinggiFix = tinggiScreen * tinggiInput / 100;
|
||||||
// transparent={true} visible={isVisible}>
|
|
||||||
// <View style={[Styles.modalBgTransparant]}>
|
|
||||||
// <View style={[Styles.modalContent, height != undefined && { height: `${height}%` }]}>
|
|
||||||
// <View style={Styles.titleContainer}>
|
|
||||||
// <Text style={Styles.textDefault}>{title}</Text>
|
|
||||||
// <Pressable onPress={() => setVisible(false)}>
|
|
||||||
// <MaterialIcons name="close" color="black" size={22} />
|
|
||||||
// </Pressable>
|
|
||||||
// </View>
|
|
||||||
// <View style={Styles.contentContainer}>
|
|
||||||
// {children}
|
|
||||||
// </View>
|
|
||||||
// </View>
|
|
||||||
// </View>
|
|
||||||
// </Modal>
|
|
||||||
|
|
||||||
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
animationIn={"slideInUp"}
|
animationIn={"slideInUp"}
|
||||||
animationOut={"slideOutDown"}
|
animationOut={"slideOutDown"}
|
||||||
@@ -49,17 +36,37 @@ export default function DrawerBottom({ isVisible, setVisible, title, children, a
|
|||||||
backdropTransitionOutTiming={500}
|
backdropTransitionOutTiming={500}
|
||||||
useNativeDriverForBackdrop={true}
|
useNativeDriverForBackdrop={true}
|
||||||
>
|
>
|
||||||
<View style={[Styles.modalContentNew, height != undefined ? { height: `${height}%` } : { height: '25%' }]}>
|
{
|
||||||
<View style={[Styles.titleContainerNew]}>
|
keyboard ?
|
||||||
<Text style={Styles.textDefault}>{title}</Text>
|
<KeyboardAvoidingView
|
||||||
<Pressable onPress={() => setVisible(false)}>
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
<MaterialIcons name="close" color="black" size={22} />
|
keyboardVerticalOffset={0}
|
||||||
</Pressable>
|
>
|
||||||
</View>
|
<View style={[Styles.modalContentNew, { height: tinggiFix }]}>
|
||||||
<View style={Styles.contentContainer}>
|
<View style={[Styles.titleContainerNew]}>
|
||||||
{children}
|
<Text style={Styles.textDefault}>{title}</Text>
|
||||||
</View>
|
<Pressable onPress={() => setVisible(false)}>
|
||||||
</View>
|
<MaterialIcons name="close" color="black" size={22} />
|
||||||
|
</Pressable>
|
||||||
|
</View>
|
||||||
|
<View style={Styles.contentContainer}>
|
||||||
|
{children}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
:
|
||||||
|
<View style={[Styles.modalContentNew, { height: tinggiFix }]}>
|
||||||
|
<View style={[Styles.titleContainerNew]}>
|
||||||
|
<Text style={Styles.textDefault}>{title}</Text>
|
||||||
|
<Pressable onPress={() => setVisible(false)}>
|
||||||
|
<MaterialIcons name="close" color="black" size={22} />
|
||||||
|
</Pressable>
|
||||||
|
</View>
|
||||||
|
<View style={Styles.contentContainer}>
|
||||||
|
{children}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ export default function HeaderRightGroupList() {
|
|||||||
</View>
|
</View>
|
||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
|
|
||||||
<DrawerBottom animation="none" height={30} isVisible={isVisibleTambah} setVisible={() => setVisibleTambah(false)} title="Tambah Lembaga Desa">
|
<DrawerBottom animation="none" keyboard height={30} isVisible={isVisibleTambah} setVisible={() => setVisibleTambah(false)} title="Tambah Lembaga Desa">
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<View>
|
<View>
|
||||||
<InputForm
|
<InputForm
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ type Props = {
|
|||||||
export function InputDate({ label, value, placeholder, onChange, info, disable, error, errorText, required, mode, round, width, }: Props) {
|
export function InputDate({ label, value, placeholder, onChange, info, disable, error, errorText, required, mode, round, width, }: Props) {
|
||||||
const [modal, setModal] = useState(false);
|
const [modal, setModal] = useState(false);
|
||||||
|
|
||||||
const onChangeDate = ({ type }: { type: string }, selectedDate: any) => {
|
const onChangeDate = (type: string, selectedDate: any) => {
|
||||||
if (type === "set") {
|
if (type === "set") {
|
||||||
if (mode == "date") {
|
if (mode == "date") {
|
||||||
onChange(dayjs(selectedDate).format("DD-MM-YYYY"))
|
onChange(dayjs(selectedDate).format("DD-MM-YYYY"))
|
||||||
@@ -60,10 +60,10 @@ export function InputDate({ label, value, placeholder, onChange, info, disable,
|
|||||||
{
|
{
|
||||||
modal && (
|
modal && (
|
||||||
<DateTimePicker
|
<DateTimePicker
|
||||||
value={value ? stringToDate(value) : new Date()}
|
value={new Date()}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
display="default"
|
display="default"
|
||||||
onChange={onChangeDate}
|
onChange={(event, date) => { onChangeDate(event.type, date) }}
|
||||||
onTouchCancel={() => setModal(false)}
|
onTouchCancel={() => setModal(false)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function HeaderMemberList() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||||
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={setVisible} title="Menu">
|
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={() => setVisible(false)} title="Menu">
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
icon={<AntDesign name="pluscircle" color="black" size={25} />}
|
icon={<AntDesign name="pluscircle" color="black" size={25} />}
|
||||||
@@ -34,7 +34,9 @@ export default function HeaderMemberList() {
|
|||||||
title="Filter"
|
title="Filter"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setVisible(false)
|
setVisible(false)
|
||||||
setFilter(true)
|
setTimeout(() => {
|
||||||
|
setFilter(true)
|
||||||
|
}, 600)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DrawerBottom animation="none" isVisible={open} setVisible={close} title={title} height={(category == 'gender' || category == 'status-task') ? 25 : category == 'member' ? 100 : 75}>
|
<DrawerBottom animation="none" isVisible={open} setVisible={close} title={title} height={(category == 'gender' || category == 'status-task') ? 25 : category == 'member' ? 90 : 75}>
|
||||||
{
|
{
|
||||||
category == 'member' &&
|
category == 'member' &&
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export default function HeaderRightPositionList() {
|
|||||||
</View>
|
</View>
|
||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
|
|
||||||
<DrawerBottom animation="slide" height={45} isVisible={isVisibleTambah} setVisible={() => setVisibleTambah(false)} title="Tambah Jabatan">
|
<DrawerBottom animation="slide" height={45} keyboard isVisible={isVisibleTambah} setVisible={() => setVisibleTambah(false)} title="Tambah Jabatan">
|
||||||
<View style={{ flex: 1, justifyContent: 'space-between' }}>
|
<View style={{ flex: 1, justifyContent: 'space-between' }}>
|
||||||
<View>
|
<View>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ export default function HeaderRightProjectList() {
|
|||||||
title="Filter"
|
title="Filter"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setVisible(false)
|
setVisible(false)
|
||||||
setFilter(true)
|
setTimeout(() => {
|
||||||
|
setFilter(true)
|
||||||
|
}, 600)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ type Props = {
|
|||||||
idStorage: string
|
idStorage: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function SectionFile({ status, member }: { status: number | undefined, member: boolean }) {
|
export default function SectionFile({ status, member, refreshing }: { status: number | undefined, member: boolean, refreshing?: boolean }) {
|
||||||
const entityUser = useSelector((state: any) => state.user)
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
const [isModal, setModal] = useState(false)
|
const [isModal, setModal] = useState(false)
|
||||||
const { token, decryptToken } = useAuthSession();
|
const { token, decryptToken } = useAuthSession();
|
||||||
@@ -62,6 +62,11 @@ export default function SectionFile({ status, member }: { status: number | undef
|
|||||||
handleLoad(false);
|
handleLoad(false);
|
||||||
}, [update.file]);
|
}, [update.file]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (refreshing)
|
||||||
|
handleLoad(false);
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad(true);
|
handleLoad(true);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ type Props = {
|
|||||||
position: string;
|
position: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function SectionMember({ status }: { status: number | undefined }) {
|
export default function SectionMember({ status, refreshing }: { status: number | undefined, refreshing?: boolean }) {
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const entityUser = useSelector((state: any) => state.user)
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
const update = useSelector((state: any) => state.projectUpdate)
|
const update = useSelector((state: any) => state.projectUpdate)
|
||||||
@@ -62,6 +62,11 @@ export default function SectionMember({ status }: { status: number | undefined }
|
|||||||
handleLoad(false);
|
handleLoad(false);
|
||||||
}, [update.member]);
|
}, [update.member]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (refreshing)
|
||||||
|
handleLoad(false);
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad(true);
|
handleLoad(true);
|
||||||
}, []);
|
}, []);
|
||||||
@@ -75,7 +80,7 @@ export default function SectionMember({ status }: { status: number | undefined }
|
|||||||
}, id)
|
}, id)
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus anggota', })
|
Toast.show({ type: 'small', text1: 'Berhasil menghapus anggota', })
|
||||||
dispatch(setUpdateProject({ ...update, member: !update.progress }))
|
dispatch(setUpdateProject({ ...update, member: !update.member }))
|
||||||
setModal(false);
|
setModal(false);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ type Props = {
|
|||||||
createdAt: string;
|
createdAt: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function SectionTanggalTugasProject({ status, member }: { status: number | undefined, member: boolean }) {
|
export default function SectionTanggalTugasProject({ status, member, refreshing }: { status: number | undefined, member: boolean, refreshing?: boolean }) {
|
||||||
const entityUser = useSelector((state: any) => state.user)
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const update = useSelector((state: any) => state.projectUpdate)
|
const update = useSelector((state: any) => state.projectUpdate)
|
||||||
@@ -63,6 +63,11 @@ export default function SectionTanggalTugasProject({ status, member }: { status:
|
|||||||
handleLoad(false);
|
handleLoad(false);
|
||||||
}, [update.task]);
|
}, [update.task]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (refreshing)
|
||||||
|
handleLoad(false);
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad(true);
|
handleLoad(true);
|
||||||
}, []);
|
}, []);
|
||||||
@@ -163,7 +168,9 @@ export default function SectionTanggalTugasProject({ status, member }: { status:
|
|||||||
title="Update Status"
|
title="Update Status"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setModal(false);
|
setModal(false);
|
||||||
setSelect(true);
|
setTimeout(() => {
|
||||||
|
setSelect(true);
|
||||||
|
}, 600)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
@@ -198,7 +205,7 @@ export default function SectionTanggalTugasProject({ status, member }: { status:
|
|||||||
|
|
||||||
<ModalSelect
|
<ModalSelect
|
||||||
category="status-task"
|
category="status-task"
|
||||||
close={setSelect}
|
close={() => { setSelect(false) }}
|
||||||
onSelect={(value) => {
|
onSelect={(value) => {
|
||||||
handleUpdate(Number(value.val))
|
handleUpdate(Number(value.val))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ type Props = {
|
|||||||
idStorage: string
|
idStorage: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function SectionFileTask() {
|
export default function SectionFileTask({refreshing}: {refreshing: boolean}) {
|
||||||
const [isModal, setModal] = useState(false)
|
const [isModal, setModal] = useState(false)
|
||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const { detail } = useLocalSearchParams<{ detail: string }>()
|
const { detail } = useLocalSearchParams<{ detail: string }>()
|
||||||
@@ -56,6 +56,11 @@ export default function SectionFileTask() {
|
|||||||
handleLoad(false)
|
handleLoad(false)
|
||||||
}, [update.file])
|
}, [update.file])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (refreshing)
|
||||||
|
handleLoad(false);
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad(true)
|
handleLoad(true)
|
||||||
}, [])
|
}, [])
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ type Props = {
|
|||||||
position: string;
|
position: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function SectionMemberTask() {
|
export default function SectionMemberTask({ refreshing }: { refreshing: boolean }) {
|
||||||
const [isModal, setModal] = useState(false);
|
const [isModal, setModal] = useState(false);
|
||||||
const { token, decryptToken } = useAuthSession();
|
const { token, decryptToken } = useAuthSession();
|
||||||
const { id, detail } = useLocalSearchParams<{ id: string; detail: string }>();
|
const { id, detail } = useLocalSearchParams<{ id: string; detail: string }>();
|
||||||
@@ -64,6 +64,10 @@ export default function SectionMemberTask() {
|
|||||||
handleLoad(true);
|
handleLoad(true);
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (refreshing)
|
||||||
|
handleLoad(false);
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
async function handleDeleteMember() {
|
async function handleDeleteMember() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ type Props = {
|
|||||||
dateEnd: string;
|
dateEnd: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function SectionTanggalTugasTask() {
|
export default function SectionTanggalTugasTask({refreshing}: {refreshing: boolean}) {
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const update = useSelector((state: any) => state.taskUpdate)
|
const update = useSelector((state: any) => state.taskUpdate)
|
||||||
const [isModal, setModal] = useState(false)
|
const [isModal, setModal] = useState(false)
|
||||||
@@ -79,6 +79,11 @@ export default function SectionTanggalTugasTask() {
|
|||||||
handleLoad(false)
|
handleLoad(false)
|
||||||
}, [update.task])
|
}, [update.task])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (refreshing)
|
||||||
|
handleLoad(false);
|
||||||
|
}, [refreshing]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad(true)
|
handleLoad(true)
|
||||||
@@ -153,7 +158,9 @@ export default function SectionTanggalTugasTask() {
|
|||||||
title="Update Status"
|
title="Update Status"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setModal(false)
|
setModal(false)
|
||||||
setSelect(true)
|
setTimeout(() => {
|
||||||
|
setSelect(true)
|
||||||
|
}, 600);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
@@ -185,10 +192,8 @@ export default function SectionTanggalTugasTask() {
|
|||||||
|
|
||||||
<ModalSelect
|
<ModalSelect
|
||||||
category="status-task"
|
category="status-task"
|
||||||
close={setSelect}
|
close={() => setSelect(false)}
|
||||||
onSelect={(value) => {
|
onSelect={(value) => { handleUpdate(Number(value.val)) }}
|
||||||
handleUpdate(Number(value.val))
|
|
||||||
}}
|
|
||||||
title="Status"
|
title="Status"
|
||||||
open={isSelect}
|
open={isSelect}
|
||||||
valChoose={String(tugas.status)}
|
valChoose={String(tugas.status)}
|
||||||
|
|||||||
@@ -188,6 +188,9 @@ const Styles = StyleSheet.create({
|
|||||||
round10: {
|
round10: {
|
||||||
borderRadius: 10
|
borderRadius: 10
|
||||||
},
|
},
|
||||||
|
h100: {
|
||||||
|
height: '100%'
|
||||||
|
},
|
||||||
w100: {
|
w100: {
|
||||||
width: '100%'
|
width: '100%'
|
||||||
},
|
},
|
||||||
|
|||||||
20
lib/api.ts
20
lib/api.ts
@@ -2,8 +2,8 @@ import axios from 'axios';
|
|||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
// baseURL: 'http://10.0.2.2:3000/api',
|
// baseURL: 'http://10.0.2.2:3000/api',
|
||||||
baseURL: 'https://stg-darmasaba.wibudev.com/api',
|
// baseURL: 'https://stg-darmasaba.wibudev.com/api',
|
||||||
// baseURL: 'http://192.168.1.135:3000/api',
|
baseURL: 'http://192.168.1.89:3000/api',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
||||||
@@ -150,7 +150,7 @@ export const apiGetUser = async ({ user, active, search, group, page }: { user:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const apiCreateUser = async (data: FormData) => {
|
export const apiCreateUser = async ({data}: {data: FormData}) => {
|
||||||
const response = await api.post('/mobile/user', data, {
|
const response = await api.post('/mobile/user', data, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data',
|
'Content-Type': 'multipart/form-data',
|
||||||
@@ -219,7 +219,7 @@ export const apiEditDiscussionGeneral = async (data: { user: string, title: stri
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const apiCreateDiscussionGeneral = async ({ data }: { data: { idGroup: string, title: string, desc: string, user: string, member: [] } }) => {
|
export const apiCreateDiscussionGeneral = async ({ data }: { data: { idGroup: string, title: string, desc: string, user: string, member: [] } }) => {
|
||||||
const response = await api.post(`/mobile/discussion-general/`, data)
|
const response = await api.post(`/mobile/discussion-general`, data)
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -604,7 +604,7 @@ export const apiGetDocumentInformasi = async ({ user, item, cat }: { user: strin
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const apiDocumentRename = async (data: { name: string, user: string, id: string, path: string, idDivision: string, extension: string }) => {
|
export const apiDocumentRename = async (data: { name: string, user: string, id: string, path: string, idDivision: string, extension: string }) => {
|
||||||
const response = await api.put(`/mobile/document/`, data)
|
const response = await api.put(`/mobile/document`, data)
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -613,8 +613,8 @@ export const apiDocumentDelete = async (data: { user: string, data: any[] }) =>
|
|||||||
return response.data
|
return response.data
|
||||||
};
|
};
|
||||||
|
|
||||||
export const apiCreateFolderDocument = async (data: { name: string, path: string, idDivision: string, user: string }) => {
|
export const apiCreateFolderDocument = async ({ data }: { data: { name: string, path: string, idDivision: string, user: string } }) => {
|
||||||
const response = await api.post(`/mobile/document/`, data)
|
const response = await api.post(`/mobile/document`, data)
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -646,12 +646,12 @@ export const apiShareDocument = async (data: { dataDivision: any[], dataItem: an
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const apiRegisteredToken = async (data: { user: string, token: string }) => {
|
export const apiRegisteredToken = async (data: { user: string, token: string }) => {
|
||||||
const response = await api.post(`/mobile/auth-token/`, data)
|
const response = await api.post(`/mobile/auth-token`, data)
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const apiUnregisteredToken = async (data: { user: string, token: string }) => {
|
export const apiUnregisteredToken = async (data: { user: string, token: string }) => {
|
||||||
const response = await api.put(`/mobile/auth-token/`, data)
|
const response = await api.put(`/mobile/auth-token`, data)
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -661,6 +661,6 @@ export const apiGetNotification = async ({ user, page }: { user: string, page?:
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const apiReadOneNotification = async (data: { user: string, id: string }) => {
|
export const apiReadOneNotification = async (data: { user: string, id: string }) => {
|
||||||
const response = await api.put(`/mobile/home/notification/`, data)
|
const response = await api.put(`/mobile/home/notification`, data)
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user