Skip to content

Commit

Permalink
Merge pull request #63 from OH-Fasilkom-UI/feat/gilang
Browse files Browse the repository at this point in the history
Add extend regis
  • Loading branch information
CyberSleeper authored Oct 23, 2023
2 parents 5781cbb + 42d3f62 commit 4f36d56
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
11 changes: 6 additions & 5 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import WTS from "@/sections/home/WTS";
import VideoOH from "@/sections/home/VideoOH";

export default function Home() {
const countdown = new Date(process.env.NEXT_PUBLIC_OPEN_REG_1 || "2023-10-17T12:00:00+0700")
const next_countdown = new Date(process.env.NEXT_PUBLIC_CLOSE_REG_1 || "2023-10-21T23:59:59+0700")
const bef_countdown = new Date(process.env.NEXT_PUBLIC_OPEN_REG_1 || "2023-10-17T12:00:00+0700")
const countdown = new Date(process.env.NEXT_PUBLIC_OPEN_REG_2 || "2023-10-17T12:00:00+0700")
const next_countdown = new Date(process.env.NEXT_PUBLIC_CLOSE_REG_2 || "2023-10-21T23:59:59+0700")
const is_counting = new Date() < countdown
const open_reg = new Date() < next_countdown

Expand All @@ -25,10 +26,10 @@ export default function Home() {
FASILKOM 2023
</h1>
<div className="font-satoshi text-center flex flex-col items-center text-lg w-full">
<h2 className="text-2xl mb-2 font-semibold font-satoshi">{is_counting ? "Open registration" : <>{open_reg ? "Registration will be closed" : "Registration closed"}</>}</h2>
<h2 className="text-2xl mb-2 font-semibold font-satoshi">{is_counting ? "Registration closed" : <>{open_reg ? "Registration is extended" : "Registration closed"}</>}</h2>
<Image src="/home/countdown-arrow.svg" alt="" width={100} height={100}/>
<Countdown date={is_counting ? countdown : next_countdown} />
<h3 className="mt-2 text-sm sm:text-lg font-bold">{is_counting ? "17 Oktober 2023, 12:00 GMT+7" : "21 Oktober 2023, 23:59 GMT+7"}</h3>
<Countdown date={is_counting ? bef_countdown : next_countdown} />
<h3 className="mt-2 text-sm sm:text-lg font-bold">{is_counting ? "21 Oktober 2023, 23:59 GMT+7" : "1 November 2023, 23:59 GMT+7"}</h3>
</div>
<div className="flex items-center gap-3">
<Link href="#definition">
Expand Down
15 changes: 8 additions & 7 deletions src/pages/registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import FAQ from "@/sections/registration/FAQ";
import ContactPerson from "@/sections/registration/ContactPerson";

export default function Home() {
const countdown = new Date(process.env.NEXT_PUBLIC_OPEN_REG_1 || "2023-10-17T12:00:00+0700")
const next_countdown = new Date(process.env.NEXT_PUBLIC_CLOSE_REG_1 || "2023-10-21T23:59:59+0700")
const bef_countdown = new Date(process.env.NEXT_PUBLIC_OPEN_REG_1 || "2023-10-17T12:00:00+0700")
const countdown = new Date(process.env.NEXT_PUBLIC_OPEN_REG_2 || "2023-10-17T12:00:00+0700")
const next_countdown = new Date(process.env.NEXT_PUBLIC_CLOSE_REG_2 || "2023-10-21T23:59:59+0700")
const is_counting = new Date() < countdown
const open_reg = new Date() < next_countdown

Expand All @@ -28,10 +29,10 @@ export default function Home() {
</span>
</h1>
<div className="font-satoshi text-center flex flex-col items-center text-lg w-full px-2">
<h2 className="text-xl mb-2 font-semibold font-satoshi">{is_counting ? "Open registration" : <>{open_reg ? "" : "Registration closed"}</>}</h2>
<h2 className="text-xl mb-2 font-semibold font-satoshi">{is_counting ? "Registration closed" : <>{open_reg ? "Registration is extended" : "Registration closed"}</>}</h2>
<Image src="/home/countdown-arrow.svg" alt="" width={100} height={100}/>
<Countdown date={is_counting ? countdown : next_countdown} />
<h3 className="mt-2 text-sm sm:text-lg font-bold">{is_counting ? "17 Oktober 2023, 12:00 GMT+7" : "21 Oktober 2023, 23:59 GMT+7"}</h3>
<Countdown date={is_counting ? bef_countdown : next_countdown} />
<h3 className="mt-2 text-sm sm:text-lg font-bold">{is_counting ? "21 Oktober 2023, 23:59 GMT+7" : "1 November 2023, 23:59 GMT+7"}</h3>
</div>
<div className="flex sm:flex-row flex-col-reverse items-center gap-3">
<Link href="#keseruan" className="sm:w-auto w-full">
Expand All @@ -46,8 +47,8 @@ export default function Home() {
className="opacity-30 font-satoshi font-bold sm:w-auto w-full"
onClick={() => {
notifications.show({
title: 'Hi AInergic, sesaat lagi registrasi Open House Fasilkom UI akan dibuka',
message: 'Silahkan cek lagi web page ini pada pukul 12.00 WIB, 17 Oktober yaa. See you soon!',
title: 'Hi AInergic untuk sekarang registrasi telah ditutup yaa',
message: 'Bagi kalian yang masih ingin menjadi bagian dari Open House Fasilkom UI, tunggu kabar dari kami yaa',
color: "red"
})
}}
Expand Down
2 changes: 1 addition & 1 deletion src/sections/registration/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const contentData: {
},
{
header: "Batas waktu pendaftaran sampai kapan?",
body: `Untuk batas pendaftaran cuma sampai tanggal 21 Oktober 2023, Yuk langsung aja daftar!`,
body: `Untuk batas pendaftaran cuma sampai tanggal 1 November 2023, Yuk langsung aja daftar!`,
},
{
header: "Semigap/Gapyear boleh ikut?",
Expand Down

0 comments on commit 4f36d56

Please sign in to comment.