diff --git a/apps/member-profile/app/routes/_profile.offers.full-time.tsx b/apps/member-profile/app/routes/_profile.offers.full-time.tsx index 4c576048c..23b1c8822 100644 --- a/apps/member-profile/app/routes/_profile.offers.full-time.tsx +++ b/apps/member-profile/app/routes/_profile.offers.full-time.tsx @@ -328,9 +328,18 @@ export default function FullTimeOffersPage() { type FullTimeOfferInView = SerializeFrom['offers'][number]; function FullTimeOffersTable() { - const { offers } = useLoaderData(); + const { appliedCompany, offers } = useLoaderData(); const [searchParams] = useSearchParams(); + const hasOtherFilters = + !!searchParams.getAll('totalCompensation').length || + !!searchParams.getAll('location').length; + + const emptyMessage = + appliedCompany && !hasOtherFilters + ? `No record exists for full-time offers at ${appliedCompany.name} yet.` + : 'No full-time offers found matching the criteria.'; + const columns: TableColumnProps[] = [ { displayName: 'Company', @@ -394,7 +403,7 @@ function FullTimeOffersTable() { { return { pathname: generatePath(Route['/offers/full-time/:id'], { id }), diff --git a/apps/member-profile/app/routes/_profile.offers.internships.tsx b/apps/member-profile/app/routes/_profile.offers.internships.tsx index 32a842f5d..2a679b4d0 100644 --- a/apps/member-profile/app/routes/_profile.offers.internships.tsx +++ b/apps/member-profile/app/routes/_profile.offers.internships.tsx @@ -314,9 +314,18 @@ export default function InternshipOffersPage() { type InternshipOfferInView = SerializeFrom['offers'][number]; function InternshipOffersTable() { - const { offers } = useLoaderData(); + const { appliedCompany, offers } = useLoaderData(); const [searchParams] = useSearchParams(); + const hasOtherFilters = + !!searchParams.getAll('hourlyRate').length || + !!searchParams.getAll('location').length; + + const emptyMessage = + appliedCompany && !hasOtherFilters + ? `No record exists for internship offers at ${appliedCompany.name} yet.` + : 'No internship offers found matching the criteria.'; + const columns: TableColumnProps[] = [ { displayName: 'Company', @@ -370,7 +379,7 @@ function InternshipOffersTable() {
{ return { pathname: generatePath(Route['/offers/internships/:id'], { id }), diff --git a/apps/member-profile/app/routes/_profile.offers.tsx b/apps/member-profile/app/routes/_profile.offers.tsx index 72dcf6096..4ed47cca4 100644 --- a/apps/member-profile/app/routes/_profile.offers.tsx +++ b/apps/member-profile/app/routes/_profile.offers.tsx @@ -1,4 +1,4 @@ -import { Outlet } from 'react-router'; +import { Outlet, useSearchParams } from 'react-router'; import { cx, Dashboard } from '@oyster/ui'; @@ -27,14 +27,22 @@ type OffersNavigationProps = { }; function OffersNavigation({ className }: OffersNavigationProps) { + const [searchParams] = useSearchParams(); + + const company = searchParams.get('company'); + + const search = company + ? '?' + new URLSearchParams({ company }).toString() + : ''; + return (