Skip to content

Commit

Permalink
refactor: move under src folder
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdikhashan committed Jan 21, 2023
1 parent 1cc7294 commit 8f8f92b
Show file tree
Hide file tree
Showing 22 changed files with 177 additions and 134 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions pages/404.tsx
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.
17 changes: 0 additions & 17 deletions src/pages/404.tsx

This file was deleted.

102 changes: 0 additions & 102 deletions src/ui/Header.tsx

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module.exports = {
important: true,
darkMode: 'class',
content: [
"./src/**/*.{js,ts,jsx,tsx}",
"./**/*.{js,ts,jsx,tsx}",
],
purge: {
enabled: true,
content: ['./src/**/*.tsx'],
content: ['./**/*.tsx'],
},
theme: {
extend: {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/ui/Footer.tsx → ui/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function Footer() {
return (
<>
<div className='flex flex-col md:flex-row mb-16 md:mb-4 gap-2 items-center md:justify-between text-sm text-zinc-600 w-full'>
<span>{'©'} &nbsp; <span>{d.getFullYear()}</span> &nbsp; Mo Khashan. All Rights Reserved.</span>
<span>{'©'} &nbsp; <span>{d.getFullYear()}</span> &nbsp; Mohi Khashan. All Rights Reserved.</span>
<div id="social-media-link" className='hidden md:flex flex-row gap-4'>
<Link href={"https://www.linkedin.com/in/mahdikhashan/"} passHref>
<BsLinkedin className='hover:text-white text-2xl' />
Expand All @@ -33,10 +33,10 @@ export default function Footer() {
{'.'}
</span>
<div id="social-media-link" className='md:hidden flex flex-row gap-4'>
<Link href={"https://www.linkedin.com/in/mahdikhashan/"} passHref>
<Link href={"https://www.linkedin.com/in/mohi-k/"} passHref>
<BsLinkedin className='hover:text-white text-2xl' />
</Link>
<Link href={"https://github.com/mahdikhashan"} passHref>
<Link href={"https://github.com/mohi-k"} passHref>
<BsGithub className='hover:text-white text-2xl' />
</Link>
</div>
Expand Down
127 changes: 127 additions & 0 deletions ui/Header.tsx
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>
</>
);
}
18 changes: 9 additions & 9 deletions src/ui/Info.tsx → ui/Info.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useNinja } from "@/hooks/use-ninja";
import { useNinja } from "hooks/use-ninja";

export default function Info() {
const { allSound } = useNinja();
Expand All @@ -7,26 +7,26 @@ export default function Info() {
<>
<div className="inline-flex">
<h1 className="text-4xl md:text-6xl font-semibold text-white">
Mo Khashan<span className="text-3xl cursor-pointer">🗣️</span>
Mohi Khashan<span className="text-3xl cursor-pointer">🗣️</span>
</h1>
</div>
<p className="text-zinc-500 text-xl md:text-2xl text-left">
Front-end Engineer interested in how technology can enhance intuition
QA Automation Engineer interested in how technology can enhance intuition
and creativity. Experienced with{" "}
<span className="text-orange-500">Javascript</span>,{" "}
<span className="text-orange-500">Typescript</span>,{" "}
<span className="text-orange-500">React</span>,{" "}
<span className="text-orange-500">Next</span>,{" "}
<span className="text-orange-500">React Native</span> and{" "}
<span className="text-orange-500">Python</span>,{" "}
<span className="text-orange-500">Cypress</span>,{" "}
<span className="text-orange-500">Selenium</span>,{" "}
<span className="text-orange-500">CI/CD</span> and{" "}
<span className="text-orange-500">HTML/CSS</span>.
</p>
<p className="text-zinc-500 text-2xl">
As a{" "}
<span className="cursor-pointer" onClick={() => allSound[Math.floor(Math.random() * allSound.length)]()}>
🥷
</span>{" "}
I&apos;ve built, developed and shipped 10+ products (with over +100K
users).
I&apos;ve built, developed and shipped 10+ complex testing solutions for projects with over +100K
users.
</p>
</>
);
Expand Down
File renamed without changes.

0 comments on commit 8f8f92b

Please sign in to comment.