bigbuffet-rw/app/soapbox/features/landing_page/index.js

74 lines
2.6 KiB
JavaScript
Raw Normal View History

2022-03-21 11:09:01 -07:00
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
2022-03-21 11:09:01 -07:00
import { useSelector } from 'react-redux';
2022-03-21 11:09:01 -07:00
import VerificationBadge from 'soapbox/components/verification_badge';
2022-03-21 11:45:57 -07:00
import { Button, Card, CardBody, Stack, Text } from '../../components/ui';
2022-03-21 11:09:01 -07:00
const LandingPage = () => {
const instance = useSelector((state) => state.get('instance'));
const isOpen = useSelector(state => state.getIn(['verification', 'instance', 'registrations'], false) === true);
2022-03-21 11:09:01 -07:00
const renderClosed = () => {
return (
2022-03-21 11:09:01 -07:00
<Stack space={3}>
<Text size='xl' weight='bold' align='center'>
<FormattedMessage
id='registration.closed_title'
defaultMessage='Registrations Closed'
/>
2022-03-21 11:09:01 -07:00
</Text>
<Text theme='muted' align='center'>
<FormattedMessage
id='registration.closed_message'
2022-03-21 11:09:01 -07:00
defaultMessage='{instance} is not accepting new members.'
values={{ instance: instance.get('title') }}
/>
2022-03-21 11:09:01 -07:00
</Text>
</Stack>
);
2022-03-21 11:09:01 -07:00
};
2022-03-21 11:09:01 -07:00
return (
<main className='mt-16 sm:mt-24'>
<div className='mx-auto max-w-7xl'>
<div className='lg:grid lg:grid-cols-12 lg:gap-8 items-center py-24'>
<div className='px-4 sm:px-6 sm:text-center md:max-w-2xl md:mx-auto lg:col-span-6 lg:text-left lg:flex lg:items-center'>
<div>
<Stack space={3}>
<h1 className='text-5xl font-extrabold text-transparent bg-clip-text bg-gradient-to-br from-pink-600 via-primary-500 to-blue-600 sm:mt-5 sm:leading-none lg:mt-6 lg:text-6xl xl:text-7xl'>
2022-03-21 11:45:57 -07:00
{instance.title}
2022-03-21 11:09:01 -07:00
</h1>
<Text size='lg'>
2022-03-21 11:45:57 -07:00
{instance.description}
2022-03-21 11:09:01 -07:00
</Text>
</Stack>
2020-04-10 13:24:12 -07:00
</div>
</div>
2022-03-21 11:09:01 -07:00
<div className='hidden lg:block sm:mt-24 lg:mt-0 lg:col-span-6'>
<Card size='xl' variant='rounded' className='sm:max-w-md sm:w-full sm:mx-auto'>
<CardBody>
{isOpen ? (
<Stack space={3}>
<VerificationBadge className='h-16 w-16 mx-auto' />
<Stack>
<Text size='2xl' weight='bold' align='center'>Let&apos;s get started!</Text>
<Text theme='muted' align='center'>Social Media Without Discrimination</Text>
</Stack>
<Button to='/auth/verify' theme='primary' block>Create an account</Button>
</Stack>
) : renderClosed()}
</CardBody>
</Card>
2020-04-10 13:24:12 -07:00
</div>
</div>
2022-03-21 11:09:01 -07:00
</div>
</main>
);
};
2022-03-21 11:09:01 -07:00
export default LandingPage;