Commit 537cc7b2 authored by Damien's avatar Damien
Browse files

Add images

parent 6c4b82d4
import React from 'react'; import React from 'react';
import {Image} from 'semantic-ui-react'
import { BrowserRouter as Router, Route } from 'react-router-dom'; import { BrowserRouter as Router, Route } from 'react-router-dom';
import './App.css'; import './App.css';
import AdminPage from './view/AdminPage/AdminPage'; import AdminPage from './view/AdminPage/AdminPage';
...@@ -6,14 +7,18 @@ import AllToucanPage from './view/AllToucanPage/AllToucanPage'; ...@@ -6,14 +7,18 @@ import AllToucanPage from './view/AllToucanPage/AllToucanPage';
import Login from './view/Login'; import Login from './view/Login';
import env from './.env'; import env from './.env';
import isLogged from './utils/Oauth'; import isLogged from './utils/Oauth';
import logo from './image/logo.png'
function App() { function App() {
return ( return (
<div style={{verticalAlign:"center"}}>
<Image src={logo} alt="Logo" href="/" style={{marginLeft:'30%', width:'40%'}} />
<Router > <Router >
<Route exact path='/' component={AllToucanPage} /> <Route exact path='/' component={AllToucanPage} />
<Route exact path='/admin' render={()=>isLogged() ? <AdminPage/> : window.location=`${env.backURL}/oauth/login`}/> <Route exact path='/admin' render={()=>isLogged() ? <AdminPage/> : window.location=`${env.backURL}/oauth/login`}/>
<Route exact path='/login/:token' component={Login} /> <Route exact path='/login/:token' component={Login} />
</Router> </Router>
</div>
); );
} }
......
...@@ -20,7 +20,6 @@ class AllToucan extends Component { ...@@ -20,7 +20,6 @@ class AllToucan extends Component {
}) })
.then(toucans => { .then(toucans => {
this.setState({toucans}) this.setState({toucans})
console.log(toucans)
}) })
.catch(err => console.log(err)) .catch(err => console.log(err))
} }
...@@ -34,6 +33,7 @@ class AllToucan extends Component { ...@@ -34,6 +33,7 @@ class AllToucan extends Component {
link={`${env.backURL}/toucan/pdf/${toucan["_id"]}`} link={`${env.backURL}/toucan/pdf/${toucan["_id"]}`}
header={toucan.title} header={toucan.title}
date={(new Date(toucan.date).toLocaleDateString())} date={(new Date(toucan.date).toLocaleDateString())}
key={toucan._id}
/> />
})} })}
</Card.Group> </Card.Group>
......
...@@ -7,7 +7,6 @@ const ToucanCard = ({...props}) => { ...@@ -7,7 +7,6 @@ const ToucanCard = ({...props}) => {
href={props.link} href={props.link}
link link
style={{margin:"1em"}} style={{margin:"1em"}}
description="On test"
> >
<Card.Content> <Card.Content>
<Card.Header content={props.header}/> <Card.Header content={props.header}/>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment