From 48dccb821eb6b4ae47fc02823fdb774d2f5b2169 Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Wed, 2 Nov 2022 17:03:35 +0800 Subject: [PATCH] [offers][refactor] tweak submit and analysis steps UI --- .../offers/offerAnalysis/OfferAnalysis.tsx | 20 ++-- .../offersSubmission/OffersProfileSave.tsx | 103 ++++++++++-------- .../OffersSubmissionAnalysis.tsx | 6 +- .../offersSubmission/OffersSubmissionForm.tsx | 2 +- .../offers/submit/result/[offerProfileId].tsx | 74 +++++++------ .../portal/src/server/router/offers/offers.ts | 5 +- 6 files changed, 111 insertions(+), 99 deletions(-) diff --git a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx index 2cf876f2..e7e6199b 100644 --- a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx +++ b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react'; import { useState } from 'react'; -import { HorizontalDivider, Spinner, Tabs } from '@tih/ui'; +import { Alert, HorizontalDivider, Spinner, Tabs } from '@tih/ui'; import OfferPercentileAnalysisText from './OfferPercentileAnalysisText'; import OfferProfileCard from './OfferProfileCard'; @@ -22,17 +22,19 @@ function OfferAnalysisContent({ if (!analysis || analysis.noOfOffers === 0) { if (tab === OVERALL_TAB) { return ( -

- You are the first to submit an offer for your job title and YOE! Check - back later when there are more submissions. -

+ + You are among the first to submit an offer for your job title and + years of experience! Check back later when there are more submissions. + ); } + return ( -

- You are the first to submit an offer for this company, job title and - YOE! Check back later when there are more submissions. -

+ + You are among the first to submit an offer for this company, job title + and years of experience! Check back later when there are more + submissions. + ); } return ( diff --git a/apps/portal/src/components/offers/offersSubmission/OffersProfileSave.tsx b/apps/portal/src/components/offers/offersSubmission/OffersProfileSave.tsx index 597c08cc..2ffecdcd 100644 --- a/apps/portal/src/components/offers/offersSubmission/OffersProfileSave.tsx +++ b/apps/portal/src/components/offers/offersSubmission/OffersProfileSave.tsx @@ -73,58 +73,67 @@ export default function OffersProfileSave({ }; return ( -
+
-
+

Save for future edits -

-

We value your privacy.

-

- To keep you offer profile strictly anonymous, only people who have the - link below can edit it. + +

+ We value your privacy

-
-
- +
+

+ To keep your offer profile strictly anonymous, it is not linked to + your user account. Only people who have the link below can edit + it. If you want to edit the profile in future, store the link + somewhere. +

+
+
+ +
+
+
+

+ If you do not want to manually store the link somewhere else, you + can add this offers profile to your user account by clicking the + button below. It will still only be editable by you. +

+
+
-
-

- If you do not want to keep the edit link, you can opt to save this - profile under your account's dashboard. It will still only be editable - by you. -

-
-
diff --git a/apps/portal/src/components/offers/offersSubmission/OffersSubmissionAnalysis.tsx b/apps/portal/src/components/offers/offersSubmission/OffersSubmissionAnalysis.tsx index 77c2fc89..b9070760 100644 --- a/apps/portal/src/components/offers/offersSubmission/OffersSubmissionAnalysis.tsx +++ b/apps/portal/src/components/offers/offersSubmission/OffersSubmissionAnalysis.tsx @@ -15,10 +15,12 @@ export default function OffersSubmissionAnalysis({ return (
- Result + Offer Analysis
{!analysis && ( -

Error generating analysis.

+

+ Error generating analysis. +

)} {analysis && (
-
+
)} {!getAnalysis.isLoading && ( -
-
-
-
+
+
+
+
- {steps[step]} - {step === 0 && ( -
-
- )} - {step === 1 && ( -
-
- )} +
+ {steps[step]} + {step === 0 && ( +
+
+ )} + {step === 1 && ( +
+
+ )} +
diff --git a/apps/portal/src/server/router/offers/offers.ts b/apps/portal/src/server/router/offers/offers.ts index 86cd29ef..cac77069 100644 --- a/apps/portal/src/server/router/offers/offers.ts +++ b/apps/portal/src/server/router/offers/offers.ts @@ -12,10 +12,7 @@ import { createValidationRegex } from '~/utils/offers/zodRegex'; import { createRouter } from '../context'; const getOrder = (prefix: string) => { - if (prefix === '+') { - return 'asc'; - } - return 'desc'; + return prefix === '+' ? 'asc' : 'desc'; }; const sortingKeysMap = {