Skip to content

Commit

Permalink
fix(LimitFilterDropdown): remove default value
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Mar 4, 2023
1 parent 19e4663 commit 30cbaba
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/LimitFilterDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { MenuItem } from './MenuItem';

const Dropdown = dynamic(() => import('./Dropdown'));

export const defaultLimit = 100;
const limitVariants = [10, 20, 30, 50, defaultLimit];
const limitVariants = [10, 20, 30, 50, 100];

interface LimitFilterDropdownProps {
text: React.ComponentProps<typeof Dropdown>['text'];
Expand All @@ -18,7 +17,7 @@ interface LimitFilterDropdownProps {
}

export const LimitFilterDropdown = React.forwardRef<HTMLDivElement, LimitFilterDropdownProps>(
({ text, value = defaultLimit, disabled, onChange }, ref) => (
({ text, value, disabled, onChange }, ref) => (
<Dropdown
ref={ref}
text={text}
Expand All @@ -29,7 +28,7 @@ export const LimitFilterDropdown = React.forwardRef<HTMLDivElement, LimitFilterD
renderTrigger={(props) => (
<FiltersMenuItem
ref={props.ref}
active={value !== defaultLimit}
active={Boolean(value)}
disabled={props.disabled}
onClick={props.onClick}
>
Expand Down

0 comments on commit 30cbaba

Please sign in to comment.