1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Move global modals into own pod, inside components/modals

This commit is contained in:
sdtsui 2017-08-13 10:24:51 -07:00
parent 9b48e0aa53
commit 25184a3901
4 changed files with 44 additions and 6 deletions

View File

@ -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(),

View File

@ -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

View File

@ -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,
}

View File

@ -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)