2022-03-21 11:09:01 -07:00
|
|
|
import PropTypes from 'prop-types';
|
2022-05-18 11:08:08 -07:00
|
|
|
import React, { useEffect } from 'react';
|
2022-03-21 11:09:01 -07:00
|
|
|
import { useIntl } from 'react-intl';
|
2022-05-11 17:54:23 -07:00
|
|
|
import { useDispatch } from 'react-redux';
|
2022-03-21 11:09:01 -07:00
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
|
2022-05-18 11:08:08 -07:00
|
|
|
import { openModal } from 'soapbox/actions/modals';
|
2022-05-07 13:52:01 -07:00
|
|
|
import LandingGradient from 'soapbox/components/landing-gradient';
|
2022-05-11 17:54:23 -07:00
|
|
|
import SiteLogo from 'soapbox/components/site-logo';
|
2022-05-18 11:08:08 -07:00
|
|
|
import { useAppSelector, useOwnAccount } from 'soapbox/hooks';
|
2022-03-21 11:09:01 -07:00
|
|
|
|
|
|
|
import { logOut } from '../../actions/auth';
|
|
|
|
import { Button, Stack, Text } from '../../components/ui';
|
|
|
|
|
|
|
|
const WaitlistPage = ({ account }) => {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
const intl = useIntl();
|
2022-05-18 11:08:08 -07:00
|
|
|
const title = useAppSelector((state) => state.instance.title);
|
|
|
|
|
|
|
|
const me = useOwnAccount();
|
|
|
|
const isSmsVerified = me.getIn(['source', 'sms_verified']);
|
2022-03-21 11:09:01 -07:00
|
|
|
|
|
|
|
const onClickLogOut = (event) => {
|
|
|
|
event.preventDefault();
|
|
|
|
dispatch(logOut(intl));
|
|
|
|
};
|
|
|
|
|
2022-05-18 11:08:08 -07:00
|
|
|
const openVerifySmsModal = () => dispatch(openModal('VERIFY_SMS'));
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (!isSmsVerified) {
|
|
|
|
openVerifySmsModal();
|
|
|
|
}
|
|
|
|
}, []);
|
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
return (
|
2022-05-07 13:52:01 -07:00
|
|
|
<div>
|
|
|
|
<LandingGradient />
|
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
<main className='relative flex flex-col h-screen max-w-7xl mx-auto px-2 sm:px-6 lg:px-8'>
|
|
|
|
<header className='relative flex justify-between h-16'>
|
|
|
|
<div className='flex-1 flex items-stretch justify-center relative'>
|
|
|
|
<Link to='/' className='cursor-pointer flex-shrink-0 flex items-center'>
|
2022-05-11 17:54:23 -07:00
|
|
|
<SiteLogo alt='Logo' className='h-7' />
|
2022-03-21 11:09:01 -07:00
|
|
|
</Link>
|
|
|
|
|
|
|
|
<div className='absolute inset-y-0 right-0 flex items-center pr-2 space-x-3'>
|
2022-04-19 12:37:48 -07:00
|
|
|
<Button onClick={onClickLogOut} theme='primary' to='/logout'>
|
2022-03-21 11:09:01 -07:00
|
|
|
Sign out
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<div className='-mt-16 flex flex-col justify-center items-center h-full'>
|
2022-05-18 11:08:08 -07:00
|
|
|
<div className='max-w-xl'>
|
2022-03-21 11:09:01 -07:00
|
|
|
<Stack space={4}>
|
|
|
|
<img src='/instance/images/waitlist.png' className='mx-auto w-32 h-32' alt='Waitlisted' />
|
|
|
|
|
|
|
|
<Stack space={2}>
|
|
|
|
<Text size='lg' theme='muted' align='center' weight='medium'>
|
2022-05-18 11:08:08 -07:00
|
|
|
Welcome back to {title}! You were previously placed on our
|
|
|
|
waitlist. Please verify your phone number to receive
|
|
|
|
immediate access to your account!
|
2022-03-21 11:09:01 -07:00
|
|
|
</Text>
|
2022-05-18 11:08:08 -07:00
|
|
|
|
|
|
|
<div className='text-center'>
|
|
|
|
<Button onClick={openVerifySmsModal} theme='primary'>Verify phone number</Button>
|
|
|
|
</div>
|
2022-03-21 11:09:01 -07:00
|
|
|
</Stack>
|
|
|
|
</Stack>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
WaitlistPage.propTypes = {
|
|
|
|
account: PropTypes.object,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default WaitlistPage;
|