From fec915cffa30f791833cab5069bfb2fa13d6fc08 Mon Sep 17 00:00:00 2001 From: Ai Ling <50992674+ailing35@users.noreply.github.com> Date: Sat, 5 Nov 2022 00:57:09 +0800 Subject: [PATCH] [offers][feat] Tweak UI and add View More button to OEA (#507) * [offers][feat] Tweak UI and minor refactoring * [offers][feat] Add view more button to OEA --- .../offers/dashboard/DashboardProfileCard.tsx | 2 +- .../offers/offerAnalysis/OfferAnalysis.tsx | 30 +++- .../offers/offerAnalysis/OfferProfileCard.tsx | 146 +++++++++++++----- .../offersSubmission/OffersSubmissionForm.tsx | 36 +++-- .../submissionForm/OfferDetailsForm.tsx | 4 +- .../offers/profile/ProfileDetails.tsx | 5 +- apps/portal/src/components/offers/types.ts | 134 ++++++++++++---- .../offers/profile/edit/[offerProfileId].tsx | 15 +- 8 files changed, 266 insertions(+), 106 deletions(-) diff --git a/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx b/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx index 854686eb..a4e82b69 100644 --- a/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx +++ b/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx @@ -63,7 +63,7 @@ export default function DashboardProfileCard({ {profileName}
- Created at {formatDate(createdAt)} + Created in {formatDate(createdAt)}
diff --git a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx index ab80bb48..1d8aa2ae 100644 --- a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx +++ b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx @@ -1,10 +1,13 @@ import { useEffect } from 'react'; import { useState } from 'react'; -import { Alert, HorizontalDivider, Spinner, Tabs } from '@tih/ui'; +import { ArrowUpRightIcon } from '@heroicons/react/24/outline'; +import { JobType } from '@prisma/client'; +import { Alert, Button, HorizontalDivider, Spinner, Tabs } from '@tih/ui'; import OfferPercentileAnalysisText from './OfferPercentileAnalysisText'; import OfferProfileCard from './OfferProfileCard'; import { OVERALL_TAB } from '../constants'; +import { YOE_CATEGORY } from '../table/types'; import type { AnalysisUnit, ProfileAnalysis } from '~/types/offers'; @@ -19,6 +22,16 @@ function OfferAnalysisContent({ tab, isSubmission, }: OfferAnalysisContentProps) { + const { companyId, companyName, title, totalYoe, jobType } = analysis; + const yoeCategory = + jobType === JobType.INTERN + ? '' + : totalYoe <= 2 + ? YOE_CATEGORY.ENTRY + : totalYoe <= 5 + ? YOE_CATEGORY.MID + : YOE_CATEGORY.SENIOR; + if (!analysis || analysis.noOfOffers === 0) { if (tab === OVERALL_TAB) { return ( @@ -55,15 +68,22 @@ function OfferAnalysisContent({ offerProfile={topPercentileOffer} /> ))} - {/* {offerAnalysis.topPercentileOffers.length > 0 && ( + {analysis.topPercentileOffers.length > 0 && ({profileName}
- {previousCompanies.length > 0 && ( -
+
- {getLabelForJobTitleType(title as JobTitleType)}{' '} - {`(${JobTypeLabel[jobType]})`} -
-{`Company: ${getCompanyDisplayText(company.name, location)}`}
- {level &&Level: {level}
} -{formatDate(monthYearReceived)}
-- {jobType === JobType.FULLTIME - ? `${convertMoneyToString(income)} / year` - : `${convertMoneyToString(income)} / month`} -
+ function BottomSection() { + return ( ++ {jobType === JobType.FULLTIME + ? `${convertMoneyToString(income)} / year` + : `${convertMoneyToString(income)} / month`} +
++ {formatDate(monthYearReceived)} +
+