From 50a0f0240d7fef133eb5acc1bea2b1168b08e9db Mon Sep 17 00:00:00 2001 From: Factiven Date: Sun, 24 Dec 2023 13:03:54 +0700 Subject: migrate to typescript --- components/shared/footer.js | 185 -------------------------------------------- 1 file changed, 185 deletions(-) delete mode 100644 components/shared/footer.js (limited to 'components/shared/footer.js') diff --git a/components/shared/footer.js b/components/shared/footer.js deleted file mode 100644 index a29a3d3..0000000 --- a/components/shared/footer.js +++ /dev/null @@ -1,185 +0,0 @@ -import Link from "next/link"; -import { useState } from "react"; -import { useRouter } from "next/router"; - -function Footer() { - const [year] = useState(new Date().getFullYear()); - const [season] = useState(getCurrentSeason()); - - const [checked, setChecked] = useState(false); - - const router = useRouter(); - - function switchLang() { - setChecked(!checked); - if (checked) { - router.push("/en"); - } else { - router.push("/id"); - } - } - - return ( - - ); -} - -export default Footer; - -function getCurrentSeason() { - const now = new Date(); - const month = now.getMonth() + 1; // getMonth() returns 0-based index - - switch (month) { - case 12: - case 1: - case 2: - return "WINTER"; - case 3: - case 4: - case 5: - return "SPRING"; - case 6: - case 7: - case 8: - return "SUMMER"; - case 9: - case 10: - case 11: - return "FALL"; - default: - return "UNKNOWN SEASON"; - } -} -- cgit v1.2.3