redirect to dashboard and delete SignUpSuccess page
Hadrien Froger hadrien@octree.ch
Fri, 14 Aug 2020 07:10:04 +0100
3 files changed,
1 insertions(+),
63 deletions(-)
M
app/src/Router.js
→
app/src/Router.js
@@ -9,8 +9,6 @@ import NotFound from './pages/NotFound';
import Dashboard from './pages/Dashboard'; import Profile from './pages/Profile'; import SignUp from './pages/SignUp'; -import SignUpSuccess from './pages/SignUpSuccess'; -import NotConfirmed from './pages/SignUpSuccess'; import SignIn from './pages/SignIn'; import LostPassword from './pages/LostPassword.js'; import ResetPassword from './pages/ResetPassword.js';@@ -23,13 +21,11 @@ <Switch>
<Route path="/e/:eventId" component={Event} /> <Route path="/" exact component={Home} /> <Route path="/new" exact component={Home} /> - <Route path="/register/success" exact component={SignUpSuccess} /> <Route path="/register" exact component={SignUp} /> <Route path="/lost-password" exact component={LostPassword} /> <Route path="/reset-password" exact component={ResetPassword} /> <Route path="/login" exact component={SignIn} /> <Route path="/dashboard" exact component={Dashboard} /> - <Route path="/confirm" exact component={NotConfirmed} /> <Route path="/profile" exact component={Profile} /> <Route component={NotFound} /> </Switch>
M
app/src/containers/SignUpForm/index.js
→
app/src/containers/SignUpForm/index.js
@@ -59,7 +59,7 @@ return false;
}; if (!!token && !isLoading) { - return <Redirect to="/register/success" />; + return <Redirect to="/dashboard" />; } return (
D
app/src/pages/SignUpSuccess.js
@@ -1,58 +0,0 @@
-import React from 'react'; -import Layout from '../layouts/Centered'; -import Card from '@material-ui/core/Card'; -import CardMedia from '@material-ui/core/CardMedia'; -import Logo from '../components/Logo'; -import {useTranslation} from 'react-i18next'; -import Button from '@material-ui/core/Button'; -import CardContent from '@material-ui/core/CardContent'; -import CardActions from '@material-ui/core/CardActions'; -import Typography from '@material-ui/core/Typography'; -import {useAuth} from 'strapi-react-context'; -import {Redirect} from 'react-router-dom'; - -const SignUpSuccess = () => { - const {t} = useTranslation(); - const {token} = useAuth(); - - if (!token) return <Redirect to="/" />; - - return ( - <Layout title={t('meta.register_success_title')}> - <Card> - <CardMedia component={Logo} /> - <CardContent> - <Typography gutterBottom variant="h5" component="h2"> - {t('signup.success.title')} - </Typography> - <Typography - variant="body2" - color="textSecondary" - component="p" - dangerouslySetInnerHTML={{__html: t('signup.success.text_html')}} - /> - </CardContent> - <CardActions> - <Button - color="secondary" - variant="contained" - href={'/'} - id="SignUpSuccessCreateEvent" - > - {t('signup.success.create_event')} - </Button> - <Button - color="primary" - variant="contained" - href={'/dashboard'} - id="SignUpSuccessDashboard" - > - {t('signup.success.dashboard')} - </Button> - </CardActions> - </Card> - </Layout> - ); -}; - -export default SignUpSuccess;