Skip to content

Commit

Permalink
adjust calendar open this icon
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielRochaBuilders committed Nov 25, 2024
1 parent b1df4a9 commit f0570f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/DatePicker/DatePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const meta: Meta<typeof DatePicker> = {
minDate: { control: { type: 'boolean' } },
maxDate: { control: { type: 'boolean' } },
inputVariant: { type: 'string' },
disabledInput: { control: { type: 'boolean' } },
},
args: {
onChange: onChange,
Expand Down
5 changes: 4 additions & 1 deletion src/components/DatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface Props extends DatePickerProps {
workDays?: boolean;
holidays?: string[];
inputVariant?: 'default' | 'outlined';
disabledInput?: boolean;
}

const DatePickerComponent: React.FC<Props> = ({
Expand All @@ -30,6 +31,7 @@ const DatePickerComponent: React.FC<Props> = ({
name,
id,
inputVariant = 'outlined',
disabledInput = false,
}) => {
const datePickerRef = useRef();
return (
Expand All @@ -43,8 +45,9 @@ const DatePickerComponent: React.FC<Props> = ({
id={id}
value={value}
onClick={openCalendar}
onChange={(e) => onChange(e)}
onChange={(e) => (disabledInput ? value : onChange(e))}
iconRight="ChevronDownIcon"
onClickIconRight={openCalendar}
variant={inputVariant}
/>
);
Expand Down

0 comments on commit f0570f7

Please sign in to comment.