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

@@ -12,7 +12,8 @@ import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"
import * as DocumentPicker from "expo-document-picker"
import { router, Stack, useLocalSearchParams } from "expo-router"
import { useState } from "react"
import { ActivityIndicator, SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native"
import { ActivityIndicator, SafeAreaView, ScrollView, Text, View } from "react-native"
import Toast from "react-native-toast-message"
import { useDispatch, useSelector } from "react-redux"
export default function ProjectAddFile() {
@@ -38,7 +39,7 @@ export default function ProjectAddFile() {
setFileForm([...fileForm, result.assets?.[0]])
setListFile([...listFile, result.assets?.[0].name])
} else {
ToastAndroid.show('File sudah ada', ToastAndroid.SHORT)
Toast.show({ type: 'small', text1: 'File sudah ada', })
}
}
}
@@ -103,15 +104,15 @@ export default function ProjectAddFile() {
const response = await apiAddFileProject({ data: fd, id: id })
if (response.success) {
ToastAndroid.show('Berhasil menambahkan file', ToastAndroid.SHORT)
Toast.show({ type: 'small', text1: 'Berhasil menambahkan file', })
dispatch(setUpdateProject({ ...update, file: !update.file }))
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', })
}
}