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:
parent
9b48e0aa53
commit
25184a3901
@ -36,8 +36,9 @@ const HDRestoreVaultScreen = require('./keychains/hd/restore-vault')
|
|||||||
const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation')
|
const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation')
|
||||||
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
||||||
const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns
|
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)
|
module.exports = connect(mapStateToProps, mapDispatchToProps)(App)
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ App.prototype.render = function () {
|
|||||||
}, [
|
}, [
|
||||||
|
|
||||||
// global modal
|
// global modal
|
||||||
this.renderGlobalModal(),
|
h(BuyModal, {}, []),
|
||||||
|
|
||||||
// app bar
|
// app bar
|
||||||
this.renderAppBar(),
|
this.renderAppBar(),
|
||||||
|
27
ui/app/components/modals/buy-modal.js
Normal file
27
ui/app/components/modals/buy-modal.js
Normal 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
|
9
ui/app/components/modals/index.js
Normal file
9
ui/app/components/modals/index.js
Normal 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,
|
||||||
|
}
|
@ -3,9 +3,9 @@ const h = require('react-hyperscript')
|
|||||||
const inherits = require('util').inherits
|
const inherits = require('util').inherits
|
||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const FadeModal = require('boron').FadeModal
|
const FadeModal = require('boron').FadeModal
|
||||||
const actions = require('../actions')
|
const actions = require('../../actions')
|
||||||
const isMobileView = require('../../lib/is-mobile-view')
|
const isMobileView = require('../../../lib/is-mobile-view')
|
||||||
const isPopupOrNotification = require('../../../app/scripts/lib/is-popup-or-notification')
|
const isPopupOrNotification = require('../../../../app/scripts/lib/is-popup-or-notification')
|
||||||
|
|
||||||
function mapStateToProps (state) {
|
function mapStateToProps (state) {
|
||||||
return {
|
return {
|
||||||
@ -21,6 +21,7 @@ function mapDispatchToProps (dispatch) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Global Modal Component
|
||||||
inherits(Modal, Component)
|
inherits(Modal, Component)
|
||||||
function Modal () {
|
function Modal () {
|
||||||
Component.call(this)
|
Component.call(this)
|
Loading…
Reference in New Issue
Block a user