From a48039a4805ad54bcb7ead5632ca2a6be88e0427 Mon Sep 17 00:00:00 2001 From: Guus van Meerveld Date: Sat, 9 Mar 2024 17:43:41 +0100 Subject: [PATCH] added avatar to landing page --- data/{pfp.jpg => avatar.jpg} | Bin src/app/(landing)/Header.tsx | 60 +++++++++++++++++++---------------- src/app/(landing)/page.tsx | 15 +++------ src/models/header.ts | 1 - src/utils/constants.ts | 2 ++ src/utils/landing.ts | 19 +++++++++-- 6 files changed, 57 insertions(+), 40 deletions(-) rename data/{pfp.jpg => avatar.jpg} (100%) diff --git a/data/pfp.jpg b/data/avatar.jpg similarity index 100% rename from data/pfp.jpg rename to data/avatar.jpg diff --git a/src/app/(landing)/Header.tsx b/src/app/(landing)/Header.tsx index 7da1795..810314a 100644 --- a/src/app/(landing)/Header.tsx +++ b/src/app/(landing)/Header.tsx @@ -12,7 +12,10 @@ import { FiGithub, FiMail, FiLinkedin } from "react-icons/fi"; import HeaderProps from "@models/header"; -export const Header: Component<{ header: HeaderProps }> = ({ header }) => { +export const Header: Component<{ header: HeaderProps; avatar: string }> = ({ + header, + avatar +}) => { const socials = useMemo( () => [ { @@ -36,35 +39,38 @@ export const Header: Component<{ header: HeaderProps }> = ({ header }) => { return (
-
- {header.avatar !== undefined && ( - {`A - )} +
+ {`A -

{header.fullName}

- + -

{header.description}

- +
+

{header.fullName}

+ - {socials.map((social) => ( - - - - - - ))} +

{header.description}

+ + + {socials.map((social) => ( + + + + + + ))} +
); diff --git a/src/app/(landing)/page.tsx b/src/app/(landing)/page.tsx index 167ed91..e49ce37 100644 --- a/src/app/(landing)/page.tsx +++ b/src/app/(landing)/page.tsx @@ -1,22 +1,17 @@ import { Footer } from "../Footer"; import { Header } from "./Header"; -import Landing from "@models/landing"; - import { dataDirLocation } from "@utils/constants"; -import { readLandingJson } from "@utils/landing"; - -const getLanding = async (): Promise => { - // Any error will get handled by the `error.tsx` file. - return await readLandingJson(dataDirLocation); -}; +import { readAvatarFile, readLandingJson } from "@utils/landing"; export default async function Page() { - const landing = await getLanding(); + // Any error will get handled by the `error.tsx` file. + const landing = await readLandingJson(dataDirLocation); + const avatar = await readAvatarFile(dataDirLocation); return ( <> -
+