diff options
Diffstat (limited to 'src/components/ui/Modal')
-rw-r--r-- | src/components/ui/Modal/index.tsx | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/components/ui/Modal/index.tsx b/src/components/ui/Modal/index.tsx index 7407a686d..154beef0c 100644 --- a/src/components/ui/Modal/index.tsx +++ b/src/components/ui/Modal/index.tsx | |||
@@ -1,41 +1,33 @@ | |||
1 | import { Component, ReactChildren } from 'react'; | 1 | import { Component, ReactNode } from 'react'; |
2 | import ReactModal from 'react-modal'; | 2 | import ReactModal from 'react-modal'; |
3 | import classnames from 'classnames'; | 3 | import classnames from 'classnames'; |
4 | import injectCSS from 'react-jss'; | 4 | import injectCSS, { WithStylesProps } from 'react-jss'; |
5 | import { mdiClose } from '@mdi/js'; | 5 | import { mdiClose } from '@mdi/js'; |
6 | 6 | ||
7 | import Icon from '../icon'; | 7 | import Icon from '../icon'; |
8 | import styles from './styles'; | 8 | import styles from './styles'; |
9 | 9 | ||
10 | type Props = { | 10 | interface IProps extends WithStylesProps<typeof styles> { |
11 | children: ReactChildren; | 11 | children: ReactNode; |
12 | className: string; | ||
13 | classes: any; | ||
14 | isOpen: boolean; | 12 | isOpen: boolean; |
15 | portal: string; | ||
16 | close: () => void; | 13 | close: () => void; |
17 | shouldCloseOnOverlayClick: boolean; | 14 | className?: string | null; |
18 | showClose: boolean; | 15 | portal?: string; |
19 | }; | 16 | shouldCloseOnOverlayClick?: boolean; |
20 | 17 | showClose?: boolean; | |
21 | class Modal extends Component<Props> { | 18 | } |
22 | static defaultProps = { | ||
23 | className: null, | ||
24 | portal: 'modal-portal', | ||
25 | shouldCloseOnOverlayClick: false, | ||
26 | showClose: true, | ||
27 | }; | ||
28 | 19 | ||
20 | class Modal extends Component<IProps> { | ||
29 | render() { | 21 | render() { |
30 | const { | 22 | const { |
31 | children, | 23 | children, |
32 | className, | ||
33 | classes, | 24 | classes, |
34 | isOpen, | 25 | isOpen, |
35 | portal, | ||
36 | close, | 26 | close, |
37 | shouldCloseOnOverlayClick, | 27 | className = null, |
38 | showClose, | 28 | portal = 'modal-portal', |
29 | shouldCloseOnOverlayClick = false, | ||
30 | showClose = true, | ||
39 | } = this.props; | 31 | } = this.props; |
40 | 32 | ||
41 | return ( | 33 | return ( |