Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Damien Armillon
API Toucan
Commits
6c4b82d4
Commit
6c4b82d4
authored
May 17, 2019
by
Damien
Browse files
Add cards for the Toucan
parent
a42abc45
Changes
2
Hide whitespace changes
Inline
Side-by-side
front/src/view/AllToucanPage/AllToucanPage.js
View file @
6c4b82d4
import
React
,
{
Component
}
from
'
react
'
import
{
Card
}
from
'
semantic-ui-react
'
import
{
Card
,
Segment
}
from
'
semantic-ui-react
'
import
ToucanCard
from
'
./ToucanCard
'
import
env
from
'
../../.env
'
...
...
@@ -26,15 +26,18 @@ class AllToucan extends Component {
}
render
(){
return
(
<
Segment
style
=
{{
margin
:
"
3em
"
,
padding
:
"
2em
"
}}
>
<
Card
.
Group
>
{
this
.
state
.
toucans
.
map
(
toucan
=>
{
return
<
ToucanCard
image
=
{
`
${
env
.
backURL
}
/toucan/img/
${
toucan
[
"
_id
"
]}
`
}
link
=
{
`
${
env
.
backURL
}
/toucan/pdf/
${
toucan
[
"
_id
"
]}
`
}
header
=
{
toucan
.
title
}
date
=
{(
new
Date
(
toucan
.
date
).
toLocaleDateString
())}
/
>
})}
<
/Card.Group
>
<
/Segment
>
)}
}
...
...
front/src/view/AllToucanPage/ToucanCard.js
View file @
6c4b82d4
...
...
@@ -3,14 +3,18 @@ import {Card, Image} from 'semantic-ui-react'
const
ToucanCard
=
({...
props
})
=>
{
return
(
<
Card
href
=
{
props
.
link
}
>
<
Image
src
=
{
props
.
image
}
size
=
"
small
"
/>
<
Card
.
Content
>
<
Card
.
Header
content
=
"
HDNZIDJZEP
"
/>
<
/Card.Content
>
<
/Card
>
<
Card
href
=
{
props
.
link
}
link
style
=
{{
margin
:
"
1em
"
}}
description
=
"
On test
"
>
<
Card
.
Content
>
<
Card
.
Header
content
=
{
props
.
header
}
/
>
<
Card
.
Meta
content
=
{
props
.
date
}
textAlign
=
"
right
"
/>
<
/Card.Content
>
<
Image
src
=
{
props
.
image
}
/
>
<
/Card
>
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment