Progress on mobile modal and popover dialogs

This commit is contained in:
mgabdev
2020-05-12 20:36:54 -04:00
parent 2fcbd4131f
commit ccc3206f8f
22 changed files with 166 additions and 80 deletions

View File

@@ -1,10 +1,13 @@
import Block from '../block'
import Heading from '../heading'
export default class PopoverLayout extends PureComponent {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
width: PropTypes.number,
isXS: PropTypes.bool,
title: PropTypes.string,
}
static defaultProps = {
@@ -12,14 +15,38 @@ export default class PopoverLayout extends PureComponent {
}
render() {
const { children, className, width } = this.props
const {
children,
width,
isXS,
title,
} = this.props
if (isXS) {
return (
<div className={[_s.default, _s.bgPrimary, _s.overflowHidden, _s.modal, _s.topRightRadiusSmall, _s.topLeftRadiusSmall].join(' ')}>
{
!!title &&
<div className={[_s.default, _s.flexRow, _s.alignItemsCenter, _s.justifyContentCenter, _s.borderBottom1PX, _s.borderColorSecondary, _s.height53PX, _s.px15].join(' ')}>
<Heading size='h2'>
{title}
</Heading>
</div>
}
<div className={[_s.default, _s.heightMax80VH, _s.overflowYScroll].join(' ')}>
{children}
</div>
</div>
)
}
return (
<div className={className} style={{width: `${width}px`}}>
<div style={{ width: `${width}px` }} className={_s.modal}>
<Block>
{children}
</Block>
</div>
)
}
}