added dialog component
This commit is contained in:
parent
419e25df23
commit
3da1fbf6ca
3 changed files with 98 additions and 0 deletions
57
src/app/molecules/dialog/Dialog.jsx
Normal file
57
src/app/molecules/dialog/Dialog.jsx
Normal file
|
@ -0,0 +1,57 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import './Dialog.scss';
|
||||
|
||||
import Text from '../../atoms/text/Text';
|
||||
import Header, { TitleWrapper } from '../../atoms/header/Header';
|
||||
import ScrollView from '../../atoms/scroll/ScrollView';
|
||||
import RawModal from '../../atoms/modal/RawModal';
|
||||
|
||||
function Dialog({
|
||||
className, isOpen, title,
|
||||
contentOptions, onRequestClose, children,
|
||||
}) {
|
||||
return (
|
||||
<RawModal
|
||||
className={`${className === null ? '' : `${className} `}dialog-model`}
|
||||
isOpen={isOpen}
|
||||
onRequestClose={onRequestClose}
|
||||
size="small"
|
||||
>
|
||||
<div className="dialog">
|
||||
<div className="dialog__content">
|
||||
<Header>
|
||||
<TitleWrapper>
|
||||
<Text variant="h2">{title}</Text>
|
||||
</TitleWrapper>
|
||||
{contentOptions}
|
||||
</Header>
|
||||
<div className="dialog__content__wrapper">
|
||||
<ScrollView autoHide>
|
||||
<div className="dialog__content-container">
|
||||
{children}
|
||||
</div>
|
||||
</ScrollView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</RawModal>
|
||||
);
|
||||
}
|
||||
|
||||
Dialog.defaultProps = {
|
||||
className: null,
|
||||
contentOptions: null,
|
||||
onRequestClose: null,
|
||||
};
|
||||
|
||||
Dialog.propTypes = {
|
||||
className: PropTypes.string,
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
contentOptions: PropTypes.node,
|
||||
onRequestClose: PropTypes.func,
|
||||
children: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
export default Dialog;
|
28
src/app/molecules/dialog/Dialog.scss
Normal file
28
src/app/molecules/dialog/Dialog.scss
Normal file
|
@ -0,0 +1,28 @@
|
|||
.dialog-model {
|
||||
--modal-height: 656px;
|
||||
max-height: var(--modal-height) !important;
|
||||
}
|
||||
|
||||
.dialog {
|
||||
width: 100%;
|
||||
max-height: inherit;
|
||||
background-color: var(--bg-surface);
|
||||
display: flex;
|
||||
|
||||
&__content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.dialog__content-container {
|
||||
padding-top: var(--sp-extra-tight);
|
||||
padding-bottom: var(--sp-extra-loose);
|
||||
}
|
||||
.dialog__content__wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
13
src/app/organisms/pw/Dialogs.jsx
Normal file
13
src/app/organisms/pw/Dialogs.jsx
Normal file
|
@ -0,0 +1,13 @@
|
|||
import React from 'react';
|
||||
|
||||
import ReadReceipts from '../read-receipts/ReadReceipts';
|
||||
|
||||
function Dialogs() {
|
||||
return (
|
||||
<>
|
||||
<ReadReceipts />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Dialogs;
|
Loading…
Reference in a new issue