Hook up responsive sidebar

feature/default_network_editable
sdtsui 7 years ago
parent 96d3b2f35f
commit 7767f9f7ad
  1. 3
      ui/app/actions.js
  2. 4
      ui/app/components/wallet-view.js
  3. 12
      ui/app/main-container.js
  4. 11
      ui/app/reducers/app.js

@ -5,6 +5,9 @@ var actions = {
GO_HOME: 'GO_HOME',
goHome: goHome,
// sidebar state
SIDEBAR_OPEN: 'UI_SIDEBAR_OPEN',
SIDEBAR_CLOSE: 'UI_SIDEBAR_CLOSE',
// menu state
getNetworkStatus: 'getNetworkStatus',
// transition state

@ -31,9 +31,9 @@ const noop = () => {}
WalletView.prototype.render = function () {
const selected = '0x82df11beb942BEeeD58d466fCb0F0791365C7684'
const { network } = this.props
const { network, responsiveDisplayClassname } = this.props
return h('div.wallet-view.flex-column.lap-visible', {
return h('div.wallet-view.flex-column' + (responsiveDisplayClassname || ''), {
style: {
// width: '33.333%',
flexGrow: 1,

@ -3,6 +3,7 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const WalletView = require('./components/wallet-view')
const TxView = require('./components/tx-view')
const SlideoutMenu = require('react-burger-menu').slide
module.exports = MainContainer
@ -28,9 +29,18 @@ MainContainer.prototype.render = function () {
}
}, [
h(SlideoutMenu, {
isOpen: true,
}, [
h(WalletView, {
responsiveDisplayClassname: '.phone-visible'
}),
]),
h(WalletView, {
style: {
}
},
responsiveDisplayClassname: '.lap-visible',
}, [
]),

@ -36,6 +36,7 @@ function reduceApp (state, action) {
var appState = extend({
shouldClose: false,
menuOpen: false,
sidebarOpen: false,
currentView: seedWords ? seedConfView : defaultView,
accountDetail: {
subview: 'transactions',
@ -46,6 +47,16 @@ function reduceApp (state, action) {
}, state.appState)
switch (action.type) {
// sidebar methods
case actions.SIDEBAR_OPEN:
return extend(appState, {
sidebarOpen: true,
})
case actions.SIDEBAR_CLOSE:
return extend(appState, {
sidebarOpen: false,
})
// transition methods

Loading…
Cancel
Save