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 { 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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user