2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-08-17 21:59:29 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2020-02-24 21:56:07 +00:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl'
|
|
|
|
import ModalLayout from './modal_layout'
|
|
|
|
import Text from '../text'
|
|
|
|
import Button from '../button'
|
|
|
|
|
2020-08-19 01:22:15 +01:00
|
|
|
class UnauthorizedModal extends React.PureComponent {
|
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
|
2020-07-25 03:20:09 +01:00
|
|
|
hideClose
|
2020-04-07 02:53:23 +01:00
|
|
|
title={intl.formatMessage(messages.signup)}
|
|
|
|
onClose={onClose}
|
2020-07-25 03:20:09 +01:00
|
|
|
width={480}
|
2020-04-07 02:53:23 +01:00
|
|
|
>
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.mt15, _s.mb15, _s.px15, _s.pb15].join(' ')}>
|
|
|
|
<div className={[_s.d, _s.px15, _s.py15].join(' ')}>
|
2020-07-25 03:20:09 +01:00
|
|
|
<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-07-25 03:20:09 +01:00
|
|
|
|
2020-08-18 18:07:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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' },
|
|
|
|
})
|
|
|
|
|
|
|
|
UnauthorizedModal.propTypes = {
|
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
onClose: PropTypes.func.isRequired,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(UnauthorizedModal)
|