mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Integrate slideout menu with tx view
This commit is contained in:
parent
7767f9f7ad
commit
dfa10763e3
@ -8,6 +8,8 @@ var actions = {
|
|||||||
// sidebar state
|
// sidebar state
|
||||||
SIDEBAR_OPEN: 'UI_SIDEBAR_OPEN',
|
SIDEBAR_OPEN: 'UI_SIDEBAR_OPEN',
|
||||||
SIDEBAR_CLOSE: 'UI_SIDEBAR_CLOSE',
|
SIDEBAR_CLOSE: 'UI_SIDEBAR_CLOSE',
|
||||||
|
showSidebar: showSidebar,
|
||||||
|
hideSidebar: hideSidebar,
|
||||||
// menu state
|
// menu state
|
||||||
getNetworkStatus: 'getNetworkStatus',
|
getNetworkStatus: 'getNetworkStatus',
|
||||||
// transition state
|
// transition state
|
||||||
@ -763,6 +765,19 @@ function useEtherscanProvider () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showSidebar () {
|
||||||
|
return {
|
||||||
|
type: actions.SIDEBAR_OPEN,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideSidebar () {
|
||||||
|
return {
|
||||||
|
type: actions.SIDEBAR_CLOSE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function showLoadingIndication (message) {
|
function showLoadingIndication (message) {
|
||||||
return {
|
return {
|
||||||
type: actions.SHOW_LOADING,
|
type: actions.SHOW_LOADING,
|
||||||
|
@ -39,6 +39,7 @@ function App () { Component.call(this) }
|
|||||||
function mapStateToProps (state) {
|
function mapStateToProps (state) {
|
||||||
return {
|
return {
|
||||||
// state from plugin
|
// state from plugin
|
||||||
|
sidebarOpen: state.appState.sidebarOpen,
|
||||||
isLoading: state.appState.isLoading,
|
isLoading: state.appState.isLoading,
|
||||||
loadingMessage: state.appState.loadingMessage,
|
loadingMessage: state.appState.loadingMessage,
|
||||||
noActiveNotices: state.metamask.noActiveNotices,
|
noActiveNotices: state.metamask.noActiveNotices,
|
||||||
|
@ -2,17 +2,29 @@ const Component = require('react').Component
|
|||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const inherits = require('util').inherits
|
const inherits = require('util').inherits
|
||||||
|
const actions = require('../actions')
|
||||||
|
// slideout menu
|
||||||
|
const SlideoutMenu = require('react-burger-menu').slide
|
||||||
|
const WalletView = require('./wallet-view')
|
||||||
|
|
||||||
// const Identicon = require('./identicon')
|
// const Identicon = require('./identicon')
|
||||||
// const AccountDropdowns = require('./account-dropdowns').AccountDropdowns
|
// const AccountDropdowns = require('./account-dropdowns').AccountDropdowns
|
||||||
// const Content = require('./wallet-content-display')
|
// const Content = require('./wallet-content-display')
|
||||||
|
|
||||||
module.exports = connect()(TxView)
|
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxView)
|
||||||
|
|
||||||
// function mapStateToProps (state) {
|
function mapStateToProps (state) {
|
||||||
// return {
|
return {
|
||||||
// network: state.metamask.network,
|
sidebarOpen: state.appState.sidebarOpen,
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
function mapDispatchToProps (dispatch) {
|
||||||
|
return {
|
||||||
|
showSidebar: () => {dispatch(actions.showSidebar())},
|
||||||
|
hideSidebar: () => {dispatch(actions.hideSidebar())},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const contentDivider = h('div', {
|
const contentDivider = h('div', {
|
||||||
style: {
|
style: {
|
||||||
@ -40,9 +52,19 @@ TxView.prototype.render = function () {
|
|||||||
background: '#FFFFFF',
|
background: '#FFFFFF',
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
|
// slideout - move to separate render func
|
||||||
|
h(SlideoutMenu, {
|
||||||
|
isOpen: this.props.sidebarOpen,
|
||||||
|
}, [
|
||||||
|
h(WalletView, {
|
||||||
|
responsiveDisplayClassname: '.phone-visible'
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
|
||||||
h('div.phone-visible.fa.fa-bars', {
|
h('div.phone-visible.fa.fa-bars', {
|
||||||
|
onClick: () => {
|
||||||
|
this.props.sidebarOpen ? this.props.hideSidebar() : this.props.showSidebar()
|
||||||
|
}
|
||||||
}, []),
|
}, []),
|
||||||
|
|
||||||
h('div.flex-row', {
|
h('div.flex-row', {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
const Component = require('react').Component
|
const Component = require('react').Component
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const inherits = require('util').inherits
|
const inherits = require('util').inherits
|
||||||
const WalletView = require('./components/wallet-view')
|
|
||||||
const TxView = require('./components/tx-view')
|
const TxView = require('./components/tx-view')
|
||||||
|
const WalletView = require('./components/wallet-view')
|
||||||
const SlideoutMenu = require('react-burger-menu').slide
|
const SlideoutMenu = require('react-burger-menu').slide
|
||||||
|
|
||||||
module.exports = MainContainer
|
module.exports = MainContainer
|
||||||
@ -29,14 +29,6 @@ MainContainer.prototype.render = function () {
|
|||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
|
|
||||||
h(SlideoutMenu, {
|
|
||||||
isOpen: true,
|
|
||||||
}, [
|
|
||||||
h(WalletView, {
|
|
||||||
responsiveDisplayClassname: '.phone-visible'
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
|
|
||||||
h(WalletView, {
|
h(WalletView, {
|
||||||
style: {
|
style: {
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user