From ea57743cfe49f3f837da4bd1b4342673cd210d8e Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Wed, 2 Nov 2022 19:23:03 +0800 Subject: [PATCH] [offers] tweak offer profiles UI --- .../offers/dashboard/DashboardOfferCard.tsx | 58 ++++++++++---- .../offers/dashboard/DashboardProfileCard.tsx | 79 +++++++++---------- .../offersSubmission/OffersProfileSave.tsx | 5 +- .../offersSubmission/OffersSubmissionForm.tsx | 2 +- .../offers/profile/ProfileComments.tsx | 8 +- .../offers/profile/ProfilePhotoHolder.tsx | 4 +- .../src/components/shared/Container.tsx | 9 ++- apps/portal/src/pages/offers/dashboard.tsx | 30 +++---- .../pages/offers/profile/[offerProfileId].tsx | 10 ++- .../offers/submit/result/[offerProfileId].tsx | 2 +- 10 files changed, 119 insertions(+), 88 deletions(-) diff --git a/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx b/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx index df49ada9..d76bcd60 100644 --- a/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx +++ b/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx @@ -1,5 +1,9 @@ +import { + ArrowTrendingUpIcon, + BuildingOfficeIcon, + MapPinIcon, +} from '@heroicons/react/20/solid'; import { JobType } from '@prisma/client'; -import { HorizontalDivider } from '@tih/ui'; import type { JobTitleType } from '~/components/shared/JobTitles'; import { getLabelForJobTitleType } from '~/components/shared/JobTitles'; @@ -10,12 +14,10 @@ import { formatDate } from '~/utils/offers/time'; import type { UserProfileOffer } from '~/types/offers'; type Props = Readonly<{ - disableTopDivider?: boolean; offer: UserProfileOffer; }>; export default function DashboardProfileCard({ - disableTopDivider, offer: { company, income, @@ -27,29 +29,53 @@ export default function DashboardProfileCard({ }, }: Props) { return ( - <> - {!disableTopDivider && } +
-

+

{getLabelForJobTitleType(title as JobTitleType)} -

-

- {location - ? `Company: ${company.name}, ${location}` - : `Company: ${company.name}`} -

- {level &&

Level: {level}

} +

+
+ {company?.name && ( +
+
+ )} + {location && ( +
+
+ )} + {level && ( +
+
+ )} +
-

{formatDate(monthYearReceived)}

-

+

{jobType === JobType.FULLTIME ? `${convertMoneyToString(income)} / year` : `${convertMoneyToString(income)} / month`}

+

+ {formatDate(monthYearReceived)} +

- +
); } diff --git a/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx b/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx index 1fcd6e57..854686eb 100644 --- a/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx +++ b/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx @@ -1,5 +1,6 @@ import { useRouter } from 'next/router'; -import { ArrowRightIcon, XMarkIcon } from '@heroicons/react/24/outline'; +import { BookmarkSlashIcon } from '@heroicons/react/20/solid'; +import { ArrowRightIcon } from '@heroicons/react/24/outline'; import { Button, useToast } from '@tih/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; @@ -43,54 +44,52 @@ export default function DashboardProfileCard({ ); function handleRemoveProfile() { + // TODO(offers): Confirm before removal. removeSavedProfileMutation.mutate({ profileId: id }); } return ( -
+
{/* Header */} -
-
-
- -
-
-

{profileName}

- -
- Created at {formatDate(createdAt)} +
+
+
+
+
+ +
+
+

+ {profileName} +

+

+ Created at {formatDate(createdAt)} +

+
-
- -
-
-
- - {/* Offers */} -
- {offers.map((offer: UserProfileOffer, index) => - index === 0 ? ( - +
+
-
+ {/* List of Offers */} +
    + {offers.map((offer: UserProfileOffer) => ( +
  • + +
  • + ))} +
+