mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-05-03 08:01:43 +08:00
[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:
@@ -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}
|
||||
|
||||
@@ -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>> = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user