[resumes][feat] add default locations

pull/506/head
Keane Chan 3 years ago
parent cc6380e145
commit 0a87edb530
No known key found for this signature in database
GPG Key ID: 32718398E1E9F87C

@ -89,9 +89,7 @@ export default function ResumeListItem({ href, resumeInfo }: Props) {
addSuffix: true,
})} by ${resumeInfo.user}`}
</div>
<div className="mt-2 text-slate-400">
{getFilterLabel('location', resumeInfo.location)}
</div>
<div className="mt-2 text-slate-400">{resumeInfo.location}</div>
</div>
</div>
<ChevronRightIcon className="col-span-1 w-8 self-center justify-self-center text-slate-400" />

@ -85,12 +85,28 @@ export const EXPERIENCES: Array<TypeaheadOption> = [
},
];
export const LOCATIONS: Array<TypeaheadOption> = [];
export const LOCATIONS: Array<TypeaheadOption> = [
{
id: '196',
label: 'Singapore',
value: '196',
},
{
id: '231',
label: 'United States',
value: '231',
},
{
id: '101',
label: 'India',
value: '101',
},
];
export const INITIAL_FILTER_STATE: FilterState = {
experience: EXPERIENCES,
isUnreviewed: true,
location: [],
location: LOCATIONS,
role: ROLES,
};
@ -152,15 +168,17 @@ export const isInitialFilterState = (filters: FilterState) =>
export const getFilterLabel = (
filterId: FilterId | 'sort',
filterValue: SortOrder | string,
) => {
): string | undefined => {
if (filterId === 'location') {
return filterValue;
}
let filters: Array<TypeaheadOption> = [];
switch (filterId) {
case 'experience':
filters = EXPERIENCES;
break;
case 'location':
break;
case 'role':
filters = Object.entries(JobTitleLabels).map(([slug, label]) => ({
id: slug,

Loading…
Cancel
Save