RegisterInvite: move to AuthLayout
This commit is contained in:
parent
40f3b769fc
commit
6ff34d77fd
|
@ -192,6 +192,7 @@ const SoapboxMount = () => {
|
||||||
<Route path='/verify' component={AuthLayout} />
|
<Route path='/verify' component={AuthLayout} />
|
||||||
<Route path='/reset-password' component={AuthLayout} />
|
<Route path='/reset-password' component={AuthLayout} />
|
||||||
<Route path='/edit-password' component={AuthLayout} />
|
<Route path='/edit-password' component={AuthLayout} />
|
||||||
|
<Route path='/invite/:token' component={AuthLayout} />
|
||||||
|
|
||||||
<Route path='/' component={UI} />
|
<Route path='/' component={UI} />
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
|
@ -12,6 +12,7 @@ import PasswordReset from '../auth_login/components/password_reset';
|
||||||
import PasswordResetConfirm from '../auth_login/components/password_reset_confirm';
|
import PasswordResetConfirm from '../auth_login/components/password_reset_confirm';
|
||||||
import RegistrationForm from '../auth_login/components/registration_form';
|
import RegistrationForm from '../auth_login/components/registration_form';
|
||||||
import ExternalLoginForm from '../external_login/components/external-login-form';
|
import ExternalLoginForm from '../external_login/components/external-login-form';
|
||||||
|
import RegisterInvite from '../register_invite';
|
||||||
import Verification from '../verification';
|
import Verification from '../verification';
|
||||||
import EmailPassthru from '../verification/email_passthru';
|
import EmailPassthru from '../verification/email_passthru';
|
||||||
|
|
||||||
|
@ -50,6 +51,7 @@ const AuthLayout = () => {
|
||||||
<Route exact path='/signup' component={RegistrationForm} />
|
<Route exact path='/signup' component={RegistrationForm} />
|
||||||
<Route exact path='/reset-password' component={PasswordReset} />
|
<Route exact path='/reset-password' component={PasswordReset} />
|
||||||
<Route exact path='/edit-password' component={PasswordResetConfirm} />
|
<Route exact path='/edit-password' component={PasswordResetConfirm} />
|
||||||
|
<Route path='/invite/:token' component={RegisterInvite} />
|
||||||
|
|
||||||
<Redirect from='/auth/password/new' to='/reset-password' />
|
<Redirect from='/auth/password/new' to='/reset-password' />
|
||||||
<Redirect from='/auth/password/edit' to='/edit-password' />
|
<Redirect from='/auth/password/edit' to='/edit-password' />
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
import { useParams } from 'react-router-dom';
|
||||||
|
|
||||||
import RegistrationForm from 'soapbox/features/auth_login/components/registration_form';
|
import RegistrationForm from 'soapbox/features/auth_login/components/registration_form';
|
||||||
import { useAppSelector } from 'soapbox/hooks';
|
import { useAppSelector } from 'soapbox/hooks';
|
||||||
|
|
||||||
interface IRegisterInvite {
|
interface RegisterInviteParams {
|
||||||
/** URL params. */
|
|
||||||
params: {
|
|
||||||
/** Invite token from the URL. */
|
|
||||||
token: string,
|
token: string,
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Page to register with an invitation. */
|
/** Page to register with an invitation. */
|
||||||
const RegisterInvite: React.FC<IRegisterInvite> = ({ params }) => {
|
const RegisterInvite: React.FC = () => {
|
||||||
|
const { token } = useParams<RegisterInviteParams>();
|
||||||
const siteTitle = useAppSelector(state => state.instance.title);
|
const siteTitle = useAppSelector(state => state.instance.title);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -34,7 +32,7 @@ const RegisterInvite: React.FC<IRegisterInvite> = ({ params }) => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className='register-invite__form'>
|
<div className='register-invite__form'>
|
||||||
<RegistrationForm inviteToken={params.token} />
|
<RegistrationForm inviteToken={token} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -107,7 +107,6 @@ import {
|
||||||
NotificationsContainer,
|
NotificationsContainer,
|
||||||
ModalContainer,
|
ModalContainer,
|
||||||
ProfileHoverCard,
|
ProfileHoverCard,
|
||||||
RegisterInvite,
|
|
||||||
Share,
|
Share,
|
||||||
NewStatus,
|
NewStatus,
|
||||||
IntentionalError,
|
IntentionalError,
|
||||||
|
@ -288,8 +287,6 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
|
||||||
<WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} />
|
<WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} />
|
||||||
{features.scheduledStatuses && <WrappedRoute path='/scheduled_statuses' page={DefaultPage} component={ScheduledStatuses} content={children} />}
|
{features.scheduledStatuses && <WrappedRoute path='/scheduled_statuses' page={DefaultPage} component={ScheduledStatuses} content={children} />}
|
||||||
|
|
||||||
<WrappedRoute path='/invite/:token' page={DefaultPage} component={RegisterInvite} content={children} publicRoute />
|
|
||||||
|
|
||||||
<WrappedRoute path='/settings/profile' page={DefaultPage} component={EditProfile} content={children} />
|
<WrappedRoute path='/settings/profile' page={DefaultPage} component={EditProfile} content={children} />
|
||||||
<WrappedRoute path='/settings/export' page={DefaultPage} component={ExportData} content={children} />
|
<WrappedRoute path='/settings/export' page={DefaultPage} component={ExportData} content={children} />
|
||||||
<WrappedRoute path='/settings/import' page={DefaultPage} component={ImportData} content={children} />
|
<WrappedRoute path='/settings/import' page={DefaultPage} component={ImportData} content={children} />
|
||||||
|
|
Loading…
Reference in New Issue