From 918162ff8a6aa44485b6a737427226cf025d0906 Mon Sep 17 00:00:00 2001 From: Alex Zhang Date: Fri, 10 Jan 2025 11:59:12 -0800 Subject: [PATCH 1/2] fix stuff --- client/src/components/ApplicationReview/index.tsx | 5 ++++- client/src/components/DashboardStatus/index.tsx | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/client/src/components/ApplicationReview/index.tsx b/client/src/components/ApplicationReview/index.tsx index d31b489..9277c72 100644 --- a/client/src/components/ApplicationReview/index.tsx +++ b/client/src/components/ApplicationReview/index.tsx @@ -56,7 +56,9 @@ const ApplicationReview = ({ } const application: Application = { - phoneNumber: responses.phoneNumber, + phoneNumber: (responses.phoneNumber as string).startsWith('+') + ? responses.phoneNumber + : `+${responses.phoneNumber}`, age: responses.age, university: responses.university, levelOfStudy: responses.levelOfStudy, @@ -92,6 +94,7 @@ const ApplicationReview = ({ // Remove saved data await localforage.removeItem(SAVED_RESPONSES_KEY); + router.refresh(); router.push(next); }} > diff --git a/client/src/components/DashboardStatus/index.tsx b/client/src/components/DashboardStatus/index.tsx index ed68e0f..78588e8 100644 --- a/client/src/components/DashboardStatus/index.tsx +++ b/client/src/components/DashboardStatus/index.tsx @@ -27,13 +27,20 @@ const statusText = (status: string) => { }; const DashboardStatus = ({ status, timeline }: DashboardStatusProps) => { + let statusDescription = ''; + switch (status) { + case 'SUBMITTED': + statusDescription = 'Congrats on applying to DiamondHacks!'; + default: + statusDescription = + 'Our records have indicated that you have not started on your application. Click below to go on your hacker journey!'; + } // TODO return ( <>
Status: {statusText(status)}
- Our records have indicated that you have not started on your application. Click below to go - on your hacker journey! + {statusDescription} Please note that applications are due on {dateFormat.format(timeline.application)}. From d510d73e42e7a0959ba9ae05d304df9e37ac7dbe Mon Sep 17 00:00:00 2001 From: Alex Zhang Date: Fri, 10 Jan 2025 12:03:08 -0800 Subject: [PATCH 2/2] hi --- client/src/components/DashboardStatus/index.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/src/components/DashboardStatus/index.tsx b/client/src/components/DashboardStatus/index.tsx index 78588e8..7875a44 100644 --- a/client/src/components/DashboardStatus/index.tsx +++ b/client/src/components/DashboardStatus/index.tsx @@ -26,21 +26,22 @@ const statusText = (status: string) => { return formatted.charAt(0).toUpperCase() + formatted.slice(1); }; -const DashboardStatus = ({ status, timeline }: DashboardStatusProps) => { - let statusDescription = ''; +const getStatusDescription = (status: string) => { switch (status) { case 'SUBMITTED': - statusDescription = 'Congrats on applying to DiamondHacks!'; + return 'Congrats on applying to DiamondHacks!'; default: - statusDescription = - 'Our records have indicated that you have not started on your application. Click below to go on your hacker journey!'; + return 'Our records have indicated that you have not started on your application. Click below to go on your hacker journey!'; } +}; + +const DashboardStatus = ({ status, timeline }: DashboardStatusProps) => { // TODO return ( <>
Status: {statusText(status)}
- {statusDescription} + {getStatusDescription(status)} Please note that applications are due on {dateFormat.format(timeline.application)}.