-
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.
feat: refactor to use layouts, tinker w experimental link shortener i…
…dea, next/font
- Loading branch information
1 parent
8322fc4
commit 415ad49
Showing
25 changed files
with
821 additions
and
401 deletions.
There are no files selected for viewing
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,4 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true | ||
} |
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,29 @@ | ||
import { notFound, redirect } from 'next/navigation'; | ||
import { getLinks } from '../../../lib/server/getLinks'; | ||
|
||
export const dynamic = 'error'; | ||
|
||
async function LinkShortener({ params }: { params: { redirectSlug: string } }) { | ||
console.log('hi'); | ||
const { redirectSlug } = params; | ||
const links = await getLinks(); | ||
|
||
if (!redirect) notFound(); | ||
|
||
const link = links[redirectSlug]; | ||
if (link) { | ||
console.log({ link }); | ||
redirect(link['Redirect URL']); | ||
} else { | ||
console.log('lol'); | ||
notFound(); | ||
} | ||
} | ||
|
||
export async function generateStaticParams() { | ||
return Object.keys(await getLinks()).map((redirectSlug) => ({ | ||
redirectSlug, | ||
})); | ||
} | ||
|
||
export default LinkShortener; |
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,20 @@ | ||
import styles from '../../styles/palettes.module.css'; | ||
|
||
export const revalidate = 60; | ||
|
||
function Index({ children }: { children: React.ReactNode }) { | ||
const paletteOptions = Object.keys(styles); | ||
const palette = | ||
paletteOptions[Math.floor(Math.random() * paletteOptions.length)]; | ||
return ( | ||
<div className={styles[palette]}> | ||
<div className="flex justify-center w-full text-sm bg-back min-h-screen text-[1.25em] sm:text-[1.3em]"> | ||
<div className="flex flex-col items-start justify-center leading-9 gap-y-4 my-[4em] mx-[2em] sm:m-16 max-w-2xl text-content font-sans"> | ||
{children} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Index; |
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,25 @@ | ||
import Signature from '../../../components/Signature'; | ||
import { getLinks } from '../../../lib/server/getLinks'; | ||
|
||
export const dynamic = 'error'; | ||
|
||
async function LinkList() { | ||
const links = Object.values(await getLinks()).filter((link) => link.Public); | ||
return ( | ||
<div className="flex flex-col gap-8 items-center"> | ||
<Signature /> | ||
{links.map((link) => ( | ||
<button key={link.Slug} type="button"> | ||
<a | ||
className="p-4 w-full h-full bg-accent text-back hover:bg-back hover:text-accent transition border border-accent" | ||
href={link['Redirect URL']} | ||
> | ||
{link['Friendly Name']} | ||
</a> | ||
</button> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export default LinkList; |
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,66 @@ | ||
import Email from '../../components/Email'; | ||
import Signature from '../../components/Signature'; | ||
import StyledLink from '../../components/StyledLink'; | ||
|
||
function Content() { | ||
return ( | ||
<> | ||
<Signature /> | ||
<p> | ||
🧑🏾💻 Hey there! I'm Jason Antwi-Appah. I'm a 17-year-old student | ||
and maker that loves all sorts of tech. | ||
</p> | ||
<p> | ||
🛬 I was raised in London, but now live in Austin, TX and attend school | ||
at the University of Texas at Dallas. | ||
</p> | ||
<p>Right now, I'm:</p> | ||
<ul> | ||
<li> | ||
✨ Learning and hacking with friends in{' '} | ||
<StyledLink href="https://hackclub.com">Hack Club</StyledLink> | ||
</li> | ||
<li> | ||
🎓 Completing a Computer Science degree at{' '} | ||
<StyledLink href="https://utdallas.edu">UT Dallas</StyledLink> | ||
</li> | ||
</ul> | ||
<p> | ||
Outside of software engineering, I love music production, | ||
broadcast/audiovisual technology, and all things technical theatre!{' '} | ||
<StyledLink href="https://scrapbook.hackclub.com/jasonaa"> | ||
My Scrapbook | ||
</StyledLink>{' '} | ||
has some of the things I'm working on. | ||
</p> | ||
|
||
<p> | ||
Feel free to shoot me an email → | ||
<Email/> | ||
. You also can find me on{' '} | ||
<StyledLink href="https://github.com/jasonappah">GitHub</StyledLink>,{' '} | ||
<StyledLink href="https://twitter.com/jasonaa_">Twitter</StyledLink> and{' '} | ||
<StyledLink href="https://linkedin.com/in/jasonaa">LinkedIn</StyledLink> | ||
. | ||
</p> | ||
<p> | ||
Here's this site's{' '} | ||
<StyledLink | ||
href={`https://github.com/jasonappah/v2/tree/${ | ||
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA || 'main' | ||
}`} | ||
> | ||
source code | ||
</StyledLink> | ||
. | ||
</p> | ||
<p className="text-[0.01em]"> | ||
psssst if you're a teen interested in joining a community of other | ||
teens in computer science or tech in general, you should check out{' '} | ||
<StyledLink href="https://hackclub.com">Hack Club!</StyledLink> | ||
</p> | ||
</> | ||
); | ||
} | ||
|
||
export default Content; |
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,19 @@ | ||
function Head() { | ||
return ( | ||
<> | ||
<title>Jason Antwi-Appah</title> | ||
<meta name="viewport" content="width=device-width" /> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:title" content="Jason Antwi-Appah" /> | ||
<meta | ||
property="og:description" | ||
content="Hi! I'm a 17-year-old student and maker that loves all sorts of tech." | ||
/> | ||
<meta property="og:url" content="https://jasonaa.me" /> | ||
<meta property="og:image" content="/og.png" /> | ||
<link rel="icon" type="image/png" href="favicon.png" /> | ||
</> | ||
); | ||
} | ||
|
||
export default Head; |
Binary file not shown.
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,23 @@ | ||
import 'tailwindcss/tailwind.css'; | ||
import localFont from '@next/font/local'; | ||
import AnalyticsWrapper from '../components/Analytics'; | ||
|
||
const klimaWeb = localFont({ | ||
src: './klima-variable.ttf', | ||
variable: '--font-klima', | ||
}); | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<html lang="en" className={klimaWeb.variable}> | ||
<body> | ||
{children} | ||
<AnalyticsWrapper /> | ||
</body> | ||
</html> | ||
); | ||
} |
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,9 @@ | ||
'use client'; | ||
|
||
import { Analytics } from '@vercel/analytics/react'; | ||
|
||
function AnalyticsWrapper() { | ||
return <Analytics />; | ||
} | ||
|
||
export default AnalyticsWrapper; |
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,20 @@ | ||
'use client'; | ||
|
||
import { useEffect, useState } from 'react'; | ||
import StyledLink from './StyledLink'; | ||
|
||
export default function Email() { | ||
const [electronicMailIdentifier, setEmail] = useState('...'); | ||
useEffect(() => { | ||
setEmail(Buffer.from('aGV5QGphc29uYWEubWU=', 'base64').toString('utf8')); | ||
console.log( | ||
'👋 you should also follow my Instagram: https://instagram.com/jasonaa_' | ||
); | ||
}, []); | ||
return ( | ||
<StyledLink href={`mailto:${electronicMailIdentifier}`}> | ||
<noscript>sorry, you need JavaScript enabled for this</noscript> | ||
{electronicMailIdentifier} | ||
</StyledLink> | ||
); | ||
} |
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,24 @@ | ||
import Link from 'next/link'; | ||
import { | ||
PropsWithChildren, | ||
DetailedHTMLProps, | ||
AnchorHTMLAttributes, | ||
} from 'react'; | ||
|
||
function StyledLink({ | ||
children, | ||
href, | ||
}: PropsWithChildren< | ||
DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> | ||
>) { | ||
return ( | ||
<Link | ||
href={href} | ||
className="transition text-accent hover:text-back hover:bg-content" | ||
> | ||
{children} | ||
</Link> | ||
); | ||
} | ||
|
||
export default StyledLink; |
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
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.