aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/loading.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-04-14 06:28:44 +0800
committerDan Finlay <dan@danfinlay.com>2016-04-14 06:28:44 +0800
commitd814a45dffa6a872f6e336cad33ca41ffb102887 (patch)
treed8cdd0c4b8c6559efaf6846b24f0d6440f3c94f5 /ui/app/loading.js
parent9f1438b85b3dac8f1dd98f7bd6e101035cfce0a5 (diff)
downloadtangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.gz
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.bz2
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.lz
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.xz
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.zst
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.zip
Moved UI into repo with its own dependency stack
Diffstat (limited to 'ui/app/loading.js')
-rw-r--r--ui/app/loading.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/ui/app/loading.js b/ui/app/loading.js
new file mode 100644
index 000000000..47b758cb6
--- /dev/null
+++ b/ui/app/loading.js
@@ -0,0 +1,51 @@
+const inherits = require('util').inherits
+const Component = require('react').Component
+const h = require('react-hyperscript')
+const connect = require('react-redux').connect
+const actions = require('./actions')
+const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
+
+module.exports = connect(mapStateToProps)(LoadingIndicator)
+
+function mapStateToProps(state) {
+ return {
+ isLoading: state.appState.isLoading,
+ }
+}
+
+inherits(LoadingIndicator, Component)
+function LoadingIndicator() {
+ Component.call(this)
+}
+
+LoadingIndicator.prototype.render = function() {
+ console.dir(this.props)
+ var isLoading = this.props.isLoading
+
+ return (
+ h(ReactCSSTransitionGroup, {
+ transitionName: "loader",
+ transitionEnterTimeout: 150,
+ transitionLeaveTimeout: 150,
+ }, [
+
+ isLoading ? h('div', {
+ style: {
+ position: 'absolute',
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ height: '100%',
+ width: '100%',
+ background: 'rgba(255, 255, 255, 0.5)',
+ }
+ }, [
+ h('img', {
+ src: 'images/loading.svg',
+ }),
+ ]) : null,
+
+ ])
+ )
+}
+