-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cc7294
commit 8f8f92b
Showing
22 changed files
with
177 additions
and
134 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* eslint-disable react/no-unescaped-entities */ | ||
import Head from 'next/head' | ||
import Link from 'next/link' | ||
|
||
export default function Custom404() { | ||
return ( | ||
<> | ||
<Head> | ||
<title>404 | Mo Khashan</title> | ||
<meta name="description" content="Generated by create next app" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
</Head> | ||
<main> | ||
<div className="flex flex-col justify-center items-start max-w-2xl mx-auto mb-16"> | ||
<h1 className="font-bold text-3xl md:text-5xl tracking-tight mb-4 text-black dark:text-white"> | ||
451 – Unavailable For Legal Reasons | ||
</h1> | ||
<p className="text-gray-600 dark:text-gray-400 mb-8"> | ||
Why show a generic 404 when I can make it sound mysterious? It seems | ||
you've found something that used to exist, or you spelled something | ||
wrong. I'm guessing you spelled something wrong. Can you double check | ||
that URL? | ||
</p> | ||
<Link | ||
href="/" | ||
className="p-1 sm:p-4 w-64 font-bold mx-auto bg-gray-200 dark:bg-gray-800 text-center rounded-md text-black dark:text-white" | ||
> | ||
Return Home | ||
</Link> | ||
</div> | ||
</main> | ||
</> | ||
) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import { useState, useEffect } from "react"; | ||
|
||
import { header } from "@/lib/header"; | ||
import { Turn as Hamburger } from "hamburger-react"; | ||
|
||
import clsx from "clsx"; | ||
|
||
import { usePathname } from "next/navigation"; | ||
|
||
import Link from "next/link"; | ||
|
||
import { useTheme } from "next-themes"; | ||
|
||
const ThemeSwitch = () => { | ||
const [mounted, setMounted] = useState(false); | ||
const { theme, setTheme } = useTheme(); | ||
|
||
useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
if (!mounted) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<select value={theme} onChange={(e) => setTheme(e.target.value)}> | ||
<option value="system">System</option> | ||
<option value="dark">Dark</option> | ||
<option value="light">Light</option> | ||
</select> | ||
); | ||
}; | ||
|
||
export default function Header() { | ||
const pathname = usePathname(); | ||
const [isOpen, setOpen] = useState(false); | ||
|
||
const [mounted, setMounted] = useState(false); | ||
const { resolvedTheme, setTheme } = useTheme(); | ||
|
||
// After mounting, we have access to the theme | ||
useEffect(() => setMounted(true), []); | ||
|
||
|
||
return ( | ||
<> | ||
<div className="relative md:flex font-mono"> | ||
<div | ||
onClick={() => setOpen(!isOpen)} | ||
className={clsx( | ||
"md:hidden !p-y-4 cursor-pointer fixed top-4", | ||
"left-4 right-4 z-10 text-white bg-zinc-800 border-2 rounded-2xl", | ||
{ | ||
"h-18 border-white text-white": !isOpen, | ||
"border-orange-500 text-orange-500": isOpen, | ||
} | ||
)} | ||
> | ||
<div className="flex items-center"> | ||
<Hamburger size={20} toggled={isOpen} /> | ||
<div className="text-xl">Menu</div> | ||
</div> | ||
{isOpen && | ||
header.map((link) => { | ||
const isActive = link.slug === pathname; | ||
|
||
return ( | ||
!link?.isDisabled && ( | ||
<div key={link.name}> | ||
<Link | ||
href={`/${link.slug}`} | ||
className={clsx( | ||
"flex mb-2 px-3 text-s m-2 font-semibold p-1 hover:bg-orange-500 hover:text-white uppercase tracking-wider text-orange-500", | ||
{ "text-zinc-500": !isActive } | ||
)} | ||
> | ||
{link.name} | ||
</Link> | ||
</div> | ||
) | ||
); | ||
})} | ||
</div> | ||
<div className="hidden md:inline-flex"> | ||
{header.map((link) => { | ||
const isActive = link.slug === pathname; | ||
|
||
return ( | ||
!link?.isDisabled && ( | ||
<div key={link.name}> | ||
{ | ||
<Link | ||
href={!link?.redirect ? `/${link.slug}` : link.slug} | ||
passHref={link?.redirect} | ||
target={link?.redirect ? "_blank" : "_self"} | ||
className={clsx( | ||
"flex items-baseline gap-1 mb-2 px-3 text-sm font-semibold uppercase tracking-wider text-orange-500", | ||
{ "text-zinc-500 hover:text-zinc-100": !isActive } | ||
)} | ||
> | ||
{link?.name} | ||
{link?.redirect && ( | ||
<svg | ||
width="13.5" | ||
height="13.5" | ||
aria-hidden="true" | ||
viewBox="0 0 24 24" | ||
className="iconExternalLink_nPIU" | ||
> | ||
<path | ||
fill="currentColor" | ||
d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z" | ||
></path> | ||
</svg> | ||
)} | ||
</Link> | ||
} | ||
</div> | ||
) | ||
); | ||
})} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.