2022-03-21 11:09:01 -07:00
|
|
|
import React from 'react';
|
|
|
|
import { Link, Redirect, Route, Switch } from 'react-router-dom';
|
|
|
|
|
2022-05-07 13:52:01 -07:00
|
|
|
import LandingGradient from 'soapbox/components/landing-gradient';
|
2022-04-19 13:20:50 -07:00
|
|
|
import SvgIcon from 'soapbox/components/ui/icon/svg-icon';
|
2022-03-21 11:09:01 -07:00
|
|
|
import BundleContainer from 'soapbox/features/ui/containers/bundle_container';
|
|
|
|
import { NotificationsContainer } from 'soapbox/features/ui/util/async-components';
|
2022-04-19 13:20:50 -07:00
|
|
|
import { useAppSelector, useSoapboxConfig } from 'soapbox/hooks';
|
2022-03-21 11:09:01 -07:00
|
|
|
|
|
|
|
import { Card, CardBody } from '../../components/ui';
|
|
|
|
import LoginPage from '../auth_login/components/login_page';
|
|
|
|
import PasswordReset from '../auth_login/components/password_reset';
|
|
|
|
import PasswordResetConfirm from '../auth_login/components/password_reset_confirm';
|
2022-04-30 09:54:24 -07:00
|
|
|
import RegistrationForm from '../auth_login/components/registration_form';
|
2022-03-21 11:09:01 -07:00
|
|
|
import Verification from '../verification';
|
|
|
|
import EmailPassthru from '../verification/email_passthru';
|
|
|
|
|
2022-04-19 13:20:50 -07:00
|
|
|
const AuthLayout = () => {
|
|
|
|
const { logo } = useSoapboxConfig();
|
|
|
|
const siteTitle = useAppSelector(state => state.instance.title);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2022-05-07 13:52:01 -07:00
|
|
|
<LandingGradient />
|
2022-04-19 13:20:50 -07:00
|
|
|
|
|
|
|
<main className='relative flex flex-col h-screen'>
|
2022-05-02 15:35:55 -07:00
|
|
|
<header className='py-10 flex justify-center relative'>
|
2022-04-19 13:20:50 -07:00
|
|
|
<Link to='/' className='cursor-pointer'>
|
|
|
|
{logo ? (
|
|
|
|
<img src={logo} alt={siteTitle} className='h-7' />
|
|
|
|
) : (
|
|
|
|
<SvgIcon
|
2022-04-25 14:41:02 -07:00
|
|
|
className='w-7 h-7 dark:text-white'
|
2022-04-19 13:20:50 -07:00
|
|
|
alt={siteTitle}
|
|
|
|
src={require('@tabler/icons/icons/home.svg')}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</Link>
|
|
|
|
</header>
|
|
|
|
|
2022-05-02 15:35:55 -07:00
|
|
|
<div className='flex flex-col justify-center items-center'>
|
|
|
|
<div className='pb-10 sm:mx-auto w-full sm:max-w-lg md:max-w-2xl'>
|
2022-04-19 13:20:50 -07:00
|
|
|
<Card variant='rounded' size='xl'>
|
|
|
|
<CardBody>
|
|
|
|
<Switch>
|
2022-04-30 09:28:18 -07:00
|
|
|
<Route exact path='/verify' component={Verification} />
|
|
|
|
<Route exact path='/verify/email/:token' component={EmailPassthru} />
|
2022-04-19 13:20:50 -07:00
|
|
|
<Route exact path='/login' component={LoginPage} />
|
2022-04-30 09:54:24 -07:00
|
|
|
<Route exact path='/signup' component={RegistrationForm} />
|
2022-04-19 13:20:50 -07:00
|
|
|
<Route exact path='/reset-password' component={PasswordReset} />
|
|
|
|
<Route exact path='/edit-password' component={PasswordResetConfirm} />
|
|
|
|
|
|
|
|
<Redirect from='/auth/password/new' to='/reset-password' />
|
|
|
|
<Redirect from='/auth/password/edit' to='/edit-password' />
|
|
|
|
</Switch>
|
|
|
|
</CardBody>
|
|
|
|
</Card>
|
|
|
|
</div>
|
2022-03-21 11:09:01 -07:00
|
|
|
</div>
|
|
|
|
|
2022-04-19 13:20:50 -07:00
|
|
|
</main>
|
2022-03-21 11:09:01 -07:00
|
|
|
|
2022-04-19 13:20:50 -07:00
|
|
|
<BundleContainer fetchComponent={NotificationsContainer}>
|
|
|
|
{(Component) => <Component />}
|
|
|
|
</BundleContainer>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2022-03-21 11:09:01 -07:00
|
|
|
|
|
|
|
export default AuthLayout;
|