Change URLs format

This commit is contained in:
Paulo Gustavo Veiga 2020-12-11 20:33:02 -08:00
parent bec0c7998c
commit ff5859a704
6 changed files with 16 additions and 16 deletions

View File

@ -54,17 +54,17 @@ const App = () => {
<Router> <Router>
<Switch> <Switch>
<Route exact path="/"> <Route exact path="/">
<Redirect to="/c/login" /> <Redirect to="/c/view/login" />
</Route> </Route>
<Route path="/c/login" component={LoginPage} /> <Route path="/c/view/login" component={LoginPage} />
<Route path="/c/user/registration"> <Route path="/c/view/registration">
<RegistationPage service={service} /> <RegistationPage service={service} />
</Route> </Route>
<Route path="/c/user/registrationSuccess" component={RegistrationSuccessPage} /> <Route path="/c/view/registration-success" component={RegistrationSuccessPage} />
<Route path="/c/user/resetPassword"> <Route path="/c/view/forgot-password">
<ForgotPasswordPage service={service} /> <ForgotPasswordPage service={service} />
</Route> </Route>
<Route path="/c/user/forgotPasswordSuccess" component={ForgotPasswordSuccessPage} /> <Route path="/c/view/forgot-password-success" component={ForgotPasswordSuccessPage} />
</Switch> </Switch>
</Router> </Router>
</IntlProvider> </IntlProvider>

View File

@ -32,8 +32,11 @@ const ForgotPassword = (props: ServiceProps) => {
// Call Service ... // Call Service ...
props.service.resetPassword( props.service.resetPassword(
email, email,
() => history.push("/c/user/forgotPasswordSuccess"), () => history.push("/c/view/forgot-password-success"),
(msg) => { setErrorMsg(msg); setDisableButton(false); } (msg) => {
setErrorMsg(msg);
setDisableButton(false);
}
); );
} }

View File

@ -38,7 +38,7 @@ class Header extends React.Component<HeaderProps, HeaderProps> {
return ( return (
<StyledNav> <StyledNav>
<StyledDiv> <StyledDiv>
<Logo><Link to="/" className="header-logo"><img src={String(logo)} alt="logo" /></Link></Logo> <Logo><Link to="/c/view/login" className="header-logo"><img src={String(logo)} alt="logo" /></Link></Logo>
{text} {text}
{signUpButton} {signUpButton}
{signInButton} {signInButton}
@ -57,7 +57,7 @@ const SignInButton = (props: ButtonProps) => {
const style = props.style ? props.style : 'style1'; const style = props.style ? props.style : 'style1';
return ( return (
<span className={`button-${style} ${props.className}`}> <span className={`button-${style} ${props.className}`}>
<Link to="/c/login"><FormattedMessage id="login.signin" defaultMessage="Sign In" /></Link> <Link to="/c/view/login"><FormattedMessage id="login.signin" defaultMessage="Sign In" /></Link>
</span>); </span>);
} }
@ -65,7 +65,7 @@ const SignUpButton = (props: ButtonProps) => {
const style = props.style ? props.style : 'style1'; const style = props.style ? props.style : 'style1';
return ( return (
<span className={`button-${style} ${props.className}`}> <span className={`button-${style} ${props.className}`}>
<Link to="/c/user/registration"><FormattedMessage id="login.signup" defaultMessage="Sign Up" /></Link> <Link to="/c/view/registration"><FormattedMessage id="login.signup" defaultMessage="Sign Up" /></Link>
</span>); </span>);
} }

View File

@ -69,7 +69,7 @@ const LoginPage = () => {
</div> </div>
<SubmitButton value={intl.formatMessage({ id: "login.signin", defaultMessage: "Sign In" })} /> <SubmitButton value={intl.formatMessage({ id: "login.signin", defaultMessage: "Sign In" })} />
</form> </form>
<Link to="/c/user/resetPassword"><FormattedMessage id="login.forgotpwd" defaultMessage="Forgot Password ?" /></Link> <Link to="/c/view/forgot-password"><FormattedMessage id="login.forgotpwd" defaultMessage="Forgot Password ?" /></Link>
<ConfigStatusMessage enabled='false' /> <ConfigStatusMessage enabled='false' />

View File

@ -41,7 +41,7 @@ const RegistrationForm = (props: ServiceProps) => {
// Call Service ... // Call Service ...
props.service.registerNewUser( props.service.registerNewUser(
user, user,
() => history.push("/c/user/registrationSuccess"), () => history.push("/c/view/registration-success"),
(msg) => { setErrorMsg(msg); setDisableButton(false); } (msg) => { setErrorMsg(msg); setDisableButton(false); }
); );
} }

View File

@ -16,7 +16,6 @@ const RegistrationSuccessPage = () => {
return ( return (
<div> <div>
<Header type='none' /> <Header type='none' />
<div>
<PageContent> <PageContent>
<h1> <h1>
<FormattedMessage id="resetpassword.success.title" defaultMessage="Your account has been created successfully" /> <FormattedMessage id="resetpassword.success.title" defaultMessage="Your account has been created successfully" />
@ -24,10 +23,8 @@ const RegistrationSuccessPage = () => {
<p> <p>
<FormattedMessage id="registration.success.desc" defaultMessage="Click 'Sign In' button below and start creating mind maps." /> <FormattedMessage id="registration.success.desc" defaultMessage="Click 'Sign In' button below and start creating mind maps." />
</p> </p>
<SignInButton style='style1' /> <SignInButton style='style1' />
</PageContent> </PageContent>
</div>
<Footer /> <Footer />
</div> </div>
); );