Skip to content

Commit

Permalink
Merge pull request #89 from Eureka-Shoulders/chore/date-picker-popove…
Browse files Browse the repository at this point in the history
…r-props

chore: add popover props as option
  • Loading branch information
Sampaio Leal committed Nov 29, 2022
2 parents a60ba03 + 0e11eb8 commit f1eabe9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@euk-labs/componentz",
"version": "0.5.15",
"version": "0.5.16",
"types": "./lib/types/index.d.ts",
"main": "./lib/cjs/index.js",
"exports": {
Expand Down
5 changes: 4 additions & 1 deletion src/components/Inputs/DateRangePicker/DateRangePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Popover, PopoverProps } from '@mui/material';
import { DesktopDatePickerProps } from '@mui/x-date-pickers';
import { Popover } from '@mui/material';
import { observer } from 'mobx-react-lite';
import { useRef, useState } from 'react';

Expand All @@ -15,12 +15,14 @@ export type DateRangePickerProps = Omit<
onChange: (value: DateRange) => void;
label?: string;
value: DateRange;
popoverProps: Omit<PopoverProps, 'open' | 'onClose'>;
};

function DateRangePicker({
value,
label,
onChange,
popoverProps,
...props
}: DateRangePickerProps) {
const [store] = useState(() => new DateRangePickerStore(value));
Expand All @@ -36,6 +38,7 @@ function DateRangePicker({
onChange={onChange}
/>
<Popover
{...popoverProps}
open={store.open}
anchorEl={anchorRef.current}
onClose={() => store.setOpen(false)}
Expand Down

0 comments on commit f1eabe9

Please sign in to comment.