upd: tampilan
Deskripsi: - masang toast - ganti tag Text No Issues
This commit is contained in:
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -29,7 +30,7 @@ export default function HeaderRightAnnouncementDetail({ id }: Props) {
|
||||
if (response.success) {
|
||||
dispatch(setUpdateAnnouncement(!update))
|
||||
setVisible(false)
|
||||
ToastAndroid.show('Berhasil menghapus data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
|
||||
router.back()
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { Ionicons, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -29,14 +30,14 @@ export default function HeaderRightCalendarDetail({ id, idReminder }: Props) {
|
||||
const response = await apiDeleteCalendar({ user: hasil }, String(id));
|
||||
if (response.success) {
|
||||
dispatch(setUpdateCalendar({ ...update, data: !update.data }));
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
router.back()
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show('Terjadi kesalahan', ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
} finally {
|
||||
setVisible(false)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Text, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import Text from "../Text";
|
||||
|
||||
type Props = {
|
||||
text: string;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Text, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import Text from "../Text";
|
||||
|
||||
type Props = {
|
||||
dateStart: Date
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -29,15 +30,15 @@ export default function HeaderRightDiscussionDetail({ id, status, isActive }: Pr
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiOpenCloseDiscussion({ status: Number(status), user: hasil }, String(id))
|
||||
if (response.success) {
|
||||
ToastAndroid.show('Berhasil mengubah data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
||||
dispatch(setUpdateDiscussion({ ...update, data: !update.data }))
|
||||
setVisible(false)
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
ToastAndroid.show('Terjadi kesalahan', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
} finally {
|
||||
setVisible(false)
|
||||
}
|
||||
@@ -48,15 +49,15 @@ export default function HeaderRightDiscussionDetail({ id, status, isActive }: Pr
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiArchiveDiscussion({ user: hasil, active: !isActive }, String(id))
|
||||
if (response.success) {
|
||||
ToastAndroid.show('Berhasil mengubah data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
||||
dispatch(setUpdateDiscussion({ ...update, data: !update.data }))
|
||||
setVisible(false)
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
ToastAndroid.show('Terjadi kesalahan', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
} finally {
|
||||
setVisible(false)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -30,7 +31,7 @@ export default function HeaderRightDiscussionGeneralDetail({ id, active, status
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiUpdateStatusDiscussionGeneral({ id: id, data: { status: status, user: hasil } })
|
||||
if (response.success) {
|
||||
ToastAndroid.show('Berhasil mengupdate data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengupdate data', })
|
||||
dispatch(setUpdateDiscussionGeneralDetail(!update))
|
||||
}
|
||||
setVisible(false)
|
||||
@@ -43,7 +44,7 @@ export default function HeaderRightDiscussionGeneralDetail({ id, active, status
|
||||
try {
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiDeleteDiscussionGeneral({ active: !active, user: hasil }, id)
|
||||
ToastAndroid.show('Berhasil mengupdate data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengupdate data', })
|
||||
dispatch(setUpdateDiscussionGeneralDetail(!update))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -29,13 +30,13 @@ export default function HeaderRightDivisionInfo({ id, active }: Props) {
|
||||
const response = await apiUpdateStatusDivision({ data: { user: hasil, isActive: Boolean(active) }, id: String(id) })
|
||||
if (response.success) {
|
||||
dispatch(setUpdateDivision(!update))
|
||||
ToastAndroid.show('Berhasil mengubah status', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah status', })
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
ToastAndroid.show('Terjadi kesalahan', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
} finally {
|
||||
setVisible(false)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Dimensions, Text, View } from "react-native";
|
||||
import { Dimensions, View } from "react-native";
|
||||
import { BarChart } from "react-native-gifted-charts";
|
||||
import Text from "../Text";
|
||||
|
||||
export default function ReportChartDocument({ data }: { data: { label: string; value: number; }[] }) {
|
||||
const maxValue = Math.max(...data.map(i => i.value))
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Dimensions, Text, View } from "react-native";
|
||||
import { Dimensions, View } from "react-native";
|
||||
import { BarChart } from "react-native-gifted-charts";
|
||||
import Text from "../Text";
|
||||
|
||||
export default function ReportChartEvent({ data }: { data: { label: string; value: number; }[] }) {
|
||||
const width = Dimensions.get("window").width;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Text, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import { PieChart } from "react-native-gifted-charts";
|
||||
import Text from "../Text";
|
||||
|
||||
export default function ReportChartProgress({ data }: { data: { color: string; text: string; value: number; }[] }) {
|
||||
const pieData = [
|
||||
|
||||
@@ -6,7 +6,8 @@ import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons";
|
||||
import * as DocumentPicker from "expo-document-picker";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { ToastAndroid, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import ButtonMenuHeader from "../buttonMenuHeader";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
@@ -28,14 +29,14 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiCreateFolderDocument({ user: hasil, name, path, idDivision: id })
|
||||
if (response.success) {
|
||||
ToastAndroid.show("Berhasil membuat folder baru", ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil membuat folder baru', })
|
||||
dispatch(setUpdateDokumen(!update))
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
ToastAndroid.show("Terjadi kesalahan", ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
} finally {
|
||||
setNewFolder(false)
|
||||
}
|
||||
@@ -74,14 +75,14 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
||||
|
||||
const response = await apiUploadFileDocument({ data: fd })
|
||||
if (response.success) {
|
||||
ToastAndroid.show("Berhasil mengunggah file", ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengunggah file', })
|
||||
dispatch(setUpdateDokumen(!update))
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
ToastAndroid.show("Terjadi kesalahan", ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
} finally {
|
||||
setVisible(false)
|
||||
}
|
||||
|
||||
@@ -2,8 +2,9 @@ import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { useState } from "react";
|
||||
import { Pressable, ScrollView, Text, ToastAndroid, View } from "react-native";
|
||||
import { Pressable, ScrollView, View } from "react-native";
|
||||
import { useSharedValue } from "react-native-reanimated";
|
||||
import Toast from "react-native-toast-message";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
import { InputForm } from "../inputForm";
|
||||
@@ -13,6 +14,7 @@ import MenuItemRow from "../menuItemRow";
|
||||
import ModalFloat from "../modalFloat";
|
||||
import ModalSelectMultiple from "../modalSelectMultiple";
|
||||
import ModalSalinMove from "./modalSalinMove";
|
||||
import Text from "../Text";
|
||||
|
||||
|
||||
type Props = {
|
||||
@@ -60,7 +62,7 @@ export default function MenuBottomSelectDocument({ onDone }: Props) {
|
||||
|
||||
onPress: () => {
|
||||
onDone()
|
||||
ToastAndroid.show('Berhasil menghapus data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
|
||||
}
|
||||
})
|
||||
}}
|
||||
@@ -94,7 +96,7 @@ export default function MenuBottomSelectDocument({ onDone }: Props) {
|
||||
<ModalFloat title="Ganti Nama Dokumen" isVisible={isRename} setVisible={setRename}
|
||||
onSubmit={() => {
|
||||
onDone()
|
||||
ToastAndroid.show('Berhasil mengganti nama dokumen', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengganti nama dokumen', })
|
||||
}}>
|
||||
<View>
|
||||
<InputForm type="default" placeholder="Nama File" required label="Nama File" />
|
||||
@@ -204,7 +206,7 @@ export default function MenuBottomSelectDocument({ onDone }: Props) {
|
||||
|
||||
<ModalSelectMultiple choose="dinas" title="Bagikan" category="share-division" open={isShare} close={setShare}
|
||||
onSelect={() => {
|
||||
ToastAndroid.show('Success', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Success', })
|
||||
setShare(false)
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -3,10 +3,11 @@ import { apiGetDocumentInformasi } from "@/lib/api";
|
||||
import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Pressable, ScrollView, Text, View } from "react-native";
|
||||
import { Pressable, ScrollView, View } from "react-native";
|
||||
import { useSharedValue } from "react-native-reanimated";
|
||||
import ItemAccordion from "../itemAccordion";
|
||||
import ItemDetailMember from "../itemDetailMember";
|
||||
import Text from "../Text";
|
||||
|
||||
type Props = {
|
||||
category: string,
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { ToastAndroid, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
@@ -63,14 +64,14 @@ export default function ModalMore({
|
||||
path,
|
||||
});
|
||||
if (response.success) {
|
||||
ToastAndroid.show("Berhasil memindahkan file", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil memindahkan file', });
|
||||
dispatch(setUpdateDokumen(!update));
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: response.message, });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show("Terjadi kesalahan", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', });
|
||||
} finally {
|
||||
setIsCut(false);
|
||||
onClose();
|
||||
@@ -87,14 +88,14 @@ export default function ModalMore({
|
||||
idDivision: id
|
||||
});
|
||||
if (response.success) {
|
||||
ToastAndroid.show("Berhasil menyalin file", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menyalin file', });
|
||||
dispatch(setUpdateDokumen(!update));
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: response.message, });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show("Terjadi kesalahan", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', });
|
||||
} finally {
|
||||
setIsCopy(false);
|
||||
onClose();
|
||||
|
||||
@@ -4,7 +4,8 @@ import { setUpdateGroup } from "@/lib/groupSlice"
|
||||
import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { AntDesign } from "@expo/vector-icons"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import { ButtonForm } from "../buttonForm"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -33,7 +34,7 @@ export default function HeaderRightGroupList() {
|
||||
} finally {
|
||||
setVisibleTambah(false)
|
||||
setVisible(false)
|
||||
ToastAndroid.show('Berhasil menambahkan data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ import { stringToDate } from "@/lib/fun_stringToDate";
|
||||
import DateTimePicker from "@react-native-community/datetimepicker";
|
||||
import dayjs from "dayjs";
|
||||
import { useState } from "react";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
import { Pressable, View } from "react-native";
|
||||
import Text from "./Text";
|
||||
|
||||
type Props = {
|
||||
label?: string;
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import Styles from "@/constants/Styles"
|
||||
import { apiDeleteUser } from "@/lib/api"
|
||||
import { setUpdateMember } from "@/lib/memberSlice"
|
||||
import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
import DrawerBottom from "../drawerBottom"
|
||||
import MenuItemRow from "../menuItemRow"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import { setUpdateMember } from "@/lib/memberSlice"
|
||||
|
||||
type Props = {
|
||||
active: any,
|
||||
@@ -28,10 +29,10 @@ export default function HeaderRightMemberDetail({ active, id }: Props) {
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiDeleteUser({ user: hasil, isActive: active }, id)
|
||||
if (response.success) {
|
||||
ToastAndroid.show('Berhasil mengupdate data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengupdate data', })
|
||||
dispatch(setUpdateMember(!update))
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -3,8 +3,9 @@ import { apiGetDivisionGroup, apiGetDocumentInformasi, apiGetListDivisionByIdDiv
|
||||
import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { AntDesign } from "@expo/vector-icons"
|
||||
import { useEffect, useState } from "react"
|
||||
import { Pressable, ScrollView, ToastAndroid, View } from "react-native"
|
||||
import Text from "./Text";
|
||||
import { Pressable, ScrollView, View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import Text from "./Text"
|
||||
import { ButtonForm } from "./buttonForm"
|
||||
import DrawerBottom from "./drawerBottom"
|
||||
|
||||
@@ -104,7 +105,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
||||
delete newChecked[groupId];
|
||||
} else {
|
||||
if (data.find((item: { id: string }) => item.id === groupId)?.Division?.length == 0) {
|
||||
return ToastAndroid.show('Tidak ada divisi', ToastAndroid.SHORT)
|
||||
return Toast.show({ type: 'small', text1: 'Tidak ada divisi', })
|
||||
}
|
||||
newChecked[groupId] = data.find((item: { id: string }) => item.id === groupId)?.Division.map((item: { id: any }) => item.id) || [];
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ import { setUpdatePosition } from "@/lib/positionSlice"
|
||||
import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { AntDesign } from "@expo/vector-icons"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import { ButtonForm } from "../buttonForm"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -85,7 +86,7 @@ export default function HeaderRightPositionList() {
|
||||
} finally {
|
||||
setVisibleTambah(false)
|
||||
setVisible(false)
|
||||
ToastAndroid.show('Berhasil menambahkan data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { AntDesign, Ionicons, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -30,10 +31,10 @@ export default function HeaderRightProjectDetail({ id, status }: Props) {
|
||||
const response = await apiDeleteProject({ user: hasil }, String(id))
|
||||
if (response.success) {
|
||||
dispatch(setUpdateProject({ ...update, data: !update.data }))
|
||||
ToastAndroid.show('Berhasil menghapus kegiatan', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus kegiatan', })
|
||||
router.back()
|
||||
} else {
|
||||
ToastAndroid.show('Gagal menghapus kegiatan', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Gagal menghapus kegiatan', })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -8,8 +8,9 @@ import { startActivityAsync } from 'expo-intent-launcher';
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import * as Sharing from 'expo-sharing';
|
||||
import { useEffect, useState } from "react";
|
||||
import { Alert, Platform, Text, ToastAndroid, View } from "react-native";
|
||||
import { Alert, Platform, View } from "react-native";
|
||||
import * as mime from 'react-native-mime-types';
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import BorderBottomItem from "../borderBottomItem";
|
||||
@@ -17,6 +18,7 @@ import DrawerBottom from "../drawerBottom";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
import ModalLoading from "../modalLoading";
|
||||
import Skeleton from "../skeleton";
|
||||
import Text from "../Text";
|
||||
|
||||
|
||||
type Props = {
|
||||
@@ -70,14 +72,14 @@ export default function SectionFile({ status, member }: { status: number | undef
|
||||
const hasil = await decryptToken(String(token?.current));
|
||||
const response = await apiDeleteFileProject({ user: hasil }, String(selectFile?.id));
|
||||
if (response.success) {
|
||||
ToastAndroid.show('Berhasil menghapus file', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus file', })
|
||||
dispatch(setUpdateProject({ ...update, file: !update.file }))
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show('Terjadi kesalahan', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
} finally {
|
||||
setModal(false)
|
||||
}
|
||||
|
||||
@@ -2,11 +2,12 @@ import Styles from "@/constants/Styles";
|
||||
import { deleteTaskCreate } from "@/lib/taskCreate";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Key, useState } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
import ItemSectionTanggalTugas from "../itemSectionTanggalTugas";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
import Text from "../Text";
|
||||
|
||||
export default function SectionListAddTask() {
|
||||
const taskCreate = useSelector((state: any) => state.taskCreate)
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Text, ToastAndroid, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import BorderBottomItem from "../borderBottomItem";
|
||||
@@ -13,6 +14,7 @@ import DrawerBottom from "../drawerBottom";
|
||||
import ImageUser from "../imageNew";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
import SkeletonTwoItem from "../skeletonTwoItem";
|
||||
import Text from "../Text";
|
||||
|
||||
type Props = {
|
||||
id: string;
|
||||
@@ -72,7 +74,7 @@ export default function SectionMember({ status }: { status: number | undefined }
|
||||
idUser: memberChoose.id,
|
||||
}, id)
|
||||
if (response.success) {
|
||||
ToastAndroid.show("Berhasil menghapus anggota", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus anggota', })
|
||||
dispatch(setUpdateProject({ ...update, member: !update.progress }))
|
||||
setModal(false);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Text, ToastAndroid, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
@@ -13,6 +14,7 @@ import ItemSectionTanggalTugas from "../itemSectionTanggalTugas";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
import ModalSelect from "../modalSelect";
|
||||
import SkeletonTask from "../skeletonTask";
|
||||
import Text from "../Text";
|
||||
|
||||
type Props = {
|
||||
id: string;
|
||||
@@ -77,7 +79,7 @@ export default function SectionTanggalTugasProject({ status, member }: { status:
|
||||
if (response.success) {
|
||||
dispatch(setUpdateProject({ ...update, progress: !update.progress, task: !update.task }))
|
||||
setSelect(false);
|
||||
ToastAndroid.show("Berhasil mengubah data", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -94,7 +96,7 @@ export default function SectionTanggalTugasProject({ status, member }: { status:
|
||||
if (response.success) {
|
||||
dispatch(setUpdateProject({ ...update, progress: !update.progress, task: !update.task }))
|
||||
setModal(false);
|
||||
ToastAndroid.show("Berhasil menghapus data", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { AntDesign, Ionicons, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useEffect, useState } from "react"
|
||||
import { ToastAndroid, View } from "react-native"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
@@ -59,10 +60,10 @@ export default function HeaderRightTaskDetail({ id, division, status }: Props) {
|
||||
const response = await apiDeleteTask({ user: hasil }, String(id))
|
||||
if (response.success) {
|
||||
dispatch(setUpdateTask({ ...update, data: !update.data }))
|
||||
ToastAndroid.show('Berhasil menghapus tugas', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus tugas', })
|
||||
router.back()
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
@@ -102,7 +103,7 @@ export default function HeaderRightTaskDetail({ id, division, status }: Props) {
|
||||
disabled={status == 3}
|
||||
/>
|
||||
{
|
||||
( (entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision)
|
||||
((entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision)
|
||||
&&
|
||||
<MenuItemRow
|
||||
icon={<MaterialIcons name="groups" color="black" size={25} />}
|
||||
@@ -120,7 +121,7 @@ export default function HeaderRightTaskDetail({ id, division, status }: Props) {
|
||||
</View>
|
||||
|
||||
{
|
||||
( (entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision )
|
||||
((entityUser.role != "user" && entityUser.role != "coadmin") || isAdminDivision)
|
||||
&&
|
||||
<View style={[Styles.rowItemsCenter, Styles.mt15]}>
|
||||
<MenuItemRow
|
||||
|
||||
@@ -8,8 +8,9 @@ import { startActivityAsync } from 'expo-intent-launcher';
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import * as Sharing from 'expo-sharing';
|
||||
import { useEffect, useState } from "react";
|
||||
import { Alert, Platform, Text, ToastAndroid, View } from "react-native";
|
||||
import { Alert, Platform, View } from "react-native";
|
||||
import * as mime from 'react-native-mime-types';
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import BorderBottomItem from "../borderBottomItem";
|
||||
@@ -17,6 +18,7 @@ import DrawerBottom from "../drawerBottom";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
import ModalLoading from "../modalLoading";
|
||||
import Skeleton from "../skeleton";
|
||||
import Text from "../Text";
|
||||
|
||||
type Props = {
|
||||
id: string
|
||||
@@ -99,14 +101,14 @@ export default function SectionFileTask() {
|
||||
const hasil = await decryptToken(String(token?.current));
|
||||
const response = await apiDeleteFileTask({ user: hasil }, String(selectFile?.id));
|
||||
if (response.success) {
|
||||
ToastAndroid.show('Berhasil menghapus file', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus file', })
|
||||
dispatch(setUpdateTask({ ...update, file: !update.file }))
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show('Terjadi kesalahan', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
} finally {
|
||||
setModal(false)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Text, ToastAndroid, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import BorderBottomItem from "../borderBottomItem";
|
||||
@@ -13,6 +14,7 @@ import DrawerBottom from "../drawerBottom";
|
||||
import ImageUser from "../imageNew";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
import SkeletonTwoItem from "../skeletonTwoItem";
|
||||
import Text from "../Text";
|
||||
|
||||
type Props = {
|
||||
id: string;
|
||||
@@ -71,14 +73,14 @@ export default function SectionMemberTask() {
|
||||
idUser: memberChoose.id,
|
||||
}, detail)
|
||||
if (response.success) {
|
||||
ToastAndroid.show("Berhasil menghapus anggota", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus anggota', })
|
||||
dispatch(setUpdateTask({ ...update, member: !update.progress }))
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show("Gagal menghapus anggota", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Gagal menghapus anggota', })
|
||||
} finally {
|
||||
setModal(false);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Text, ToastAndroid, View } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
@@ -13,6 +14,7 @@ import ItemSectionTanggalTugas from "../itemSectionTanggalTugas";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
import ModalSelect from "../modalSelect";
|
||||
import SkeletonTask from "../skeletonTask";
|
||||
import Text from "../Text";
|
||||
|
||||
|
||||
type Props = {
|
||||
@@ -61,13 +63,13 @@ export default function SectionTanggalTugasTask() {
|
||||
}, tugas.id);
|
||||
if (response.success) {
|
||||
dispatch(setUpdateTask({ ...update, progress: !update.progress, task: !update.task }))
|
||||
ToastAndroid.show("Berhasil mengubah data", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show("Gagal mengubah data", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Gagal mengubah data', })
|
||||
} finally {
|
||||
setSelect(false)
|
||||
}
|
||||
@@ -92,13 +94,13 @@ export default function SectionTanggalTugasTask() {
|
||||
}, tugas.id);
|
||||
if (response.success) {
|
||||
dispatch(setUpdateTask({ ...update, progress: !update.progress, task: !update.task }))
|
||||
ToastAndroid.show("Berhasil menghapus data", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show("Gagal menghapus data", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Gagal menghapus data', })
|
||||
} finally {
|
||||
setModal(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user