[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, addSuffix: true,
})} by ${resumeInfo.user}`} })} by ${resumeInfo.user}`}
</div> </div>
<div className="mt-2 text-slate-400"> <div className="mt-2 text-slate-400">{resumeInfo.location}</div>
{getFilterLabel('location', resumeInfo.location)}
</div>
</div> </div>
</div> </div>
<ChevronRightIcon className="col-span-1 w-8 self-center justify-self-center text-slate-400" /> <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 = { export const INITIAL_FILTER_STATE: FilterState = {
experience: EXPERIENCES, experience: EXPERIENCES,
isUnreviewed: true, isUnreviewed: true,
location: [], location: LOCATIONS,
role: ROLES, role: ROLES,
}; };
@ -152,15 +168,17 @@ export const isInitialFilterState = (filters: FilterState) =>
export const getFilterLabel = ( export const getFilterLabel = (
filterId: FilterId | 'sort', filterId: FilterId | 'sort',
filterValue: SortOrder | string, filterValue: SortOrder | string,
) => { ): string | undefined => {
if (filterId === 'location') {
return filterValue;
}
let filters: Array<TypeaheadOption> = []; let filters: Array<TypeaheadOption> = [];
switch (filterId) { switch (filterId) {
case 'experience': case 'experience':
filters = EXPERIENCES; filters = EXPERIENCES;
break; break;
case 'location':
break;
case 'role': case 'role':
filters = Object.entries(JobTitleLabels).map(([slug, label]) => ({ filters = Object.entries(JobTitleLabels).map(([slug, label]) => ({
id: slug, id: slug,

Loading…
Cancel
Save