gab-social/app/javascript/gabsocial/components/modal/modal_layout.js

52 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-02-24 21:56:07 +00:00
import { defineMessages, injectIntl } from 'react-intl'
import Button from '../button'
import Block from '../block'
import Heading from '../heading'
const messages = defineMessages({
close: { id: 'lightbox.close', defaultMessage: 'Close' },
2020-02-24 21:56:07 +00:00
})
2020-02-24 21:56:07 +00:00
export default
@injectIntl
class ModalLayout extends PureComponent {
static propTypes = {
title: PropTypes.string,
children: PropTypes.node,
onClose: PropTypes.func.isRequired,
2020-02-24 21:56:07 +00:00
}
render() {
2020-03-07 04:53:28 +00:00
const {
title,
children,
intl,
onClose,
} = this.props
return (
2020-02-24 21:56:07 +00:00
<div className={[_s.width645PX].join(' ')}>
<Block>
2020-03-11 23:56:18 +00:00
<div className={[_s.default, _s.flexRow, _s.alignItemsCenter, _s.justifyContentCenter, _s.borderBottom1PX, _s.borderColorSecondary, _s.height53PX, _s.px15].join(' ')}>
2020-02-24 21:56:07 +00:00
<Heading size='h3'>
{title}
</Heading>
<Button
2020-03-07 04:53:28 +00:00
backgroundColor='none'
2020-02-24 21:56:07 +00:00
title={intl.formatMessage(messages.close)}
2020-03-07 04:53:28 +00:00
className={_s.marginLeftAuto}
2020-02-24 21:56:07 +00:00
onClick={onClose}
2020-03-07 04:53:28 +00:00
icon='close'
iconWidth='10px'
iconWidth='10px'
2020-02-24 21:56:07 +00:00
/>
</div>
2020-03-11 23:56:18 +00:00
<div className={[_s.default, _s.px15, _s.py10].join(' ')}>
2020-02-24 21:56:07 +00:00
{children}
</div>
</Block>
</div>
)
2020-02-24 21:56:07 +00:00
}
}