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

46 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-02-24 21:56:07 +00:00
const { title, children, intl, onClose } = this.props
return (
2020-02-24 21:56:07 +00:00
<div className={[_s.width645PX].join(' ')}>
<Block>
<div className={[_s.default, _s.flexRow, _s.alignItemsCenter, _s.justifyContentCenter, _s.borderBottom1PX, _s.borderColorSecondary, _s.height53PX, _s.paddingHorizontal15PX].join(' ')}>
<Heading size='h3'>
{title}
</Heading>
<Button
className=''
title={intl.formatMessage(messages.close)}
onClick={onClose}
icon='times'
iconWidth='20px'
iconWidth='20px'
/>
</div>
<div className={[_s.default, _s.paddingHorizontal15PX, _s.paddingVertical10PX].join(' ')}>
{children}
</div>
</Block>
</div>
)
2020-02-24 21:56:07 +00:00
}
}