diff --git a/.gitignore b/.gitignore index 7f5ae2e..1035324 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,5 @@ yarn-debug.log* yarn-error.log* .pnpm-debug.log* +.cursor/mcp.json + diff --git a/apps/web/src/app/category/[category]/page.tsx b/apps/web/src/app/category/[category]/page.tsx index c7f11b1..093b314 100644 --- a/apps/web/src/app/category/[category]/page.tsx +++ b/apps/web/src/app/category/[category]/page.tsx @@ -75,13 +75,14 @@ export default async function CategoryPage({ return (
-
+

Tech Companies | {category}

}>
diff --git a/apps/web/src/app/location/[location]/page.tsx b/apps/web/src/app/location/[location]/page.tsx index dd06c2b..71bf26e 100644 --- a/apps/web/src/app/location/[location]/page.tsx +++ b/apps/web/src/app/location/[location]/page.tsx @@ -75,14 +75,15 @@ export default async function LocationPage({ return (
-
+

Tech Companies in {location}

}>
diff --git a/apps/web/src/components/CompaniesList.tsx b/apps/web/src/components/CompaniesList.tsx index f83305a..4acd04a 100644 --- a/apps/web/src/components/CompaniesList.tsx +++ b/apps/web/src/components/CompaniesList.tsx @@ -16,17 +16,19 @@ const PAGE_SIZE = 15; type CompaniesListProps = { allCompanies: Company[]; updatedAtISODate: string; - allowSearchParams?: boolean; + showHeader?: boolean; + hideUpdatedAt?: boolean; }; export default function CompaniesList({ allCompanies, updatedAtISODate, - allowSearchParams = true, + showHeader = false, + hideUpdatedAt, }: CompaniesListProps) { const { searchParams: { query, category, location, page }, - } = useSearchQueryParams(allowSearchParams); + } = useSearchQueryParams(); const start = (page - 1) * PAGE_SIZE; const end = start + PAGE_SIZE; @@ -56,7 +58,7 @@ export default function CompaniesList({ ) : (
- {allowSearchParams && ( + {showHeader && ( )}
- {paginatedCompanies.map((company, index) => ( + {paginatedCompanies.map((company, _index) => ( { const { setSearchParams, @@ -32,13 +34,17 @@ export const CompaniesListHeader = ({ return ( <> - - - {formatDistanceToNow(new Date(updatedAtISODate))} ago - + {!hideUpdatedAt ? ( + + + {formatDistanceToNow(new Date(updatedAtISODate))} ago + + ) : ( +
+ )} { +export const useSearchQueryParams = () => { const [searchParams, setSearchParams] = useQueryStates( searchParamsQueryStateKeys, { @@ -15,17 +12,15 @@ export const useSearchQueryParams = (enabled = true) => { const appliedFilters = useMemo( () => - enabled - ? Object.entries(searchParams).filter( - ([key, value]) => key != "page" && !!value, - ) - : [], - [searchParams, enabled], + Object.entries(searchParams).filter( + ([key, value]) => key != "page" && !!value, + ), + [searchParams], ); return { - searchParams: enabled ? searchParams : defaultSearchParams, - setSearchParams: enabled ? setSearchParams : () => {}, + searchParams, + setSearchParams, appliedFilters, }; };