upd: tampilan

Deskripsi:
- masang toast
- ganti tag Text

No Issues
This commit is contained in:
2025-07-29 11:41:03 +08:00
parent db98c3afc5
commit 42bf1589b4
86 changed files with 379 additions and 307 deletions

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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);
}

View File

@@ -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);
}