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

Add images

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