show project loading more gracefully

This commit is contained in:
2024-11-28 16:42:24 -05:00
parent 4b1fc2812e
commit 12e79791da
9 changed files with 44 additions and 39 deletions
+3 -2
View File
@@ -9,7 +9,9 @@ export default function Header() {
"Professional Production Tester", "Professional Production Tester",
"I break hearts to save lives.", "I break hearts to save lives.",
"go bills", "go bills",
"josh allen is my goat" "josh allen is my goat",
"lets go buffalo",
"oorah"
] ]
const [ quote, setQuote ] = useState<string>(quoteArray[Math.floor(Math.random() * quoteArray.length)]); const [ quote, setQuote ] = useState<string>(quoteArray[Math.floor(Math.random() * quoteArray.length)]);
@@ -31,7 +33,6 @@ export default function Header() {
<p className="opacity-50 italic select-none" onClick={drawNewQuote}>{quote}</p> <p className="opacity-50 italic select-none" onClick={drawNewQuote}>{quote}</p>
</div> </div>
<div className="space-x-2 items-center justify-center flex select-none"> <div className="space-x-2 items-center justify-center flex select-none">
<a className="hover:underline" href="#about">About</a>
<a className="hover:underline" href="#projects">Projects</a> <a className="hover:underline" href="#projects">Projects</a>
<a className="hover:underline" href="#data">Data</a> <a className="hover:underline" href="#data">Data</a>
<a className="hover:underline" href="#contact">Contact</a> <a className="hover:underline" href="#contact">Contact</a>
+4 -2
View File
@@ -10,7 +10,7 @@ export default function ProjectComponent({
header: string, header: string,
projectHeader: string, projectHeader: string,
projectSubheader: string, projectSubheader: string,
projectImage: string, projectImage?: string,
projectImageSize?: string projectImageSize?: string
}) { }) {
return ( return (
@@ -20,7 +20,9 @@ export default function ProjectComponent({
<div className="block"> <div className="block">
<div className="flex items-center"> <div className="flex items-center">
<img src={projectImage} width={projectImageSize} className="flex-shrink-0" /> {
projectImage && <img src={projectImage} width={projectImageSize} className="flex-shrink-0" />
}
<div className="flex flex-col mx-2 min-w-0 flex-grow"> <div className="flex flex-col mx-2 min-w-0 flex-grow">
<h1 className="font-bold text-left truncate">{projectHeader}</h1> <h1 className="font-bold text-left truncate">{projectHeader}</h1>
@@ -67,11 +67,12 @@ export default function RecentBook() {
) )
} else { } else {
return ( return (
<> <ProjectComponent
<h1 className="font-bold text-2xl">No data :(</h1> header={"What I'm reading"}
<p>Check out <a className="underline" href="https://tracker.alexav.gg" target="_blank">tracker.alexav.gg</a> if this isn't working.</p> projectHeader={"No data :("}
<p className="text-sm italic">{errorState}</p> projectSubheader={loading ? "Loading data.." : "Something went wrong fetching data! " + errorState}
</> url={"/"}
/>
) )
} }
} }
@@ -61,10 +61,11 @@ export default function RecentClip() {
/> />
) )
} else { } else {
<> return <ProjectComponent
<h1 className="font-bold text-2xl">No data :(</h1> header={"Clips I've taken"}
<p>Check out <a className="underline" href="https://medal.tv/u/alexav" target="_blank">medal.tv/u/alexav</a> if this isn't working.</p> projectHeader={"No data :("}
<p className="text-sm italic">{errorState}</p> projectSubheader={loading ? "Loading data.." : "Something went wrong fetching data! " + errorState}
</> url={"/"}
/>
} }
} }
@@ -54,10 +54,11 @@ export default function RecentGame() {
/> />
) )
} else { } else {
<> return <ProjectComponent
<h1 className="font-bold text-2xl">No data :(</h1> header={"Games I'm playing"}
<p>Check out <a className="underline" href="https://steamcommunity.com/id/luvxavierr" target="_blank">steamcommunity.com/id/luvxavierr</a> if this isn't working.</p> projectHeader={"No data :("}
<p className="text-sm italic">{errorState}</p> projectSubheader={loading ? "Loading data.." : "Something went wrong fetching data! " + errorState}
</> url={"/"}
/>
} }
} }
@@ -38,10 +38,11 @@ export default function RecentListens() {
/> />
) )
} else { } else {
<> return <ProjectComponent
<h1 className="font-bold text-2xl">No data :(</h1> header={"Music I'm listening to"}
<p>Check out <a className="underline" href="https://last.fm/user/lulawex" target="_blank">last.fm/lulawex</a> if this isn't working.</p> projectHeader={"No data :("}
<p className="text-sm italic">{errorState}</p> projectSubheader={loading ? "Loading data.." : "Something went wrong fetching data! " + errorState}
</> url={"/"}
/>
} }
} }
@@ -57,11 +57,12 @@ export default function RecentPhoto() {
) )
} else { } else {
return ( return (
<> <ProjectComponent
<h1 className="font-bold text-2xl">No data :(</h1> header={"Photos I've captured"}
<p>Check out <a className="underline" href="https://photos.alexav.gg" target="_blank">photos.alexav.gg</a> if this isn't working.</p> projectHeader={"No data :("}
<p className="text-sm italic">{errorState}</p> projectSubheader={loading ? "Loading data.." : "Something went wrong fetching data! " + errorState}
</> url={"/"}
/>
) )
} }
@@ -71,11 +71,12 @@ export default function RecentWatch() {
) )
} else { } else {
return ( return (
<> <ProjectComponent
<h1 className="font-bold text-2xl">No data :(</h1> header={"What I'm watching"}
<p>Check out <a className="underline" href="https://tracker.alexav.gg" target="_blank">tracker.alexav.gg</a> if this isn't working.</p> projectHeader={"No data :("}
<p className="text-sm italic">{errorState}</p> projectSubheader={loading ? "Loading data.." : "Something went wrong fetching data! " + errorState}
</> url={"/"}
/>
) )
} }
} }
+1 -5
View File
@@ -18,7 +18,7 @@ export default function Home() {
<div className="w-full mx-auto text-center p-10"> <div className="w-full mx-auto text-center p-10">
<div className="my-1"> <div className="my-1">
<h1 className="text-3xl font-bold">Hi, I'm Alex</h1> <h1 className="text-3xl font-bold">Hi, I'm Alex</h1>
<p>I'm a junior developer working as QA + sometimes writing questionable code at <a className="hover:underline text-yellow-400" href="https://medal.tv" target="_blank">Medal.tv</a></p> <p>I'm a junior developer primarily working as QA, but sometimes writing questionable code at <a className="hover:underline text-yellow-400" href="https://medal.tv" target="_blank">Medal.tv</a></p>
</div> </div>
<div className="block space-x-2"> <div className="block space-x-2">
@@ -39,10 +39,6 @@ export default function Home() {
<LinkedIn /> <LinkedIn />
</a> </a>
</div> </div>
<div className="my-4">
<a className="p-2 bg-white text-black rounded-lg" href="#projects">View My Work</a>
</div>
</div> </div>
</section> </section>