diff --git a/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx b/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx
index df49ada9..748a4142 100644
--- a/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx
+++ b/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx
@@ -36,7 +36,7 @@ export default function DashboardProfileCard({
{location
- ? `Company: ${company.name}, ${location}`
+ ? `Company: ${company.name}, ${location.cityName}`
: `Company: ${company.name}`}
{level && Level: {level}
}
diff --git a/apps/portal/src/components/offers/profile/OfferCard.tsx b/apps/portal/src/components/offers/profile/OfferCard.tsx
index 6d02f134..0fcc9823 100644
--- a/apps/portal/src/components/offers/profile/OfferCard.tsx
+++ b/apps/portal/src/components/offers/profile/OfferCard.tsx
@@ -40,7 +40,7 @@ export default function OfferCard({
- {location ? `${companyName}, ${location}` : companyName}
+ {location ? `${companyName}, ${location.cityName}` : companyName}
@@ -92,11 +92,11 @@ export default function OfferCard({
)}
- {totalCompensation && (
+ {(base || stocks || bonus) && totalCompensation && (
- Base / year: {base} ⋅ Stocks / year: {stocks} ⋅ Bonus / year:{' '}
- {bonus}
+ Base / year: {base ?? 'N/A'} ⋅ Stocks / year:{' '}
+ {stocks ?? 'N/A'} ⋅ Bonus / year: {bonus ?? 'N/A'}
)}
diff --git a/apps/portal/src/components/offers/table/OffersTable.tsx b/apps/portal/src/components/offers/table/OffersTable.tsx
index 627cb330..9a400b76 100644
--- a/apps/portal/src/components/offers/table/OffersTable.tsx
+++ b/apps/portal/src/components/offers/table/OffersTable.tsx
@@ -21,10 +21,12 @@ import type { DashboardOffer, GetOffersResponse, Paging } from '~/types/offers';
const NUMBER_OF_OFFERS_IN_PAGE = 10;
export type OffersTableProps = Readonly<{
+ cityFilter: string;
companyFilter: string;
jobTitleFilter: string;
}>;
export default function OffersTable({
+ cityFilter,
companyFilter,
jobTitleFilter,
}: OffersTableProps) {
@@ -53,10 +55,11 @@ export default function OffersTable({
[
'offers.list',
{
+ // Location: 'Singapore, Singapore', // TODO: Geolocation
+ cityId: cityFilter,
companyId: companyFilter,
currency,
limit: NUMBER_OF_OFFERS_IN_PAGE,
- location: 'Singapore, Singapore', // TODO: Geolocation
offset: pagination.currentPage,
sortBy: OfferTableSortBy[selectedFilter] ?? '-monthYearReceived',
title: jobTitleFilter,
@@ -102,8 +105,8 @@ export default function OffersTable({
))}
-
-
View all offers in
+
+
Display offers in
setCurrency(value)}
selectedCurrency={currency}
diff --git a/apps/portal/src/components/offers/types.ts b/apps/portal/src/components/offers/types.ts
index 366ca25b..1ee07a15 100644
--- a/apps/portal/src/components/offers/types.ts
+++ b/apps/portal/src/components/offers/types.ts
@@ -2,6 +2,8 @@ import type { JobType } from '@prisma/client';
import type { MonthYear } from '~/components/shared/MonthYearPicker';
+import type { Location } from '~/types/offers';
+
export const HOME_URL = '/offers';
/*
@@ -50,7 +52,7 @@ type ExperiencePostData = {
id?: string;
jobType?: string | null;
level?: string | null;
- location?: string | null;
+ location?: Location | null;
monthlySalary?: Money | null;
title?: string | null;
totalCompensation?: Money | null;
@@ -132,7 +134,7 @@ export type OfferDisplayData = {
jobLevel?: string | null;
jobTitle?: string | null;
jobType?: JobType;
- location?: string | null;
+ location?: Location | null;
monthlySalary?: string | null;
negotiationStrategy?: string | null;
otherComment?: string | null;
diff --git a/apps/portal/src/pages/offers/index.tsx b/apps/portal/src/pages/offers/index.tsx
index e696ca10..07bd3f8c 100644
--- a/apps/portal/src/pages/offers/index.tsx
+++ b/apps/portal/src/pages/offers/index.tsx
@@ -1,5 +1,6 @@
import Link from 'next/link';
import { useState } from 'react';
+import { MapPinIcon } from '@heroicons/react/24/outline';
import { Banner } from '@tih/ui';
import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics';
@@ -7,9 +8,12 @@ import OffersTable from '~/components/offers/table/OffersTable';
import CompaniesTypeahead from '~/components/shared/CompaniesTypeahead';
import JobTitlesTypeahead from '~/components/shared/JobTitlesTypahead';
+import CitiesTypeahead from '../../components/shared/CitiesTypeahead';
+
export default function OffersHomePage() {
const [jobTitleFilter, setjobTitleFilter] = useState('software-engineer');
const [companyFilter, setCompanyFilter] = useState('');
+ const [cityFilter, setCityFilter] = useState('');
const { event: gaEvent } = useGoogleAnalytics();
return (
@@ -21,6 +25,25 @@ export default function OffersHomePage() {
. ⭐
+
+
+
+
+ {
+ if (option) {
+ setCityFilter(option.value);
+ gaEvent({
+ action: `offers.table_filter_city_${option.value}`,
+ category: 'engagement',
+ label: 'Filter by city',
+ });
+ }
+ }}
+ />
+
@@ -58,7 +81,7 @@ export default function OffersHomePage() {
if (option) {
setCompanyFilter(option.value);
gaEvent({
- action: 'offers.table_filter_company',
+ action: `offers.table_filter_company_${option.value}`,
category: 'engagement',
label: 'Filter by company',
});
@@ -70,6 +93,7 @@ export default function OffersHomePage() {