diff options
author | 2021-10-14 13:24:58 +0200 | |
---|---|---|
committer | 2021-10-14 13:24:58 +0200 | |
commit | fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e (patch) | |
tree | 10caa332d957421e982c7ddd0c94623d5d62314d /src/components/ui/Modal | |
parent | chore: convert various JS to TS (#2062) (diff) | |
download | ferdium-app-fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e.tar.gz ferdium-app-fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e.tar.zst ferdium-app-fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e.zip |
chore: convert files to TS (#2066)
Diffstat (limited to 'src/components/ui/Modal')
-rw-r--r-- | src/components/ui/Modal/index.tsx (renamed from src/components/ui/Modal/index.js) | 27 | ||||
-rw-r--r-- | src/components/ui/Modal/styles.ts (renamed from src/components/ui/Modal/styles.js) | 0 |
2 files changed, 12 insertions, 15 deletions
diff --git a/src/components/ui/Modal/index.js b/src/components/ui/Modal/index.tsx index c4e47748a..0bb0aaa61 100644 --- a/src/components/ui/Modal/index.js +++ b/src/components/ui/Modal/index.tsx | |||
@@ -1,6 +1,5 @@ | |||
1 | import { Component } from 'react'; | 1 | import { Component, ReactChildren } from 'react'; |
2 | import ReactModal from 'react-modal'; | 2 | import ReactModal from 'react-modal'; |
3 | import PropTypes from 'prop-types'; | ||
4 | import classnames from 'classnames'; | 3 | import classnames from 'classnames'; |
5 | import injectCSS from 'react-jss'; | 4 | import injectCSS from 'react-jss'; |
6 | import { Icon } from '@meetfranz/ui'; | 5 | import { Icon } from '@meetfranz/ui'; |
@@ -8,21 +7,19 @@ import { Icon } from '@meetfranz/ui'; | |||
8 | import { mdiClose } from '@mdi/js'; | 7 | import { mdiClose } from '@mdi/js'; |
9 | import styles from './styles'; | 8 | import styles from './styles'; |
10 | 9 | ||
11 | // ReactModal.setAppElement('#root'); | 10 | type Props = { |
11 | children: ReactChildren; | ||
12 | className: string; | ||
13 | classes: any; | ||
14 | isOpen: boolean; | ||
15 | portal: string; | ||
16 | close: () => void; | ||
17 | shouldCloseOnOverlayClick: boolean; | ||
18 | showClose: boolean; | ||
19 | }; | ||
12 | 20 | ||
13 | @injectCSS(styles) | 21 | @injectCSS(styles) |
14 | class Modal extends Component { | 22 | class Modal extends Component<Props> { |
15 | static propTypes = { | ||
16 | children: PropTypes.node.isRequired, | ||
17 | className: PropTypes.string, | ||
18 | classes: PropTypes.object.isRequired, | ||
19 | isOpen: PropTypes.bool.isRequired, | ||
20 | portal: PropTypes.string, | ||
21 | close: PropTypes.func.isRequired, | ||
22 | shouldCloseOnOverlayClick: PropTypes.bool, | ||
23 | showClose: PropTypes.bool, | ||
24 | }; | ||
25 | |||
26 | static defaultProps = { | 23 | static defaultProps = { |
27 | className: null, | 24 | className: null, |
28 | portal: 'modal-portal', | 25 | portal: 'modal-portal', |
diff --git a/src/components/ui/Modal/styles.js b/src/components/ui/Modal/styles.ts index f32c075ce..f32c075ce 100644 --- a/src/components/ui/Modal/styles.js +++ b/src/components/ui/Modal/styles.ts | |||