-
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
Showing
8 changed files
with
59 additions
and
227 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
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 |
---|---|---|
@@ -1,29 +1,18 @@ | ||
import { Twitter, LinkedinOption } from "grommet-icons" | ||
import Link from 'next/link'; | ||
|
||
export default function Footer() { | ||
const date = new Date() | ||
|
||
return ( | ||
<> | ||
<div className="absolute bottom-0 left-0 w-full bg-gray-900 p-2 text-white"> | ||
<div className="absolute bottom-0 left-0 w-full bg-zinc-900 p-2 text-white"> | ||
<p className="text-center"> | ||
<Link href="mailto:[email protected]" className="hover:text-gray-500 hover:underline hover:cursor-pointer"> | ||
[email protected] | ||
</Link> | ||
</p> | ||
<p className="text-center"> | ||
All music, game, TV and movie covers are owned by their respective authors.<br/>Currently playing info provided by Last.fm | ||
</p> | ||
<p className="text-center"> | ||
© Alex Frantz, 2023 | ||
</p> | ||
<p className="text-center space-x-2"> | ||
<Link href="https://twitter.com/avvex__" target="_blank" rel="noreferrer"> | ||
<Twitter color='plain' size="30" /> | ||
</Link> | ||
|
||
<Link href="https://linkedin.com/in/thatalex" target="_blank" rel="noreferrer"> | ||
<LinkedinOption size="30" /> | ||
</Link> | ||
© Alex Frantz, {date.getFullYear()} | ||
</p> | ||
</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
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 |
---|---|---|
@@ -1,37 +1,64 @@ | ||
import SocialCard from '@/components/SocialCard' | ||
import RootLayout from '@/components/RootLayout'; | ||
import { api } from "@/utils/api"; | ||
import { useSession } from 'next-auth/react'; | ||
import React from 'react'; | ||
import { useRouter } from 'next/router'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
import React, {useState, useEffect} from 'react'; | ||
|
||
export default function Links() { | ||
const router = useRouter(); | ||
const {status} = useSession(); | ||
const [links, setLinks] = useState<React.JSX.Element[] | null>(null); | ||
|
||
// trpc hooks | ||
const { data: linkData } = api.links.getAll.useQuery() | ||
const deleteMutation = api.links.delete.useMutation() | ||
|
||
useEffect(() => { | ||
if (!links && linkData) { | ||
const allLinks = []; | ||
|
||
for (const link of linkData) { | ||
allLinks.push( | ||
<SocialCard | ||
name={link.name} | ||
key={link.id} | ||
url={link.url} | ||
showDelete={status == "authenticated"} | ||
deleteCallback={() => { | ||
deleteMutation.mutate(link.id); | ||
router.reload() | ||
}} | ||
/> | ||
) | ||
} | ||
|
||
setLinks(allLinks) | ||
} | ||
}) | ||
|
||
return ( | ||
<RootLayout> | ||
<div className="space-y-2"> | ||
{ | ||
linkData && linkData.length > 0 ? linkData.map((v) => { | ||
return <SocialCard | ||
url={v.url} | ||
name={v.name} | ||
key={v.name} | ||
showDelete={status === "authenticated"} | ||
deleteCallback={() => { | ||
deleteMutation.mutate(v.id) | ||
}} | ||
/> | ||
}) : | ||
<div className="text-center text-white"> | ||
<h1>Uh oh!</h1> | ||
<p>There's nothing here :(</p> | ||
<main className="bg-black flex flex-col justify-center items-center min-h-screen"> | ||
<Link href="/"> | ||
<h1 className="text-white text-sm underline hover:text-gray-500 pb-2"><- Back Home</h1> | ||
</Link> | ||
<div className="bg-zinc-900 p-10 rounded-sm"> | ||
<div className="pb-2 flex flex-col justify-center items-center"> | ||
<Image className="rounded-lg" width="90" height="90" alt="Profile Picture" src="https://storage.thatalex.dev/content/pfp.png" /> | ||
<div className="text-white text-center pt-2"> | ||
<h1>Alex</h1> | ||
<p>I'm Alex, a QA Engineer by day and developer by night</p> | ||
<hr className="h-px my-2 bg-gray-200 border-0 dark:bg-gray-700" /> | ||
</div> | ||
} | ||
</div> | ||
|
||
<div className="space-y-2"> | ||
{ | ||
links && links.length > 0 ? links : <h1 className="text-center text-white font-bold">Uh oh, there are no links here!</h1> | ||
} | ||
</div> | ||
</div> | ||
</RootLayout> | ||
</main> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.