upd: tampilan
Deskripsi: - masang toast - ganti tag Text No Issues
This commit is contained in:
@@ -3,6 +3,7 @@ import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import ImageUser from "@/components/imageNew";
|
||||
import ImageWithLabel from "@/components/imageWithLabel";
|
||||
import InputSearch from "@/components/inputSearch";
|
||||
import Text from "@/components/Text";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { apiAddMemberCalendar, apiGetCalendarOne, apiGetDivisionMember } from "@/lib/api";
|
||||
import { setUpdateCalendar } from "@/lib/calendarUpdate";
|
||||
@@ -10,7 +11,8 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { AntDesign } from "@expo/vector-icons";
|
||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Pressable, SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native";
|
||||
import { Pressable, SafeAreaView, ScrollView, View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
|
||||
type Props = {
|
||||
@@ -79,15 +81,15 @@ export default function AddMemberCalendarEvent() {
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiAddMemberCalendar({ id: idCalendar, data: { user: hasil, member: selectMember } })
|
||||
if (response.success) {
|
||||
ToastAndroid.show('Berhasil menambahkan anggota', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menambahkan anggota', })
|
||||
dispatch(setUpdateCalendar({ ...update, member: !update.member }))
|
||||
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', })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { Stack, router, useLocalSearchParams } from "expo-router"
|
||||
import moment from "moment"
|
||||
import { useEffect, useState } from "react"
|
||||
import { SafeAreaView, ScrollView, ToastAndroid, View } from "react-native"
|
||||
import { SafeAreaView, ScrollView, View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
|
||||
export default function EditEventCalendar() {
|
||||
const { token, decryptToken } = useAuthSession();
|
||||
@@ -53,7 +54,7 @@ export default function EditEventCalendar() {
|
||||
setChoose({ val: response.data.repeatEventTyper, label: valueTypeEventRepeat.find((item) => item.id == response.data.repeatEventTyper)?.name || "" })
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show('Gagal mendapatkan data', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Gagal mendapatkan data', })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,13 +144,13 @@ export default function EditEventCalendar() {
|
||||
const response = await apiUpdateCalendar({ data: { ...data, user: hasil }, id: idCalendar })
|
||||
if (response.success) {
|
||||
router.replace(`/division/${id}/calendar/`)
|
||||
ToastAndroid.show('Berhasil mengubah acara', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah acara', })
|
||||
} else {
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: response.message, })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
ToastAndroid.show('Gagal mengubah acara', ToastAndroid.SHORT)
|
||||
Toast.show({ type: 'small', text1: 'Gagal mengubah acara', })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons"
|
||||
import { router, Stack, useLocalSearchParams } from "expo-router"
|
||||
import { useEffect, useState } from "react"
|
||||
import { SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native"
|
||||
import { SafeAreaView, ScrollView, Text, View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
|
||||
type Props = {
|
||||
@@ -122,13 +123,11 @@ export default function DetailEventCalendar() {
|
||||
|
||||
if (response.success) {
|
||||
dispatch(setUpdateCalendar({ ...update, member: !update.member }));
|
||||
ToastAndroid.show(response.message, ToastAndroid.SHORT);
|
||||
} 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 {
|
||||
setModalMember(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user