[resumes][feat] Add pagination on browse page (#388)

* [resumes][feat] Add pagination on browse page

* [resume][fix] Remove unused type
This commit is contained in:
Su Yin
2022-10-19 18:37:41 +08:00
committed by GitHub
parent d8213639d3
commit a53c10483e
5 changed files with 324 additions and 114 deletions

View File

@@ -1,12 +1,22 @@
import clsx from 'clsx';
type Props = Readonly<{
isSelected: boolean;
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
title: string;
}>;
export default function ResumeFilterPill({ title, onClick }: Props) {
export default function ResumeFilterPill({
title,
onClick,
isSelected,
}: Props) {
return (
<button
className="rounded-xl border border-indigo-500 border-transparent bg-white px-2 py-1 text-xs font-medium text-indigo-500 focus:bg-indigo-500 focus:text-white"
className={clsx(
'rounded-xl border border-indigo-500 border-transparent px-2 py-1 text-xs font-medium focus:bg-indigo-500 focus:text-white',
isSelected ? 'bg-indigo-500 text-white' : 'bg-white text-indigo-500',
)}
type="button"
onClick={onClick}>
{title}

View File

@@ -41,11 +41,6 @@ export type FilterState = Partial<CustomFilter> &
export type SortOrder = 'latest' | 'popular' | 'topComments';
type SortOption = {
name: string;
value: SortOrder;
};
export type Shortcut = {
customFilters?: CustomFilter;
filters: FilterState;
@@ -59,11 +54,11 @@ export const BROWSE_TABS_VALUES = {
STARRED: 'starred',
};
export const SORT_OPTIONS: Array<SortOption> = [
{ name: 'Latest', value: 'latest' },
{ name: 'Popular', value: 'popular' },
{ name: 'Top Comments', value: 'topComments' },
];
export const SORT_OPTIONS: Record<string, string> = {
latest: 'Latest',
popular: 'Popular',
topComments: 'Top Comments',
};
export const ROLE: Array<FilterOption<RoleFilter>> = [
{