Penambahan notifikasi untuk fitur voting
Fix: - app/(application)/(user)/event/[id]/publish.tsx - app/(application)/(user)/voting/(tabs)/_layout.tsx - app/(application)/(user)/voting/(tabs)/status.tsx - app/(application)/(user)/voting/[id]/index.tsx - app/(application)/(user)/voting/create.tsx - app/(application)/admin/voting/[id]/[status]/index.tsx - app/(application)/admin/voting/[id]/[status]/reject-input.tsx - screens/Admin/Event/funUpdateStatus.ts - screens/Admin/Voting/funUpdateStatus.ts - service/api-admin/api-admin-voting.ts - types/type-collect-other.ts ### No Issue
This commit is contained in:
@@ -21,23 +21,23 @@ import {
|
||||
} from "@/service/api-client/api-event";
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
Redirect,
|
||||
router,
|
||||
Stack,
|
||||
useFocusEffect,
|
||||
useLocalSearchParams,
|
||||
} from "expo-router";
|
||||
import { useCallback, useState } from "react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import Toast from "react-native-toast-message";
|
||||
|
||||
export default function EventDetailPublish() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const now = new Date().toISOString();
|
||||
const { user } = useAuth();
|
||||
const { id } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const [isLoadingData, setIsLoadingData] = useState(false);
|
||||
const [isLoadingJoin, setIsLoadingJoin] = useState(false);
|
||||
|
||||
const now = new Date().toISOString();
|
||||
|
||||
const [data, setData] = useState<any>();
|
||||
const [isParticipant, setIsParticipant] = useState<boolean | null>(null);
|
||||
|
||||
@@ -59,8 +59,6 @@ export default function EventDetailPublish() {
|
||||
userId: user?.id as string,
|
||||
});
|
||||
|
||||
console.log("[RES CHECK PARTICIPANTS]", responseCheckParticipants);
|
||||
|
||||
if (
|
||||
responseCheckParticipants.success &&
|
||||
responseCheckParticipants.data
|
||||
@@ -112,14 +110,21 @@ export default function EventDetailPublish() {
|
||||
}
|
||||
};
|
||||
|
||||
if (
|
||||
id &&
|
||||
data &&
|
||||
data?.tanggalSelesai &&
|
||||
dayjs(data?.tanggalSelesai).isBefore(now)
|
||||
) {
|
||||
console.log("Event sudah selesai");
|
||||
return router.replace(`/event/${id}/history`);
|
||||
const isEventFinished =
|
||||
id && data?.tanggalSelesai && dayjs(data.tanggalSelesai).isBefore(now);
|
||||
|
||||
useEffect(() => {
|
||||
if (isEventFinished) {
|
||||
router.replace(`/(application)/(user)/event/${id}/history`);
|
||||
}
|
||||
}, [isEventFinished, id]);
|
||||
|
||||
if (isEventFinished) {
|
||||
return (
|
||||
<ViewWrapper>
|
||||
<CustomSkeleton />
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
const FooterButton = () => {
|
||||
|
||||
Reference in New Issue
Block a user