From a8fdca65cdaa1c6837b33e9715b336f661cad36e Mon Sep 17 00:00:00 2001
From: Ai Ling <50992674+ailing35@users.noreply.github.com>
Date: Sun, 30 Oct 2022 20:18:46 +0800
Subject: [PATCH] [offers][fix] Fix offers UI (#460)
---
.../offers/offerAnalysis/OfferAnalysis.tsx | 26 +++++-
.../OfferPercentileAnalysisText.tsx | 16 ++--
.../offers/offerAnalysis/OfferProfileCard.tsx | 11 ++-
.../OffersSubmissionAnalysis.tsx | 1 +
.../offersSubmission/OffersSubmissionForm.tsx | 56 ++++++++++++-
.../submissionForm/BackgroundForm.tsx | 81 +++++++++++++++----
.../submissionForm/OfferDetailsForm.tsx | 80 ++++++++++++++----
.../components/offers/profile/OfferCard.tsx | 7 +-
.../offers/profile/ProfileHeader.tsx | 11 ++-
apps/portal/src/components/offers/types.ts | 3 +
.../pages/offers/profile/[offerProfileId].tsx | 10 ++-
.../offers/profile/edit/[offerProfileId].tsx | 8 ++
12 files changed, 258 insertions(+), 52 deletions(-)
diff --git a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx
index 67c9c9e1..b8ae1c7c 100644
--- a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx
+++ b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx
@@ -19,12 +19,14 @@ type OfferAnalysisData = {
type OfferAnalysisContentProps = Readonly<{
analysis: OfferAnalysisData;
+ isSubmission: boolean;
tab: string;
}>;
function OfferAnalysisContent({
analysis: { offer, offerAnalysis },
tab,
+ isSubmission,
}: OfferAnalysisContentProps) {
if (!offerAnalysis || !offer || offerAnalysis.noOfOffers === 0) {
if (tab === OVERALL_TAB) {
@@ -46,16 +48,30 @@ function OfferAnalysisContent({
<>
Here are some of the top offers relevant to you:
++ {isSubmission + ? 'Here are some of the top offers relevant to you:' + : 'Relevant top offers:'} +
{offerAnalysis.topPercentileOffers.map((topPercentileOffer) => (- Your highest offer is from {companyName}, which is{' '} - {percentile.toFixed(1)} percentile out of {noOfOffers}{' '} - offers received for the same job title and YOE(±1) in the last year. + {isSubmission ? 'Your' : "This profile's"} highest offer is from{' '} + {companyName}, which is {percentile.toFixed(1)} percentile + out of {noOfOffers} offers received for the same job title and + YOE(±1) in the last year.
) : (- Your offer from {companyName} is {percentile.toFixed(1)}{' '} - percentile out of {noOfOffers} offers received in {companyName} for - the same job title and YOE(±1) in the last year. + {isSubmission ? 'Your' : 'The'} offer from {companyName} is{' '} + {percentile.toFixed(1)} percentile out of {noOfOffers}{' '} + offers received in {companyName} for the same job title and YOE(±1) in the + last year.
); } diff --git a/apps/portal/src/components/offers/offerAnalysis/OfferProfileCard.tsx b/apps/portal/src/components/offers/offerAnalysis/OfferProfileCard.tsx index 13cbd2d8..6d57e2b8 100644 --- a/apps/portal/src/components/offers/offerAnalysis/OfferProfileCard.tsx +++ b/apps/portal/src/components/offers/offerAnalysis/OfferProfileCard.tsx @@ -12,6 +12,7 @@ import { convertMoneyToString } from '~/utils/offers/currency'; import { formatDate } from '~/utils/offers/time'; import ProfilePhotoHolder from '../profile/ProfilePhotoHolder'; +import { JobTypeLabel } from '../types'; import type { AnalysisOffer } from '~/types/offers'; @@ -34,7 +35,12 @@ export default function OfferProfileCard({ }, }: OfferProfileCardProps) { return ( -