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

63 lines
2.0 KiB
JavaScript
Raw Normal View History

2020-02-24 21:56:07 +00:00
import { defineMessages, injectIntl } from 'react-intl'
import ImmutablePureComponent from 'react-immutable-pure-component'
import ModalLayout from './modal_layout'
import Text from '../text'
import Button from '../button'
const messages = defineMessages({
signup: { id: 'unauthorized_modal.title', defaultMessage: 'Sign up for Gab' },
text: { id: 'unauthorized_modal.text', defaultMessage: 'You need to be logged in to do that.' },
register: { id: 'account.register', defaultMessage: 'Sign up' },
login: { id: 'account.login', defaultMessage: 'Log in' },
})
export default
@injectIntl
class UnauthorizedModal extends ImmutablePureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
2020-04-07 02:53:23 +01:00
onClose: PropTypes.func.isRequired,
2020-02-24 21:56:07 +00:00
}
render() {
2020-05-07 00:40:54 +01:00
const { intl, onClose } = this.props
2020-02-24 21:56:07 +00:00
return (
2020-04-07 02:53:23 +01:00
<ModalLayout
hideClose
2020-04-07 02:53:23 +01:00
title={intl.formatMessage(messages.signup)}
onClose={onClose}
width={480}
2020-04-07 02:53:23 +01:00
>
<div className={[_s.default, _s.mt15, _s.mb15, _s.px15, _s.pb15].join(' ')}>
<div className={[_s.default, _s.px15, _s.py15].join(' ')}>
<Text className={[_s.px15, _s.py15, _s.mb15]} size='medium' weight='medium' align='center'>
{intl.formatMessage(messages.text)}
</Text>
<Button isBlock href='/auth/sign_up' className={[_s.mt15, _s.mlAuto, _s.mrAuto].join(' ')}>
<Text color='inherit' size='large' weight='bold' align='center'>
{intl.formatMessage(messages.register)}
</Text>
</Button>
<Button
isOutline
isBlock
href='/auth/sign_in'
color='brand'
backgroundColor='none'
className={[_s.mt15, _s.mlAuto, _s.mrAuto].join(' ')}
>
<Text color='inherit' size='large' weight='bold' align='center'>
{intl.formatMessage(messages.login)}
</Text>
</Button>
</div>
2020-02-24 21:56:07 +00:00
</div>
</ModalLayout>
)
}
2020-02-24 21:56:07 +00:00
}