From c8f188faf16b43cee8c2bf6dbf525a8c563c5904 Mon Sep 17 00:00:00 2001 From: Hanah Kim <75046619+pterodactylt@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:46:19 -0400 Subject: [PATCH] header --- package.json | 2 +- src/app/page.tsx | 2 +- src/components/TopHeader.tsx | 36 ++++++++++++++++++++++-------------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 75e2c26..e18583d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build", + "build": "next build", "start": "next start", "lint": "next lint", "postinstall": "prisma generate" diff --git a/src/app/page.tsx b/src/app/page.tsx index 35796ae..4156eb1 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -7,7 +7,7 @@ export default function Home() { return (
{/* Example Button (ExampleButton.tsx in components folder) */} - + {/* */}
); diff --git a/src/components/TopHeader.tsx b/src/components/TopHeader.tsx index 53fcc9c..09ceb52 100644 --- a/src/components/TopHeader.tsx +++ b/src/components/TopHeader.tsx @@ -1,21 +1,29 @@ import { Icon } from "@iconify/react/dist/iconify.js"; -// interface TopHeaderProps { -// buttonText: string; -// } +interface TopHeaderProps { + userType: string; +} -// TODO: create a div section for the profile on the right -// use a placeholder icon for the profile picture -// style the header so that the button and profile are on opposite ends of the -// header (you can use space-between) - -const TopHeader = () => { +const TopHeader = ({ userType }: TopHeaderProps) => { + // different button text and icon depending on if the user is a volunteer or admin + const buttonText = userType === "admin" ? "Create new event" : "Check in"; + const icon = userType === "admin" ? "ic:baseline-plus" : "mdi:checkbox-outline"; return ( -
- +
+ +
+

SP

+ +

EN

+ +
+

An Tran

+

{userType}

+
+
); };