2020-02-24 23:25:55 +00:00
import { defineMessages , injectIntl } from 'react-intl'
import ImmutablePureComponent from 'react-immutable-pure-component'
2020-07-25 03:27:09 +01:00
import {
URL _GAB _PRO ,
DEFAULT _THEME ,
} from '../../constants'
2020-02-24 23:25:55 +00:00
import Button from '../button'
import Text from '../text'
2020-07-25 03:27:09 +01:00
import Icon from '../icon'
import Image from '../image'
2020-02-24 23:25:55 +00:00
import ModalLayout from './modal_layout'
2019-09-19 00:48:09 +01:00
const messages = defineMessages ( {
2020-02-24 23:25:55 +00:00
title : { id : 'promo.gab_pro' , defaultMessage : 'Upgrade to GabPRO' } ,
2020-07-25 03:27:09 +01:00
upgrade : { id : 'promo.upgrade' , defaultMessage : 'Upgrade' } ,
learnMore : { id : 'promo.learn_more' , defaultMessage : 'Learn more' } ,
2020-02-24 23:25:55 +00:00
text : { id : 'pro_upgrade_modal.text' , defaultMessage : 'Gab is fully funded by people like you. Please consider supporting us on our mission to defend free expression online for all people.' } ,
2020-07-25 03:27:09 +01:00
benefits : { id : 'pro_upgrade_modal.benefits' , defaultMessage : 'Here are some benefits that GabPRO members receive:' } ,
} )
const mapStateToProps = ( state ) => ( {
theme : state . getIn ( [ 'settings' , 'displayOptions' , 'theme' ] , DEFAULT _THEME ) ,
2020-02-24 23:25:55 +00:00
} )
2019-09-19 00:48:09 +01:00
2020-02-24 23:25:55 +00:00
export default
@ injectIntl
2020-07-25 03:27:09 +01:00
@ connect ( mapStateToProps )
2019-09-19 00:48:09 +01:00
class ProUpgradeModal extends ImmutablePureComponent {
static propTypes = {
intl : PropTypes . object . isRequired ,
2020-04-07 02:53:23 +01:00
onClose : PropTypes . func . isRequired ,
2020-07-25 03:27:09 +01:00
theme : PropTypes . string . isRequired ,
2020-02-24 23:25:55 +00:00
}
2019-09-19 00:48:09 +01:00
2020-02-24 23:25:55 +00:00
render ( ) {
2020-07-25 03:27:09 +01:00
const {
intl ,
onClose ,
theme ,
} = this . props
const imgSuffix = ( theme === 'light' || ! theme ) ? 'light' : 'dark'
const title = (
< span className = { [ _s . default , _s . flexRow , _s . justifyContentCenter , _s . alignItemsCenter ] . join ( ' ' ) } >
< span className = { [ _s . default , _s . mr2 ] . join ( ' ' ) } >
Upgrade to Gab
< / s p a n >
< span className = { [ _s . bgPro , _s . colorBlack , _s . radiusSmall , _s . px5 , _s . py5 ] . join ( ' ' ) } > PRO < / s p a n >
< / s p a n >
)
2019-09-19 00:48:09 +01:00
return (
2020-04-07 02:53:23 +01:00
< ModalLayout
2020-07-25 03:27:09 +01:00
title = { title }
width = { 540 }
2020-04-07 02:53:23 +01:00
onClose = { onClose }
>
2020-07-25 03:27:09 +01:00
< Text size = 'medium' weight = 'medium' className = { _s . mb10 } >
2020-03-11 23:56:18 +00:00
{ intl . formatMessage ( messages . text ) }
< / T e x t >
2020-07-25 03:27:09 +01:00
< Text size = 'medium' color = 'secondary' >
2020-03-11 23:56:18 +00:00
{ intl . formatMessage ( messages . benefits ) }
< / T e x t >
< div className = { [ _s . default , _s . my10 ] . join ( ' ' ) } >
2020-07-25 03:27:09 +01:00
< Image
src = { ` /headers/pro-features- ${ imgSuffix } .png ` }
width = '100%'
height = 'auto'
fit = 'cover'
className = { _s . heightMin320PX }
/ >
2019-09-19 00:48:09 +01:00
< / d i v >
2020-02-24 23:25:55 +00:00
2020-07-25 03:27:09 +01:00
< div className = { [ _s . default , _s . flexRow , _s . py10 ] . join ( ' ' ) } >
< Button
isOutline
color = 'brand'
backgroundColor = 'none'
href = { URL _GAB _PRO }
className = { [ _s . flexRow , _s . alignItemsCenter , _s . justifyContentCenter , _s . mr10 ] . join ( ' ' ) }
>
< Text color = 'inherit' weight = 'medium' align = 'center' >
{ intl . formatMessage ( messages . learnMore ) }
< / T e x t >
< / B u t t o n >
< Button
href = { URL _GAB _PRO }
className = { [ _s . flexRow , _s . flexGrow1 , _s . alignItemsCenter , _s . justifyContentCenter ] . join ( ' ' ) }
>
< Text color = 'inherit' size = 'large' weight = 'bold' align = 'center' >
{ intl . formatMessage ( messages . upgrade ) }
< / T e x t >
< Icon id = 'arrow-right' size = '20px' className = { [ _s . fillWhite , _s . ml5 ] . join ( ' ' ) } / >
< / B u t t o n >
< / d i v >
2020-02-24 23:25:55 +00:00
< / M o d a l L a y o u t >
)
2019-09-19 00:48:09 +01:00
}
2020-04-08 02:06:59 +01:00
2019-09-19 00:48:09 +01:00
}