-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from eea/article_list
Added ArticleList
- Loading branch information
Showing
7 changed files
with
289 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"extends": "./node_modules/@plone/volto/.eslintrc", | ||
"settings": { | ||
"import/resolver": { | ||
"alias": { | ||
"map": [ | ||
[ | ||
"@plone/volto", | ||
"@plone/volto/src" | ||
], | ||
[ | ||
"@package", | ||
"./src" | ||
], | ||
[ | ||
"~", | ||
"./src" | ||
], | ||
[ | ||
"volto-mosaic", | ||
"./src/develop/volto-mosaic/src" | ||
], | ||
[ | ||
"volto-datablocks", | ||
"./src/develop/volto-datablocks/src" | ||
], | ||
[ | ||
"volto-addons", | ||
"./src/develop/volto-addons/src" | ||
], | ||
[ | ||
"volto-ckeditor", | ||
"./src/develop/volto-ckeditor/src" | ||
], | ||
[ | ||
"volto-blocks", | ||
"./src/develop/volto-blocks/src" | ||
], | ||
[ | ||
"volto-drafteditor", | ||
"./src/develop/volto-drafteditor/src" | ||
], | ||
[ | ||
"volto-base", | ||
"./src/develop/volto-base/src" | ||
], | ||
[ | ||
"volto-plotlycharts", | ||
"./src/develop/volto-plotlycharts/src" | ||
], | ||
[ | ||
"volto-embed", | ||
"./src/develop/volto-embed/src" | ||
], | ||
[ | ||
"volto-sidebar", | ||
"./src/develop/volto-sidebar/src" | ||
] | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import React, { Component } from 'react'; | ||
import { injectIntl } from 'react-intl'; | ||
import PropTypes from 'prop-types'; | ||
import articles from './articles.json' | ||
import { Grid} from 'semantic-ui-react'; | ||
|
||
const items = articles.items | ||
|
||
class Edit extends Component { | ||
/** | ||
* Property types. | ||
* @property {Object} propTypes Property types. | ||
* @static | ||
*/ | ||
static propTypes = { | ||
selected: PropTypes.bool.isRequired, | ||
block: PropTypes.string.isRequired, | ||
index: PropTypes.number.isRequired, | ||
data: PropTypes.objectOf(PropTypes.any).isRequired, | ||
pathname: PropTypes.string.isRequired, | ||
onChangeBlock: PropTypes.func.isRequired, | ||
onSelectBlock: PropTypes.func.isRequired, | ||
onDeleteBlock: PropTypes.func.isRequired, | ||
onFocusPreviousBlock: PropTypes.func.isRequired, | ||
onFocusNextBlock: PropTypes.func.isRequired, | ||
}; | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
list: items | ||
}; | ||
} | ||
|
||
|
||
componentDidMount() { | ||
this.onChangeData() | ||
} | ||
|
||
onChangeData() { | ||
this.props.onChangeBlock(this.props.block, { | ||
...this.props.data, | ||
list: this.state.list, | ||
}); | ||
} | ||
|
||
|
||
|
||
|
||
render() { | ||
return ( | ||
<Grid columns={1}> | ||
<Grid.Column> | ||
{items && | ||
items.map(item => | ||
<div className="article-list-row"> | ||
<img className="article-img" src={item.imgUrl} /> | ||
<Grid.Column> | ||
<p className="article-title"> | ||
{item.title}</p> | ||
<p class="article-date">{item.date}</p> | ||
<p className="article-description">{item.description}</p> | ||
<a className="read-article" target="_blank" href={item.url}> | ||
READ ARTICLE | ||
</a> | ||
</Grid.Column> | ||
</div>) | ||
} | ||
</Grid.Column> | ||
</Grid> | ||
); | ||
} | ||
} | ||
|
||
export default injectIntl(Edit); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Edit map block. | ||
* @module components/manage/Blocks/Maps/Edit | ||
*/ | ||
|
||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { injectIntl } from 'react-intl'; | ||
import { Grid } from 'semantic-ui-react'; | ||
|
||
class View extends Component { | ||
/** | ||
* Property types. | ||
* @property {Object} propTypes Property types. | ||
* @static | ||
*/ | ||
static propTypes = { | ||
data: PropTypes.objectOf(PropTypes.any).isRequired, | ||
// pathname: PropTypes.string.isRequired, | ||
}; | ||
|
||
render() { | ||
return ( | ||
<Grid columns={1}> | ||
<Grid.Column> | ||
{this.props.data.list && | ||
this.props.data.list.map(item => | ||
<div className="article-list-row"> | ||
<img className="article-img" src={item.imgUrl} /> | ||
<Grid.Column> | ||
<p className="article-title"> | ||
{item.title}</p> | ||
<p class="article-date">{item.date}</p> | ||
<p className="article-description">{item.description}</p> | ||
<a className="read-article" target="_blank" href={item.url}> | ||
READ ARTICLE | ||
</a> | ||
</Grid.Column> | ||
</div>) | ||
} | ||
</Grid.Column> | ||
</Grid> | ||
); | ||
} | ||
} | ||
|
||
export default injectIntl(View); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"items": [ | ||
{ | ||
"id": 0, | ||
"title": "title no 1", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum", | ||
"date": "3.9.2019", | ||
"imgUrl": "https://readreidread.files.wordpress.com/2011/09/yellow_tree1.jpg?w=998&h=624", | ||
"url": "http://google.com" | ||
}, | ||
{ | ||
"id": 1, | ||
"title": "title no 2", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", | ||
"date": "5.10.2019", | ||
"imgUrl": "https://www.mountainphotographer.com/wp-content/uploads/2010/11/201011_freiburgYellowTree.jpg", | ||
"url": "http://google.com" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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