aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsdtsui <szehungdanieltsui@gmail.com>2017-08-14 01:24:51 +0800
committersdtsui <szehungdanieltsui@gmail.com>2017-08-14 01:24:51 +0800
commit25184a3901f96e3c4fea94ed0bd135fbe7597148 (patch)
tree0b489f718fa903f1d68e9f35a60ca8ebec5ca6d0
parent9b48e0aa53ff73fe526c4788c929b0ffe5a2d499 (diff)
downloadtangerine-wallet-browser-25184a3901f96e3c4fea94ed0bd135fbe7597148.tar
tangerine-wallet-browser-25184a3901f96e3c4fea94ed0bd135fbe7597148.tar.gz
tangerine-wallet-browser-25184a3901f96e3c4fea94ed0bd135fbe7597148.tar.bz2
tangerine-wallet-browser-25184a3901f96e3c4fea94ed0bd135fbe7597148.tar.lz
tangerine-wallet-browser-25184a3901f96e3c4fea94ed0bd135fbe7597148.tar.xz
tangerine-wallet-browser-25184a3901f96e3c4fea94ed0bd135fbe7597148.tar.zst
tangerine-wallet-browser-25184a3901f96e3c4fea94ed0bd135fbe7597148.zip
Move global modals into own pod, inside components/modals
-rw-r--r--ui/app/app.js7
-rw-r--r--ui/app/components/modals/buy-modal.js27
-rw-r--r--ui/app/components/modals/index.js9
-rw-r--r--ui/app/components/modals/modal.js (renamed from ui/app/components/modal.js)7
4 files changed, 44 insertions, 6 deletions
diff --git a/ui/app/app.js b/ui/app/app.js
index 3ffa9f0d5..42e67c6db 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -36,8 +36,9 @@ const HDRestoreVaultScreen = require('./keychains/hd/restore-vault')
const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation')
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns
-const Modal = require('./components/modal')
-const BuyOptions = require('./components/buy-options')
+
+// Global Modals
+const BuyModal = require('./components/modals/index').BuyModal
module.exports = connect(mapStateToProps, mapDispatchToProps)(App)
@@ -105,7 +106,7 @@ App.prototype.render = function () {
}, [
// global modal
- this.renderGlobalModal(),
+ h(BuyModal, {}, []),
// app bar
this.renderAppBar(),
diff --git a/ui/app/components/modals/buy-modal.js b/ui/app/components/modals/buy-modal.js
new file mode 100644
index 000000000..c1bf1d0df
--- /dev/null
+++ b/ui/app/components/modals/buy-modal.js
@@ -0,0 +1,27 @@
+const Component = require('react').Component
+const h = require('react-hyperscript')
+const inherits = require('util').inherits
+const connect = require('react-redux').connect
+const FadeModal = require('boron').FadeModal
+const actions = require('../../actions')
+const isMobileView = require('../../../lib/is-mobile-view')
+const isPopupOrNotification = require('../../../../app/scripts/lib/is-popup-or-notification')
+const BuyOptions = require('../buy-options')
+
+inherits(BuyModal, Component)
+function BuyModal () {
+ Component.call(this)
+}
+
+module.exports = BuyModal
+
+BuyModal.prototype.render = function () {
+ return h(BuyModal, {
+ ref: "modalRef",
+ }, [
+ h(BuyOptions, {}, []),
+ ])
+
+}
+
+// TODO: specify default props and proptypes
diff --git a/ui/app/components/modals/index.js b/ui/app/components/modals/index.js
new file mode 100644
index 000000000..23b432b7c
--- /dev/null
+++ b/ui/app/components/modals/index.js
@@ -0,0 +1,9 @@
+const Modal = require('./modal')
+const BuyModal = require('./buy-modal')
+// const h = require('account-options')
+// const h = require('account-details')
+
+module.exports = {
+ Modal,
+ BuyModal,
+} \ No newline at end of file
diff --git a/ui/app/components/modal.js b/ui/app/components/modals/modal.js
index 010122d42..006e009b3 100644
--- a/ui/app/components/modal.js
+++ b/ui/app/components/modals/modal.js
@@ -3,9 +3,9 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const FadeModal = require('boron').FadeModal
-const actions = require('../actions')
-const isMobileView = require('../../lib/is-mobile-view')
-const isPopupOrNotification = require('../../../app/scripts/lib/is-popup-or-notification')
+const actions = require('../../actions')
+const isMobileView = require('../../../lib/is-mobile-view')
+const isPopupOrNotification = require('../../../../app/scripts/lib/is-popup-or-notification')
function mapStateToProps (state) {
return {
@@ -21,6 +21,7 @@ function mapDispatchToProps (dispatch) {
}
}
+// Global Modal Component
inherits(Modal, Component)
function Modal () {
Component.call(this)