[offers][feat] add token check to profile and add company filter to table (#373)

* [offers][feat] add token check to profile, company filter to table and currency formatter

* [offers][feat] add currency formatter
This commit is contained in:
Zhang Ziqing
2022-10-13 00:26:57 +08:00
committed by GitHub
parent a47c0761d2
commit ffd7539179
6 changed files with 103 additions and 75 deletions

View File

@@ -14,16 +14,16 @@ type Props = Readonly<{
export default function OfferCard({
offer: {
companyName = 'Meta',
jobTitle = 'Senior Engineer',
jobLevel,
location = 'Singapore',
receivedMonth = 'Jun 2021',
totalCompensation = '350.1k',
base = '0k',
stocks = '0k',
bonus = '0k',
base,
bonus,
companyName,
duration,
jobTitle,
jobLevel,
location,
receivedMonth,
totalCompensation,
stocks,
monthlySalary,
negotiationStrategy,
otherComment,

View File

@@ -19,7 +19,10 @@ export type OffersTableProps = Readonly<{
companyFilter: string;
jobTitleFilter: string;
}>;
export default function OffersTable({ jobTitleFilter }: OffersTableProps) {
export default function OffersTable({
companyFilter,
jobTitleFilter,
}: OffersTableProps) {
const [currency, setCurrency] = useState('SGD'); // TODO: Detect location
const [selectedTab, setSelectedTab] = useState(YOE_CATEGORY.ENTRY);
const [pagination, setPagination] = useState<PaginationType>({
@@ -42,10 +45,9 @@ export default function OffersTable({ jobTitleFilter }: OffersTableProps) {
[
'offers.list',
{
// Company: companyFilter, // TODO
companyId: companyFilter,
limit: NUMBER_OF_OFFERS_IN_PAGE,
location: 'Singapore, Singapore',
location: 'Singapore, Singapore', // TODO: Geolocation
offset: pagination.currentPage - 1,
sortBy: '-monthYearReceived',
title: jobTitleFilter,

View File

@@ -137,11 +137,11 @@ type EducationDisplay = {
export type OfferEntity = {
base?: string;
bonus?: string;
companyName: string;
companyName?: string;
duration?: string;
id?: string;
jobLevel?: string;
jobTitle: string;
jobTitle?: string;
location?: string;
monthlySalary?: string;
negotiationStrategy?: string;