Merge pull request #173 from bipproduction/event/konfirmasi
Event/konfirmasi
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.2.21](https://github.com/bipproduction/hipmi/compare/v1.2.20...v1.2.21) (2024-12-09)
|
||||||
|
|
||||||
## [1.2.20](https://github.com/bipproduction/hipmi/compare/v1.2.19...v1.2.20) (2024-12-09)
|
## [1.2.20](https://github.com/bipproduction/hipmi/compare/v1.2.19...v1.2.20) (2024-12-09)
|
||||||
|
|
||||||
## [1.2.19](https://github.com/bipproduction/hipmi/compare/v1.2.18...v1.2.19) (2024-12-06)
|
## [1.2.19](https://github.com/bipproduction/hipmi/compare/v1.2.18...v1.2.19) (2024-12-06)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.2.20",
|
"version": "1.2.21",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "npx tsx prisma/seed.ts --yes"
|
"seed": "npx tsx prisma/seed.ts --yes"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bun --bun run next dev --experimental-https",
|
"dev": "bun --bun run next dev --experimental-https",
|
||||||
"build": "NODE_OPTIONS='--max-old-space-size=2048' bun --bun run next build",
|
"build": "NODE_OPTIONS='--max-old-space-size=2048' bun --bun run next build",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { Event_funJoinAndConfirmEvent } from "../fun/create/fun_join_and_confirm
|
|||||||
import { gs_event_hotMenu } from "../global_state";
|
import { gs_event_hotMenu } from "../global_state";
|
||||||
import { MODEL_EVENT } from "../model/interface";
|
import { MODEL_EVENT } from "../model/interface";
|
||||||
import { Event_funJoinEvent } from "../fun/create/fun_join_event";
|
import { Event_funJoinEvent } from "../fun/create/fun_join_event";
|
||||||
|
import "moment/locale/id";
|
||||||
|
|
||||||
export default function Ui_Konfirmasi({
|
export default function Ui_Konfirmasi({
|
||||||
userLoginId,
|
userLoginId,
|
||||||
@@ -88,7 +89,7 @@ export default function Ui_Konfirmasi({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Jika tanggal acara lewat
|
// Jika tanggal acara sudah lewat
|
||||||
if (moment(data?.tanggalSelesai).diff(moment(), "minute") < 0) {
|
if (moment(data?.tanggalSelesai).diff(moment(), "minute") < 0) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -97,6 +98,15 @@ export default function Ui_Konfirmasi({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Jika join true
|
||||||
|
if (isJoin == true && moment(data?.tanggal).diff(moment(), "minute") > 0) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<UserJoinTrue title={data?.title} tanggal={data?.tanggal} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Jika belum join dan tanggal mulai acara belum lewat
|
// Jika belum join dan tanggal mulai acara belum lewat
|
||||||
if (isJoin == false && moment(data?.tanggal).diff(moment(), "minute") > 0) {
|
if (isJoin == false && moment(data?.tanggal).diff(moment(), "minute") > 0) {
|
||||||
return (
|
return (
|
||||||
@@ -125,8 +135,13 @@ export default function Ui_Konfirmasi({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Jika sudah join, belum konfirm dan acara sudah mulai
|
// Jika sudah join, sudah konfirmasi dan tanggal mulai acara sudah lewat
|
||||||
if (isPresent && moment(data?.tanggal).diff(moment(), "minute") < 0) {
|
// if (isPresent && moment(data?.tanggal).diff(moment(), "minute") < 0)
|
||||||
|
if (
|
||||||
|
isPresent &&
|
||||||
|
isJoin &&
|
||||||
|
moment(data?.tanggal).diff(moment(), "minute") < 0
|
||||||
|
) {
|
||||||
return <UserAlreadyConfirm title={data.title} />;
|
return <UserAlreadyConfirm title={data.title} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,6 +214,52 @@ function SkeletonIsDataNull() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function UserJoinTrue({ title, tanggal }: { title: string; tanggal: Date }) {
|
||||||
|
const router = useRouter();
|
||||||
|
const [isLoading, setLoading] = useState(false);
|
||||||
|
const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<UIGlobal_LayoutDefault>
|
||||||
|
<Stack h={"100vh"} justify="center">
|
||||||
|
<ComponentGlobal_CardStyles>
|
||||||
|
<Stack align="center" justify="center">
|
||||||
|
<Text align="center">
|
||||||
|
Terima kasih, Bapak/Ibu, Anda telah berhasil bergabung dalam
|
||||||
|
acara{" "}
|
||||||
|
<Text inherit span fw={"bold"}>
|
||||||
|
{title}
|
||||||
|
</Text>{" "}
|
||||||
|
. Mohon ditunggu hingga tanggal{" "}
|
||||||
|
<Text inherit span fw={"bold"}>
|
||||||
|
{moment(tanggal).format("DD-MM-YYYY")}
|
||||||
|
</Text>{" "}
|
||||||
|
untuk melakukan konfirmasi kehadiran melalui aplikasi HIPMI APP.
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
loading={isLoading}
|
||||||
|
loaderPosition="center"
|
||||||
|
radius={"xl"}
|
||||||
|
color="green"
|
||||||
|
c={"black"}
|
||||||
|
onClick={() => {
|
||||||
|
setHotMenu(0);
|
||||||
|
setLoading(true);
|
||||||
|
router.push(RouterEvent.beranda, { scroll: false });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Beranda
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
</ComponentGlobal_CardStyles>
|
||||||
|
</Stack>
|
||||||
|
</UIGlobal_LayoutDefault>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function UserAllowToJoin({
|
function UserAllowToJoin({
|
||||||
title,
|
title,
|
||||||
tanggal,
|
tanggal,
|
||||||
|
|||||||
Reference in New Issue
Block a user