From bd21b93df2316672485992e4f59ce3e918b39cac Mon Sep 17 00:00:00 2001 From: Zhang Ziqing <69516975+ziqing26@users.noreply.github.com> Date: Wed, 9 Nov 2022 12:00:16 +0800 Subject: [PATCH] [offers][fix] display intern cycle in offer card (#547) --- .../src/components/offers/InternshipCycles.ts | 10 ++++++++ .../components/offers/profile/OfferCard.tsx | 23 +++++++++++++++---- apps/portal/src/components/offers/types.ts | 4 +++- .../pages/offers/profile/[offerProfileId].tsx | 2 ++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/apps/portal/src/components/offers/InternshipCycles.ts b/apps/portal/src/components/offers/InternshipCycles.ts index 1f90539f..ee70365a 100644 --- a/apps/portal/src/components/offers/InternshipCycles.ts +++ b/apps/portal/src/components/offers/InternshipCycles.ts @@ -16,3 +16,13 @@ export const InternshipCycleOptions = [emptyOption].concat( value: label.replace(/\s+/g, '-').toLowerCase(), })), ); + +export const InternshipCycleValuesToLabels: Record = { + fall: 'Fall', + 'full-year': 'Full year', + 'half-year': 'Half year', + others: 'Others', + spring: 'Spring', + summer: 'Summer', + winter: 'Winter', +}; diff --git a/apps/portal/src/components/offers/profile/OfferCard.tsx b/apps/portal/src/components/offers/profile/OfferCard.tsx index 2ed305f3..fd4336dc 100644 --- a/apps/portal/src/components/offers/profile/OfferCard.tsx +++ b/apps/portal/src/components/offers/profile/OfferCard.tsx @@ -1,11 +1,13 @@ import { ArrowTrendingUpIcon, BuildingOfficeIcon, + CalendarIcon, MapPinIcon, } from '@heroicons/react/20/solid'; import { JobType } from '@prisma/client'; import { JobTypeLabel } from '~/components/offers/constants'; +import { InternshipCycleValuesToLabels } from '~/components/offers/InternshipCycles'; import type { OfferDisplayData } from '~/components/offers/types'; import { getLocationDisplayText } from '~/utils/offers/string'; @@ -21,12 +23,14 @@ export default function OfferCard({ bonus, companyName, duration, + internshipCycle, jobTitle, jobLevel, jobType, location, receivedMonth, totalCompensation, + startYear, stocks, monthlySalary, negotiationStrategy, @@ -41,9 +45,9 @@ export default function OfferCard({

{jobTitle} {jobType && <>({JobTypeLabel[jobType]})}

-
+
{companyName && ( -
+