upd: tampilan
Deskripsi: - masang toast - ganti tag Text No Issues
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user