diff --git a/app/(application)/_layout.tsx b/app/(application)/_layout.tsx
index 6b9c6e6..2795722 100644
--- a/app/(application)/_layout.tsx
+++ b/app/(application)/_layout.tsx
@@ -1,5 +1,6 @@
import HeaderRightAnnouncementList from "@/components/announcement/headerAnnouncementList";
import AppHeader from "@/components/AppHeader";
+import Styles from "@/constants/Styles";
import HeaderDiscussionGeneral from "@/components/discussion_general/headerDiscussionGeneral";
import HeaderRightDivisionList from "@/components/division/headerDivisionList";
import HeaderRightGroupList from "@/components/group/headerGroupList";
@@ -18,7 +19,7 @@ import { getMessaging, onMessage } from "@react-native-firebase/messaging";
import { Redirect, router, Stack, usePathname } from "expo-router";
import { StatusBar } from 'expo-status-bar';
import { useEffect } from "react";
-import { Easing, Notifier } from 'react-native-notifier';
+import { Easing, Notifier, NotifierComponents } from 'react-native-notifier';
import { Provider } from "react-redux";
import { useTheme } from "@/providers/ThemeProvider";
@@ -67,12 +68,34 @@ export default function RootLayout() {
} else if (pathname !== `/${category}/${content}`) {
Notifier.showNotification({
title: title,
- description: remoteMessage.notification?.body,
+ description: String(remoteMessage.notification?.body),
duration: 3000,
animationDuration: 300,
showEasing: Easing.ease,
onPress: () => handleReadNotification(String(id), String(category), String(content), String(title)),
hideOnPress: true,
+ Component: NotifierComponents.Notification,
+ componentProps: {
+ containerStyle: [
+ Styles.shadowBox,
+ {
+ backgroundColor: colors.modalBackground,
+ borderRadius: 5,
+ marginHorizontal: 15,
+ marginTop: 10,
+ padding: 15,
+ }
+ ],
+ titleStyle: {
+ color: colors.text,
+ fontWeight: 'bold',
+ fontSize: 16,
+ },
+ descriptionStyle: {
+ color: colors.dimmed,
+ fontSize: 14,
+ },
+ }
});
}
}
diff --git a/app/(application)/announcement/create.tsx b/app/(application)/announcement/create.tsx
index 72ef73a..ea8bccc 100644
--- a/app/(application)/announcement/create.tsx
+++ b/app/(application)/announcement/create.tsx
@@ -95,17 +95,16 @@ export default function CreateAnnouncement() {
const response = await apiCreateAnnouncement(fd)
- // const response = await apiCreateAnnouncement({
- // data: { ...dataForm, user: hasil, groups: divisionMember },
- // });
-
if (response.success) {
dispatch(setUpdateAnnouncement(!update))
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
router.back();
+ } else {
+ Toast.show({ type: 'small', text1: 'Gagal menambahkan data', })
}
} catch (error) {
console.error(error);
+ Toast.show({ type: 'small', text1: 'Gagal menambahkan data', })
} finally {
setLoading(false)
}
@@ -210,7 +209,7 @@ export default function CreateAnnouncement() {
File
{fileForm.length} file
-
+
{
fileForm.map((item, index) => (
Divisi
-
+
{
divisionMember.map((item: { name: any; Division: any }, index: any) => {
return (
diff --git a/app/(application)/announcement/edit/[id].tsx b/app/(application)/announcement/edit/[id].tsx
index d259e98..20de0bb 100644
--- a/app/(application)/announcement/edit/[id].tsx
+++ b/app/(application)/announcement/edit/[id].tsx
@@ -144,9 +144,12 @@ export default function EditAnnouncement() {
dispatch(setUpdateAnnouncement(!update))
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
router.back();
+ } else {
+ Toast.show({ type: 'small', text1: 'Gagal mengubah data', })
}
} catch (error) {
console.error(error);
+ Toast.show({ type: 'small', text1: 'Gagal mengubah data', })
} finally {
setLoading(false)
}
@@ -263,7 +266,7 @@ export default function EditAnnouncement() {
File
{fileForm.length + dataFile.filter((val) => !val.delete).length} file
-
+
{
dataFile.filter((val) => !val.delete).map((item, index) => (
Divisi
-
+
{
dataMember.map((item: { name: any; Division: any }, index: any) => {
return (
diff --git a/app/(application)/discussion/create.tsx b/app/(application)/discussion/create.tsx
index 95d915f..c153e27 100644
--- a/app/(application)/discussion/create.tsx
+++ b/app/(application)/discussion/create.tsx
@@ -258,7 +258,7 @@ export default function CreateDiscussionGeneral() {
File
{fileForm.length} file
-
+
{
fileForm.map((item, index) => (
{entitiesMember.length} Anggota
-
+
{
entitiesMember.map((item: { img: any; name: any; }, index: any) => {
return (
diff --git a/app/(application)/discussion/edit/[id].tsx b/app/(application)/discussion/edit/[id].tsx
index 6aac536..767f7c8 100644
--- a/app/(application)/discussion/edit/[id].tsx
+++ b/app/(application)/discussion/edit/[id].tsx
@@ -154,6 +154,8 @@ export default function EditDiscussionGeneral() {
dispatch(setUpdateDiscussionGeneralDetail(!update))
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
router.back();
+ } else {
+ Toast.show({ type: 'small', text1: 'Gagal mengubah data', })
}
} catch (error) {
console.error(error);
@@ -234,7 +236,7 @@ export default function EditDiscussionGeneral() {
File
{fileForm.length + dataFile.filter((val) => !val.delete).length} file
-
+
{
dataFile.filter((val) => !val.delete).map((item, index) => (
0 || dataFile.filter((val) => !val.delete).length > 0)
&&
-
- File
- {
- dataFile.filter((val) => !val.delete).map((item, index) => (
- 1 ? "bottom" : "none"}
- icon={}
- title={item.name + '.' + item.extension}
- titleWeight="normal"
- onPress={() => { setIndexDelFile({ id: item.id, cat: "oldFile" }); setModalFile(true) }}
- />
- ))
- }
- {
- fileForm.map((item, index) => (
- 1 ? "bottom" : "none"}
- icon={}
- title={item.name}
- titleWeight="normal"
- onPress={() => { setIndexDelFile({ id: index, cat: "newFile" }); setModalFile(true) }}
- />
- ))
- }
-
+ <>
+
+ File
+ {fileForm.length + dataFile.filter((val) => !val.delete).length} file
+
+
+ {
+ dataFile.filter((val) => !val.delete).map((item, index) => (
+ !val.delete).length - 1 == index && fileForm.length == 0 ? "none" : "bottom"}
+ icon={}
+ title={item.name + '.' + item.extension}
+ titleWeight="normal"
+ onPress={() => { setIndexDelFile({ id: item.id, cat: "oldFile" }); setModalFile(true) }}
+ />
+ ))
+ }
+ {
+ fileForm.map((item, index) => (
+ }
+ title={item.name}
+ titleWeight="normal"
+ onPress={() => { setIndexDelFile({ id: index, cat: "newFile" }); setModalFile(true) }}
+ />
+ ))
+ }
+
+ >
}
diff --git a/app/(application)/division/[id]/(fitur-division)/discussion/create.tsx b/app/(application)/division/[id]/(fitur-division)/discussion/create.tsx
index a75f41d..2e1c6d7 100644
--- a/app/(application)/division/[id]/(fitur-division)/discussion/create.tsx
+++ b/app/(application)/division/[id]/(fitur-division)/discussion/create.tsx
@@ -135,21 +135,27 @@ export default function CreateDiscussionDivision() {
{
fileForm.length > 0
&&
-
- File
- {
- fileForm.map((item, index) => (
- 1 ? "bottom" : "none"}
- icon={}
- title={item.name}
- titleWeight="normal"
- onPress={() => { setIndexDelFile(index); setModalFile(true) }}
- />
- ))
- }
-
+ <>
+
+ File
+ {fileForm.length} file
+
+
+ {
+ fileForm.map((item, index) => (
+ }
+ title={item.name}
+ titleWeight="normal"
+ onPress={() => { setIndexDelFile(index); setModalFile(true) }}
+ />
+ ))
+ }
+
+ >
+
}
diff --git a/components/toastCustom.tsx b/components/toastCustom.tsx
index 6385743..c051b4a 100644
--- a/components/toastCustom.tsx
+++ b/components/toastCustom.tsx
@@ -15,7 +15,7 @@ export default function ToastCustom({ position }: { position?: 'top' | 'bottom'
bottomOffset={80}
config={{
small: ({ text1 }) => (
-
+
{text1}
)