aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui/app/components/loading.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2017-12-23 03:00:46 +0800
committerAlexander Tseung <alextsg@gmail.com>2017-12-23 03:00:46 +0800
commit06410381d4b738fe22aa24973c7f9568d295f570 (patch)
tree69bd8701cdaa417cb6c0f46deff43414122101db /old-ui/app/components/loading.js
parent06f496310ce7d719bbb5690f307db143ba57a1a7 (diff)
parenta218008adf85dfb5fa8ca93c789e14d9f2090813 (diff)
downloadtangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.gz
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.zst
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.zip
Merge branch 'NewUI-flat' into merge-master
Diffstat (limited to 'old-ui/app/components/loading.js')
-rw-r--r--old-ui/app/components/loading.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/old-ui/app/components/loading.js b/old-ui/app/components/loading.js
new file mode 100644
index 000000000..163792584
--- /dev/null
+++ b/old-ui/app/components/loading.js
@@ -0,0 +1,45 @@
+const inherits = require('util').inherits
+const Component = require('react').Component
+const h = require('react-hyperscript')
+
+
+inherits(LoadingIndicator, Component)
+module.exports = LoadingIndicator
+
+function LoadingIndicator () {
+ Component.call(this)
+}
+
+LoadingIndicator.prototype.render = function () {
+ const { isLoading, loadingMessage } = this.props
+
+ return (
+ isLoading ? h('.full-flex-height', {
+ style: {
+ left: '0px',
+ zIndex: 10,
+ position: 'absolute',
+ flexDirection: 'column',
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ height: '100%',
+ width: '100%',
+ background: 'rgba(255, 255, 255, 0.8)',
+ },
+ }, [
+ h('img', {
+ src: 'images/loading.svg',
+ }),
+
+ h('br'),
+
+ showMessageIfAny(loadingMessage),
+ ]) : null
+ )
+}
+
+function showMessageIfAny (loadingMessage) {
+ if (!loadingMessage) return null
+ return h('span', loadingMessage)
+}