kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
AuthLayout: use logo from soapboxConfig
rodzic
440309b7dd
commit
564524bfcc
|
@ -1,8 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link, Redirect, Route, Switch } from 'react-router-dom';
|
import { Link, Redirect, Route, Switch } from 'react-router-dom';
|
||||||
|
|
||||||
|
import SvgIcon from 'soapbox/components/ui/icon/svg-icon';
|
||||||
import BundleContainer from 'soapbox/features/ui/containers/bundle_container';
|
import BundleContainer from 'soapbox/features/ui/containers/bundle_container';
|
||||||
import { NotificationsContainer } from 'soapbox/features/ui/util/async-components';
|
import { NotificationsContainer } from 'soapbox/features/ui/util/async-components';
|
||||||
|
import { useAppSelector, useSoapboxConfig } from 'soapbox/hooks';
|
||||||
|
|
||||||
import { Card, CardBody } from '../../components/ui';
|
import { Card, CardBody } from '../../components/ui';
|
||||||
import LoginPage from '../auth_login/components/login_page';
|
import LoginPage from '../auth_login/components/login_page';
|
||||||
|
@ -12,43 +14,56 @@ import PasswordResetConfirm from '../auth_login/components/password_reset_confir
|
||||||
import Verification from '../verification';
|
import Verification from '../verification';
|
||||||
import EmailPassthru from '../verification/email_passthru';
|
import EmailPassthru from '../verification/email_passthru';
|
||||||
|
|
||||||
const AuthLayout = () => (
|
const AuthLayout = () => {
|
||||||
<div>
|
const { logo } = useSoapboxConfig();
|
||||||
<div className='fixed h-screen w-full bg-gradient-to-tr from-primary-50 via-white to-cyan-50' />
|
const siteTitle = useAppSelector(state => state.instance.title);
|
||||||
|
|
||||||
<main className='relative flex flex-col h-screen'>
|
return (
|
||||||
<header className='pt-10 flex justify-center relative'>
|
<div>
|
||||||
<Link to='/' className='cursor-pointer'>
|
<div className='fixed h-screen w-full bg-gradient-to-tr from-primary-50 via-white to-cyan-50' />
|
||||||
<img src='/instance/images/truth-logo.svg' alt='Logo' className='h-7' />
|
|
||||||
</Link>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div className='-mt-10 flex flex-col justify-center items-center h-full'>
|
<main className='relative flex flex-col h-screen'>
|
||||||
<div className='sm:mx-auto w-full sm:max-w-lg md:max-w-2xl'>
|
<header className='pt-10 flex justify-center relative'>
|
||||||
<Card variant='rounded' size='xl'>
|
<Link to='/' className='cursor-pointer'>
|
||||||
<CardBody>
|
{logo ? (
|
||||||
<Switch>
|
<img src={logo} alt={siteTitle} className='h-7' />
|
||||||
<Route exact path='/auth/verify' component={Verification} />
|
) : (
|
||||||
<Route exact path='/auth/verify/email/:token' component={EmailPassthru} />
|
<SvgIcon
|
||||||
<Route exact path='/login' component={LoginPage} />
|
className='w-7 h-7'
|
||||||
<Route exact path='/reset-password' component={PasswordReset} />
|
alt={siteTitle}
|
||||||
<Route exact path='/edit-password' component={PasswordResetConfirm} />
|
src={require('@tabler/icons/icons/home.svg')}
|
||||||
{/* <Route exact path='/auth/confirmation' component={EmailConfirmation} /> */}
|
/>
|
||||||
|
)}
|
||||||
|
</Link>
|
||||||
|
</header>
|
||||||
|
|
||||||
<Redirect from='/auth/password/new' to='/reset-password' />
|
<div className='-mt-10 flex flex-col justify-center items-center h-full'>
|
||||||
<Redirect from='/auth/password/edit' to='/edit-password' />
|
<div className='sm:mx-auto w-full sm:max-w-lg md:max-w-2xl'>
|
||||||
</Switch>
|
<Card variant='rounded' size='xl'>
|
||||||
</CardBody>
|
<CardBody>
|
||||||
</Card>
|
<Switch>
|
||||||
|
<Route exact path='/auth/verify' component={Verification} />
|
||||||
|
<Route exact path='/auth/verify/email/:token' component={EmailPassthru} />
|
||||||
|
<Route exact path='/login' component={LoginPage} />
|
||||||
|
<Route exact path='/reset-password' component={PasswordReset} />
|
||||||
|
<Route exact path='/edit-password' component={PasswordResetConfirm} />
|
||||||
|
{/* <Route exact path='/auth/confirmation' component={EmailConfirmation} /> */}
|
||||||
|
|
||||||
|
<Redirect from='/auth/password/new' to='/reset-password' />
|
||||||
|
<Redirect from='/auth/password/edit' to='/edit-password' />
|
||||||
|
</Switch>
|
||||||
|
</CardBody>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<BundleContainer fetchComponent={NotificationsContainer}>
|
<BundleContainer fetchComponent={NotificationsContainer}>
|
||||||
{(Component) => <Component />}
|
{(Component) => <Component />}
|
||||||
</BundleContainer>
|
</BundleContainer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default AuthLayout;
|
export default AuthLayout;
|
||||||
|
|
|
@ -24,7 +24,7 @@ const Navbar = () => {
|
||||||
const singleUserMode = soapboxConfig.get('singleUserMode');
|
const singleUserMode = soapboxConfig.get('singleUserMode');
|
||||||
|
|
||||||
// In demo mode, use the Soapbox logo
|
// In demo mode, use the Soapbox logo
|
||||||
const logo = settings.get('demo') ? require('images/soapbox-logo.svg') : soapboxConfig.get('logo');
|
const logo = settings.get('demo') ? require('images/soapbox-logo.svg') : soapboxConfig.logo;
|
||||||
|
|
||||||
const onOpenSidebar = () => dispatch(openSidebar());
|
const onOpenSidebar = () => dispatch(openSidebar());
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue