Skip to content

Commit

Permalink
add default tailwind template
Browse files Browse the repository at this point in the history
  • Loading branch information
brignano authored Jul 20, 2024
1 parent 2a04bb3 commit a70aafd
Show file tree
Hide file tree
Showing 11 changed files with 553 additions and 176 deletions.
446 changes: 446 additions & 0 deletions app/_components/_about/about.tsx

Large diffs are not rendered by default.

File renamed without changes.
36 changes: 36 additions & 0 deletions app/_components/_about/social-icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Social } from "@/resume";
import { EnvelopeIcon, UserPlusIcon } from "@heroicons/react/20/solid";

interface SocialIconsProps {
socials?: Social[];
email: string;
}

export default function SocialIcons(props: SocialIconsProps) {
const { socials, email } = props;

return (
<div className="container inline-flex">
<a href={`mailto:${email}`}>
<EnvelopeIcon
aria-hidden="true"
className="h-5 w-5 text-gray-300 hover:text-indigo-300"
/>
</a>
{socials?.map((social, index) => {
return (
<a
href={`https://github.com/${social.username}`}
key={index}
className="px-2"
>
<UserPlusIcon
aria-hidden="true"
className="h-5 w-5 text-gray-300 hover:text-indigo-300"
/>
</a>
);
})}
</div>
);
}
17 changes: 0 additions & 17 deletions app/_components/about.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions app/api/resume/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function GET() {

if (!response.ok) {
return new Response(
`Could not find Gist. Please validate this Gist exists and is public (not secret): ${publicRuntimeConfig.jsonResumeUrl}`,
`Failed to find Resume. Please validate the URL exists and is publically accessible: ${publicRuntimeConfig.jsonResumeUrl}`,
{
status: StatusCodes.NOT_FOUND,
statusText: ReasonPhrases.NOT_FOUND,
Expand All @@ -20,11 +20,11 @@ export async function GET() {

try {
const jsonResume = await response.json();
logger.warn(`jsonResume: ${JSON.stringify(jsonResume, null, 2)}`);
logger.debug(`jsonResume: ${JSON.stringify(jsonResume, null, 2)}`);
return Response.json(jsonResume as Resume);
} catch (e) {
return new Response(
`File does not exist and/or is not (publically) accessible: ${publicRuntimeConfig.jsonResumeUrl}`,
`Failed to parse JSON. Please validate the file is in a validate JSON format: ${publicRuntimeConfig.jsonResumeUrl}`,
{
status: StatusCodes.NOT_FOUND,
statusText: ReasonPhrases.NOT_FOUND,
Expand Down
8 changes: 6 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import "./globals.css";
const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: {
template: "%s | Resume",
default: "Resume",
},
description: "My personal portfolio and resume.",
metadataBase: new URL("https://github.com/brignano/res-gen"),
};

export default function RootLayout({
Expand Down
34 changes: 10 additions & 24 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
"use client";
import About from "@/app/_components/_about/about";
import type { Resume } from "@/resume";

import { useEffect, useState } from "react";
import LoadingSpinner from "./_components/loading-spinner";
import About from "./_components/about";
import { Resume } from "@/resume";

export default function Home() {
const [resume, setResume] = useState({} as Resume);
const [error, setError] = useState(null);
const [isLoading, setLoading] = useState(true);

useEffect(() => {
fetch("/api/resume")
.then((res) => res.json())
.then((data) => {
setResume(data as Resume);
setLoading(false);
})
.catch((e) => setError(e));
}, []);

if (isLoading) return <LoadingSpinner />;
if (!resume) return <p>{error}</p>;
export default async function Resume() {
const response = await fetch(`http://localhost:3000/api/resume`, {
next: { revalidate: 120 },
});
const resume = (await response.json()) as Resume;

return (
<main>
<About about={resume.about} />
<div className="container">
<About about={resume.about} />
</div>
</main>
);
}
Loading

0 comments on commit a70aafd

Please sign in to comment.