web: components: rename variables

This commit is contained in:
Andrey Savihin 2019-07-11 18:02:48 +03:00
parent af6128c38b
commit 1e60926dd8
3 changed files with 7 additions and 7 deletions

View File

@ -79,15 +79,15 @@ const Modal = styled.div`
overflow: hidden;
outline: 0;
background-color: rgba(0, 0, 0, 0.3);
display: ${props => props.isOpen ? 'block' : 'none'};
display: ${props => props.visible ? 'block' : 'none'};
`;
const ModalDialog = props => {
const { isOpen, headerContent, bodyContent, footerContent, onClose } = props;
const { visible, headerContent, bodyContent, footerContent, onClose } = props;
return (
<>
<Modal isOpen={isOpen}>
<Modal visible={visible}>
<Dialog>
<Content>
<Header>
@ -104,7 +104,7 @@ const ModalDialog = props => {
};
ModalDialog.propTypes = {
isOpen: PropTypes.bool,
visible: PropTypes.bool,
headerContent: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
bodyContent: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
footerContent: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),

View File

@ -9,14 +9,14 @@ ModalDialog is used for displaying modal dialogs
```js
import { ModalDialog } from 'asc-web-components';
<ModalDialog isOpen={false} />
<ModalDialog visible={false} />
```
#### Properties
| Props | Type | Required | Values | Default | Description |
| --------------- | ------------------------- | :------: | -------| ------- | ------------------------------------------------ |
| `isOpen` | `bool` | | | | Display dialog or not |
| `visible` | `bool` | | | | Display dialog or not |
| `headerContent` | `string/element/elements` | | | | Header content |
| `bodyContent` | `string/element/elements` | | | | Body content |
| `footerContent` | `string/element/elements` | | | | Footer content |

View File

@ -24,7 +24,7 @@ storiesOf('Components|ModalDialog', module)
}}
/>
<ModalDialog
isOpen={value}
visible={value}
headerContent={"Header text"}
bodyContent={
<p>{"Body text"}</p>