This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
... | |
"relationships": { | |
... | |
"field_image": { | |
"data": { | |
"type": "file--file", | |
"id": "ff50dc33-175e-4b19-ab2a-82220fa7f022", | |
"meta": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"meta": { | |
"derivatives": { | |
"large": "http:\/\/drupal.docker.localhost:8000\/sites\/default\/files\/styles\/large\/public\/2018-01\/generateImage_BPmlnl.png?itok=nZStEnMo", | |
"medium": "http:\/\/drupal.docker.localhost:8000\/sites\/default\/files\/styles\/medium\/public\/2018-01\/generateImage_BPmlnl.png?itok=WgGvC65q", | |
"thumbnail": "http:\/\/drupal.docker.localhost:8000\/sites\/default\/files\/styles\/thumbnail\/public\/2018-01\/generateImage_BPmlnl.png?itok=XoCEVX0q" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple component that render an Article in Full-Mode | |
import React, { Component } from 'react'; | |
import moment from 'moment'; | |
import ImageDerivative from './ImageDerivative'; | |
import './Article.css'; | |
import './ArticleFull.css'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
class ImageDerivative extends React.PureComponent { | |
render() { | |
const { image, derivative } = this.props; | |
const url = image.meta.derivatives[derivative]; | |
return <img src={url} alt={image.filename} />; | |
} | |
} |
OlderNewer