Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit d9cb127

Browse files
committed
WIP
1 parent d65a9dc commit d9cb127

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

components/modal/Dialog.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ import { classnames } from '../../helpers/component';
66
const CLASSES = {
77
MODAL: 'pm-modal',
88
MODAL_OUT: 'pm-modalOut',
9-
MODAL_SMALL: 'pm-modal--smaller'
9+
MODAL_SMALL: 'pm-modal--smaller',
10+
MODAL_WIDE: 'pm-modal--wider',
11+
MODAL_FULL: 'pm-modal--full',
12+
MODAL_AUTO: 'pm-modal--auto'
1013
};
1114

1215
/** @type any */
1316
const Dialog = ({
1417
onExit,
15-
small: isSmall = false,
18+
size,
1619
isClosing = false,
1720
// eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars
1821
isFirst = false,
@@ -40,8 +43,13 @@ const Dialog = ({
4043
open
4144
className={classnames([
4245
CLASSES.MODAL,
43-
isSmall && CLASSES.MODAL_SMALL,
44-
isSmall && 'pm-modal--shorterLabels',
46+
{
47+
small: CLASSES.MODAL_SMALL,
48+
wide: CLASSES.MODAL_WIDE,
49+
full: CLASSES.MODAL_FULL,
50+
auto: CLASSES.MODAL_AUTO
51+
}[size],
52+
size === 'small' && 'pm-modal--shorterLabels',
4553
isClosing && CLASSES.MODAL_OUT,
4654
extraClassNames
4755
])}
@@ -61,7 +69,8 @@ Dialog.propTypes = {
6169
children: PropTypes.node.isRequired,
6270
modalTitleID: PropTypes.string.isRequired,
6371
className: PropTypes.string,
64-
small: PropTypes.bool,
72+
// TODO: create & use MODAL_SIZE[size] constants
73+
size: PropTypes.oneOf(['small', 'wide', 'full', 'auto']),
6574
isBehind: PropTypes.bool,
6675
isFirst: PropTypes.bool,
6776
isLast: PropTypes.bool,

0 commit comments

Comments
 (0)