aboutsummaryrefslogtreecommitdiff
path: root/pages/404.js
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-07-16 22:35:39 +0700
committerFactiven <[email protected]>2023-07-16 22:35:39 +0700
commit1eee181e219dfd993d396ac3169e7aad3dd285eb (patch)
tree23fe54e9c3f8810f3ac9ab6b29070b4f0d4b9d20 /pages/404.js
parentremoved console.log (diff)
downloadmoopa-1eee181e219dfd993d396ac3169e7aad3dd285eb.tar.xz
moopa-1eee181e219dfd993d396ac3169e7aad3dd285eb.zip
Update v3.6.4
- Added Manga page with a working tracker for AniList user - Added schedule component to home page - Added disqus comment section so you can fight on each other (not recommended) - Added /id and /en route for english and indonesian subs (id route still work in progress)
Diffstat (limited to 'pages/404.js')
-rw-r--r--pages/404.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/pages/404.js b/pages/404.js
index 8cead6b..746e8fa 100644
--- a/pages/404.js
+++ b/pages/404.js
@@ -2,8 +2,26 @@ import Head from "next/head";
import Footer from "../components/footer";
import Navbar from "../components/navbar";
import Link from "next/link";
+import { useEffect, useState } from "react";
+import { parseCookies } from "nookies";
export default function Custom404() {
+ const [lang, setLang] = useState("en");
+ const [cookie, setCookies] = useState(null);
+
+ useEffect(() => {
+ let lang = null;
+ if (!cookie) {
+ const cookie = parseCookies();
+ lang = cookie.lang || null;
+ setCookies(cookie);
+ }
+ if (lang === "en" || lang === null) {
+ setLang("en");
+ } else if (lang === "id") {
+ setLang("id");
+ }
+ }, []);
return (
<>
<Head>
@@ -13,7 +31,7 @@ export default function Custom404() {
<link rel="icon" href="/c.svg" />
</Head>
<Navbar className="bg-[#0c0d10]" />
- <div className="min-h-screen flex flex-col items-center justify-center ">
+ <div className="min-h-screen w-screen flex flex-col items-center justify-center ">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
@@ -88,7 +106,7 @@ export default function Custom404() {
<p className="text-base sm:text-lg xl:text-xl text-gray-300 mb-6 text-center">
The page you're looking for doesn't seem to exist.
</p>
- <Link href="/">
+ <Link href={`/${lang}/`}>
<div className="bg-[#fa7d56] xl:text-xl text-white font-bold py-2 px-4 rounded hover:bg-[#fb6f44]">
Go back home
</div>