From 7e06e07df4f9c1231da8efa575bc0d717469ce2a Mon Sep 17 00:00:00 2001 From: Zhang Ziqing <69516975+ziqing26@users.noreply.github.com> Date: Thu, 3 Nov 2022 15:07:28 +0800 Subject: [PATCH] [offers][fix] fix profile location display (#497) --- apps/portal/src/components/offers/profile/ProfileHeader.tsx | 4 ++-- apps/portal/src/components/offers/table/OffersRow.tsx | 6 +++--- apps/portal/src/pages/offers/profile/[offerProfileId].tsx | 1 + apps/portal/src/utils/offers/currency/index.tsx | 6 +++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/portal/src/components/offers/profile/ProfileHeader.tsx b/apps/portal/src/components/offers/profile/ProfileHeader.tsx index 9a2923be..625e2be7 100644 --- a/apps/portal/src/components/offers/profile/ProfileHeader.tsx +++ b/apps/portal/src/components/offers/profile/ProfileHeader.tsx @@ -246,7 +246,7 @@ export default function ProfileHeader({ {(experiences[0]?.companyName || experiences[0]?.jobLevel || experiences[0]?.jobTitle) && ( -
+
@@ -262,7 +262,7 @@ export default function ProfileHeader({

)} -
+

YOE: diff --git a/apps/portal/src/components/offers/table/OffersRow.tsx b/apps/portal/src/components/offers/table/OffersRow.tsx index 77c7ab44..f80802e4 100644 --- a/apps/portal/src/components/offers/table/OffersRow.tsx +++ b/apps/portal/src/components/offers/table/OffersRow.tsx @@ -42,9 +42,9 @@ export default function OfferTableRow({ {convertMoneyToString(income)} {jobType === JobType.FULLTIME && ( - {`${baseSalary && convertMoneyToString(baseSalary)} / ${ - bonus && convertMoneyToString(bonus) - } / ${stocks && convertMoneyToString(stocks)}`} + {`${convertMoneyToString(baseSalary)} / ${convertMoneyToString( + bonus, + )} / ${convertMoneyToString(stocks)}`} )} {formatDate(monthYearReceived)} diff --git a/apps/portal/src/pages/offers/profile/[offerProfileId].tsx b/apps/portal/src/pages/offers/profile/[offerProfileId].tsx index 092cf8b9..73468325 100644 --- a/apps/portal/src/pages/offers/profile/[offerProfileId].tsx +++ b/apps/portal/src/pages/offers/profile/[offerProfileId].tsx @@ -132,6 +132,7 @@ export default function OfferProfile() { ? getLabelForJobTitleType(experience.title as JobTitleType) : null, jobType: experience.jobType || undefined, + location: experience.location, monthlySalary: experience.monthlySalary ? convertMoneyToString(experience.monthlySalary) : null, diff --git a/apps/portal/src/utils/offers/currency/index.tsx b/apps/portal/src/utils/offers/currency/index.tsx index 1e219c45..b8ab6932 100644 --- a/apps/portal/src/utils/offers/currency/index.tsx +++ b/apps/portal/src/utils/offers/currency/index.tsx @@ -4,7 +4,11 @@ import { Currency } from './CurrencyEnum'; export const baseCurrencyString = Currency.USD.toString(); -export function convertMoneyToString({ currency, value }: Money) { +export function convertMoneyToString(money: Money | undefined) { + if (!money) { + return '-'; + } + const { currency, value } = money; if (!value) { return '-'; }