From 416ff0504970d4260208f9e7e43085e95700d6cf Mon Sep 17 00:00:00 2001 From: John Moore <126381092+John-Moore-UOA@users.noreply.github.com> Date: Mon, 30 Sep 2024 23:53:06 +1300 Subject: [PATCH] paths and variables --- .../DashboardDiscover/DashboardDiscover.tsx | 2 +- .../EventsScrollContainer.tsx | 56 +++++------ .../Dashboard/DashboardMain/UpcomingEvent.tsx | 13 +-- web/src/components/Dashboard/Leaderboard.tsx | 7 -- .../components/Dashboard/LeaderboardEntry.tsx | 35 ++++--- .../ProfileMyProfileOverview.tsx | 99 +++++++++++++------ web/src/components/TestComponent.tsx | 2 +- 7 files changed, 127 insertions(+), 87 deletions(-) diff --git a/web/src/components/Dashboard/DashboardDiscover/DashboardDiscover.tsx b/web/src/components/Dashboard/DashboardDiscover/DashboardDiscover.tsx index e330a9c..49faefb 100644 --- a/web/src/components/Dashboard/DashboardDiscover/DashboardDiscover.tsx +++ b/web/src/components/Dashboard/DashboardDiscover/DashboardDiscover.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import EventsScrollContainer from "../dashboardDiscover/EventsScrollContainer"; +import EventsScrollContainer from "../DashboardDiscover/EventsScrollContainer"; import axios from "axios"; import EventDetails from "../DashboardDiscover/EventDetails"; diff --git a/web/src/components/Dashboard/DashboardDiscover/EventsScrollContainer.tsx b/web/src/components/Dashboard/DashboardDiscover/EventsScrollContainer.tsx index 1815d1d..e6e774f 100644 --- a/web/src/components/Dashboard/DashboardDiscover/EventsScrollContainer.tsx +++ b/web/src/components/Dashboard/DashboardDiscover/EventsScrollContainer.tsx @@ -1,35 +1,35 @@ import { Dispatch, SetStateAction } from "react"; -import Event from "../dashboardDiscover/Event.tsx" +import Event from "../DashboardDiscover/Event.tsx"; type Event = { - event_title: string; - description: string; - tasks: string; - notes: string; - contact: string; - tag: string[]; - start_date_time: Date; - end_date_time: Date; - location: string; - image: string; - host: string; - coordinates: {longitude: string, latitude: string}; -} + event_title: string; + description: string; + tasks: string; + notes: string; + contact: string; + tag: string[]; + start_date_time: Date; + end_date_time: Date; + location: string; + image: string; + host: string; + coordinates: { longitude: string; latitude: string }; +}; interface EventsProps { - events: Event[]; - setEventDetails: Dispatch>; + events: Event[]; + setEventDetails: Dispatch>; } -export default function EventsScrollContainer({events, setEventDetails}: EventsProps) { - - return ( -
- {events.map((e, index) => ( - - )) - } - -
- ) -} \ No newline at end of file +export default function EventsScrollContainer({ + events, + setEventDetails, +}: EventsProps) { + return ( +
+ {events.map((e, index) => ( + + ))} +
+ ); +} diff --git a/web/src/components/Dashboard/DashboardMain/UpcomingEvent.tsx b/web/src/components/Dashboard/DashboardMain/UpcomingEvent.tsx index 72d60dd..17c6dfd 100644 --- a/web/src/components/Dashboard/DashboardMain/UpcomingEvent.tsx +++ b/web/src/components/Dashboard/DashboardMain/UpcomingEvent.tsx @@ -1,9 +1,8 @@ - const UpcomingEvent = ({ event }: any) => { - const startTimestamp = event.start_date_time - const startDate = startTimestamp.toDate() - const endTimestamp = event.end_date_time - const endDate = endTimestamp.toDate() + const startTimestamp = event.start_date_time; + const startDate = startTimestamp.toDate(); + //const endTimestamp = event.end_date_time; + //const endDate = endTimestamp.toDate(); return (
@@ -12,7 +11,9 @@ const UpcomingEvent = ({ event }: any) => { src={event.image || "./public/assets/dashboard/emptyEventImage.png"} alt="event image" /> -

Date: {startDate.toLocaleDateString("en-US")}

+

+ Date: {startDate.toLocaleDateString("en-US")} +

{event.event_title}

{event.location}

diff --git a/web/src/components/Dashboard/Leaderboard.tsx b/web/src/components/Dashboard/Leaderboard.tsx index b929c63..086e3e7 100644 --- a/web/src/components/Dashboard/Leaderboard.tsx +++ b/web/src/components/Dashboard/Leaderboard.tsx @@ -3,13 +3,6 @@ import { useState, useEffect } from "react"; import { db } from "../../firebase/firebase"; import { collection, getDocs } from "firebase/firestore"; -interface LeaderboardEntryProps { - rank: number; - img: string; - name: string; - hours: number; -} - function Leaderboard() { const profileImg = "assets/EventHighlights/Events/BlindLowVision/imgA.png"; // Temporary image for the leaderboard const name = "John Doe"; // Temporary name for the leaderboard diff --git a/web/src/components/Dashboard/LeaderboardEntry.tsx b/web/src/components/Dashboard/LeaderboardEntry.tsx index eb75b16..c83800e 100644 --- a/web/src/components/Dashboard/LeaderboardEntry.tsx +++ b/web/src/components/Dashboard/LeaderboardEntry.tsx @@ -1,21 +1,26 @@ -interface LeaderboardEntryProps { - rank: number; - img: string; - name: string; - hours: number; -} - -function LeaderboardEntry({rank, img, fname, lname, hours }: any) { +function LeaderboardEntry({ rank, img, fname, lname, hours }: any) { return (
-

{rank}

-
- profile -

{fname} {lname}

-
- {hours ?

{hours}

:

0

} +

+ {rank} +

+
+ profile +

+ {fname} {lname} +

+
+ {hours ? ( +

{hours}

+ ) : ( +

0

+ )}
); } -export default LeaderboardEntry; \ No newline at end of file +export default LeaderboardEntry; diff --git a/web/src/components/Dashboard/dashboardProfile/ProfileMyProfileOverview.tsx b/web/src/components/Dashboard/dashboardProfile/ProfileMyProfileOverview.tsx index 2db9826..39ae5c0 100644 --- a/web/src/components/Dashboard/dashboardProfile/ProfileMyProfileOverview.tsx +++ b/web/src/components/Dashboard/dashboardProfile/ProfileMyProfileOverview.tsx @@ -1,44 +1,63 @@ -import { useState, useContext } from 'react'; +import { useContext } from "react"; import ProfileEditModal from "../dashboardProfile/ProfileEditModal"; import ProfileEditModalContext from "../../../context/ProfileEditModalContext"; - interface ProfileProps { firstName: string; lastName: string; email: string; mobile: string; - upi: string - dob: string - gender: string - yearLevel: string + upi: string; + dob: string; + gender: string; + yearLevel: string; dietary: string[]; - license: string - emergencyFirstName: string - emergencyLastName: string - relationship: string - emergencyMobile: string + license: string; + emergencyFirstName: string; + emergencyLastName: string; + relationship: string; + emergencyMobile: string; } -const ProfileMyProfileOverview = ({ firstName, lastName, email, gender, mobile, upi, dob, yearLevel, dietary, license, emergencyFirstName, emergencyLastName, relationship, emergencyMobile }: ProfileProps) => { - const { showModal, setShowModal } = useContext(ProfileEditModalContext); +const ProfileMyProfileOverview = ({ + firstName, + lastName, + email, + gender, + mobile, + upi, + dob, + yearLevel, + dietary, + license, + emergencyFirstName, + emergencyLastName, + relationship, + emergencyMobile, +}: ProfileProps) => { + const { showModal, setShowModal } = useContext(ProfileEditModalContext); function handleShowModal() { - setShowModal(true); + setShowModal(true); } return ( <> - {showModal && ()} + {showModal && }
-

Profile Overview

-
@@ -49,7 +68,9 @@ const ProfileMyProfileOverview = ({ firstName, lastName, email, gender, mobile,
{/* Row 1 */}
- +

{firstName}

@@ -66,15 +87,21 @@ const ProfileMyProfileOverview = ({ firstName, lastName, email, gender, mobile,
{/* Row 2 */}
- +

{email}

- +

{mobile}

- +

{dob}

@@ -86,15 +113,21 @@ const ProfileMyProfileOverview = ({ firstName, lastName, email, gender, mobile,
{/* Row 1 */}
- +

{yearLevel}

- +

{dietary}

- +

{license}

@@ -102,11 +135,15 @@ const ProfileMyProfileOverview = ({ firstName, lastName, email, gender, mobile, {/* Emergency Contact Details Section */}
-

Emergency Contact Details

+

+ Emergency Contact Details +

{/* Row 1 */}
- +

{emergencyFirstName}

@@ -114,11 +151,15 @@ const ProfileMyProfileOverview = ({ firstName, lastName, email, gender, mobile,

{emergencyLastName}

- +

{relationship}

- +

{emergencyMobile}

diff --git a/web/src/components/TestComponent.tsx b/web/src/components/TestComponent.tsx index f7c36d3..4249fc3 100644 --- a/web/src/components/TestComponent.tsx +++ b/web/src/components/TestComponent.tsx @@ -1,4 +1,4 @@ -import EventsScrollContainer from "../components/Dashboard/dashboardDiscover/EventsScrollContainer" +import EventsScrollContainer from "../components/Dashboard/DashboardDiscover/EventsScrollContainer"; export default function TestingComponent() { return (