From 10e735a6bd583c84d5cc27d2a16b88d3b72690bc Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Thu, 27 Oct 2022 19:56:09 +0800 Subject: [PATCH] tweak again --- .../components/global/ProductNavigation.tsx | 6 +- .../src/components/offers/table/OffersRow.tsx | 14 +- .../components/offers/table/OffersTable.tsx | 132 +++++++++++------- .../components/shared/CompaniesTypeahead.tsx | 1 + .../components/shared/JobTitlesTypahead.tsx | 1 + apps/portal/src/pages/offers/browse.tsx | 14 +- 6 files changed, 102 insertions(+), 66 deletions(-) diff --git a/apps/portal/src/components/global/ProductNavigation.tsx b/apps/portal/src/components/global/ProductNavigation.tsx index be1ff172..6b6b857c 100644 --- a/apps/portal/src/components/global/ProductNavigation.tsx +++ b/apps/portal/src/components/global/ProductNavigation.tsx @@ -30,7 +30,11 @@ export default function ProductNavigation({ items, title, titleHref }: Props) { className="hover:text-primary-700 flex items-center gap-2 text-base font-medium" href={titleHref}> {titleHref !== '/' && ( - TIH + Tech Interview Handbook )} {title} diff --git a/apps/portal/src/components/offers/table/OffersRow.tsx b/apps/portal/src/components/offers/table/OffersRow.tsx index 1f4d8856..dbde12a8 100644 --- a/apps/portal/src/components/offers/table/OffersRow.tsx +++ b/apps/portal/src/components/offers/table/OffersRow.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx'; import Link from 'next/link'; import type { JobTitleType } from '~/components/shared/JobTitles'; @@ -14,12 +15,8 @@ export default function OfferTableRow({ row: { company, id, income, monthYearReceived, profileId, title, totalYoe }, }: OfferTableRowProps) { return ( - - + + {company.name} @@ -28,7 +25,10 @@ export default function OfferTableRow({ {totalYoe} {convertMoneyToString(income)} {formatDate(monthYearReceived)} - + diff --git a/apps/portal/src/components/offers/table/OffersTable.tsx b/apps/portal/src/components/offers/table/OffersTable.tsx index 3801d7b0..4ce1e0f9 100644 --- a/apps/portal/src/components/offers/table/OffersTable.tsx +++ b/apps/portal/src/components/offers/table/OffersTable.tsx @@ -1,5 +1,6 @@ +import clsx from 'clsx'; import { useEffect, useState } from 'react'; -import { HorizontalDivider, Select, Spinner, Tabs } from '@tih/ui'; +import { DropdownMenu, Spinner } from '@tih/ui'; import OffersTablePagination from '~/components/offers/table/OffersTablePagination'; import { @@ -71,55 +72,84 @@ export default function OffersTable({ }, ); - function renderTabs() { - return ( -
-
- setSelectedTab(value)} - /> -
-
- ); - } - function renderFilters() { return (
-
- All offers in - setCurrency(value)} - selectedCurrency={currency} - /> + itemValue === selectedTab, + )[0].label + } + size="inherit"> + {OfferTableTabOptions.map(({ label: itemLabel, value }) => ( + { + setSelectedTab(value); + }} + /> + ))} + +
+
+ All offers in + setCurrency(value)} + selectedCurrency={currency} + /> +
+
+ itemValue === selectedFilter, + )[0].label + } + size="inherit"> + {OfferTableFilterOptions.map(({ label: itemLabel, value }) => ( + { + setSelectedFilter(value); + }} + /> + ))} + +
-