changed the intro page when logged in

fixes #2

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2020-05-15 12:05:23 +02:00 committed by Philip Molares
parent 88d7524ec5
commit fbd29c0338

View file

@ -1,14 +1,17 @@
import React from 'react' import React, { Fragment } from 'react'
import screenshot from './img/screenshot.png'; import screenshot from './img/screenshot.png';
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {Button} from 'react-bootstrap'; import {Button} from 'react-bootstrap';
import {Trans, useTranslation} from "react-i18next"; import {Trans, useTranslation} from "react-i18next";
import {Link} from "react-router-dom"; import {Link} from "react-router-dom";
import {useSelector} from "react-redux";
import {ApplicationState} from "../../../../redux";
const Intro: React.FC = () => { const Intro: React.FC = () => {
// ToDo replace this with comment // ToDo replace this with comment
const url = "http://localhost:3000";//useServerUrl(); const url = "http://localhost:3000";//useServerUrl();
useTranslation(); useTranslation();
const user = useSelector((state: ApplicationState) => state.user);
return ( return (
<div id="home" className="section"> <div id="home" className="section">
@ -20,33 +23,40 @@ const Intro: React.FC = () => {
<Trans i18nKey="coverSlogan"/> <Trans i18nKey="coverSlogan"/>
</p> </p>
<div className="mb-5"> {
<Link to="/login"> user.status === "forbidden" ?
<Button <Fragment>
variant="success" <div className="mb-5">
size="lg" <Link to="/login">
style={{minWidth: "200px"}} <Button
> variant="success"
<Trans i18nKey="signIn"/> size="lg"
</Button> style={{minWidth: "200px"}}
</Link> >
<Trans i18nKey="signIn"/>
</Button>
</Link>
<span className="m-2"> <span className="m-2">
or or
</span> </span>
<Button <Button
variant="primary" variant="primary"
size="lg" size="lg"
href={`${url}/features`} href={`${url}/features`}
style={{minWidth: "200px"}} style={{minWidth: "200px"}}
> >
<Trans i18nKey="exploreFeatures"/> <Trans i18nKey="exploreFeatures"/>
</Button> </Button>
</div> </div>
<img alt="CodiMD Screenshot" src={screenshot} className="screenshot img-fluid mb-5"/> <img alt="CodiMD Screenshot" src={screenshot} className="screenshot img-fluid mb-5"/>
</Fragment>
:
null
}
<div className="lead row mb-5" style={{width: '90%', margin: '0 auto'}}> <div className="lead row mb-5" style={{width: '90%', margin: '0 auto'}}>
<div className="col-md-4 inner"> <div className="col-md-4 inner">