Update NewsFeed to use statusFeed url
parent
b031dd5a78
commit
c2f0af7e37
|
@ -44,34 +44,32 @@ class NewsFeed extends Component {
|
||||||
|
|
||||||
// TODO: implement interval polling a la AutoRefresh
|
// TODO: implement interval polling a la AutoRefresh
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const {source, fetchJSONFeed} = this.props
|
const {statusFeedURL, fetchJSONFeed} = this.props
|
||||||
|
|
||||||
fetchJSONFeed(source.links.status)
|
fetchJSONFeed(statusFeedURL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const {bool, func, shape, string} = PropTypes
|
const {bool, func, shape, string} = PropTypes
|
||||||
|
|
||||||
NewsFeed.propTypes = {
|
NewsFeed.propTypes = {
|
||||||
source: shape({
|
|
||||||
links: shape({
|
|
||||||
status: string.isRequired,
|
|
||||||
}).isRequired,
|
|
||||||
}).isRequired,
|
|
||||||
hasCompletedFetchOnce: bool.isRequired,
|
hasCompletedFetchOnce: bool.isRequired,
|
||||||
isFetching: bool.isRequired,
|
isFetching: bool.isRequired,
|
||||||
isFailed: bool.isRequired,
|
isFailed: bool.isRequired,
|
||||||
data: shape(),
|
data: shape(),
|
||||||
fetchJSONFeed: func.isRequired,
|
fetchJSONFeed: func.isRequired,
|
||||||
|
statusFeedURL: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = ({
|
const mapStateToProps = ({
|
||||||
|
links: {external: {statusFeed: statusFeedURL}},
|
||||||
JSONFeed: {hasCompletedFetchOnce, isFetching, isFailed, data},
|
JSONFeed: {hasCompletedFetchOnce, isFetching, isFailed, data},
|
||||||
}) => ({
|
}) => ({
|
||||||
hasCompletedFetchOnce,
|
hasCompletedFetchOnce,
|
||||||
isFetching,
|
isFetching,
|
||||||
isFailed,
|
isFailed,
|
||||||
data,
|
data,
|
||||||
|
statusFeedURL,
|
||||||
})
|
})
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
|
|
Loading…
Reference in New Issue