From ee3d0d98e19f1d8177d85af1866fd0ee431fe9ea Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 25 Nov 2018 22:19:15 +0100 Subject: moving stuff --- scraper/client/common/gate.component.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scraper/client/common/gate.component.js (limited to 'scraper/client/common/gate.component.js') diff --git a/scraper/client/common/gate.component.js b/scraper/client/common/gate.component.js new file mode 100644 index 00000000..9bf9287b --- /dev/null +++ b/scraper/client/common/gate.component.js @@ -0,0 +1,21 @@ +import React from 'react' +import { connect } from 'react-redux' + +function Gate(props) { + const { app, tag, View } = props + const data = app[tag] + if (!data) return null + if (data === 'loading') { + return
{tag}{': Loading'}
+ } + if (data.err) { + return
{tag}{' Error: '}{data.err}
+ } + return +} + +const mapStateToProps = state => ({ + app: state.metadata +}) + +export default connect(mapStateToProps)(Gate) -- cgit v1.2.3-70-g09d2