aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-19 03:30:03 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-19 03:30:03 +0800
commitd18d9a8f97216afae4a6c9d8d659952ed5cba765 (patch)
treef4622bd27a49bf8feaacf633ecb69ff5e9f4fdf7 /ui/app
parent06557d7900b77a80eaa7e305d55182a6d0c10db5 (diff)
downloadtangerine-wallet-browser-d18d9a8f97216afae4a6c9d8d659952ed5cba765.tar
tangerine-wallet-browser-d18d9a8f97216afae4a6c9d8d659952ed5cba765.tar.gz
tangerine-wallet-browser-d18d9a8f97216afae4a6c9d8d659952ed5cba765.tar.bz2
tangerine-wallet-browser-d18d9a8f97216afae4a6c9d8d659952ed5cba765.tar.lz
tangerine-wallet-browser-d18d9a8f97216afae4a6c9d8d659952ed5cba765.tar.xz
tangerine-wallet-browser-d18d9a8f97216afae4a6c9d8d659952ed5cba765.tar.zst
tangerine-wallet-browser-d18d9a8f97216afae4a6c9d8d659952ed5cba765.zip
Add animated sandwich button
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/actions.js11
-rw-r--r--ui/app/app.js14
-rw-r--r--ui/app/reducers/app.js6
3 files changed, 28 insertions, 3 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index f489eede7..c08019d9c 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -1,6 +1,9 @@
var actions = {
GO_HOME: 'GO_HOME',
goHome: goHome,
+ // menu state
+ TOGGLE_MENU: 'TOGGLE_MENU',
+ toggleMenu: toggleMenu,
// remote state
UPDATE_METAMASK_STATE: 'UPDATE_METAMASK_STATE',
updateMetamaskState: updateMetamaskState,
@@ -105,6 +108,14 @@ function goHome() {
}
}
+// menu state
+
+function toggleMenu() {
+ return {
+ type: this.TOGGLE_MENU,
+ }
+}
+
// async actions
function tryUnlockMetamask(password) {
diff --git a/ui/app/app.js b/ui/app/app.js
index 68d34e52f..ec869145e 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -24,6 +24,8 @@ const ConfigScreen = require('./config')
const InfoScreen = require('./info')
const LoadingIndicator = require('./loading')
const txHelper = require('../lib/tx-helper')
+const SandwichExpando = require('sandwich-expando')
+const MenuDroppo = require('menu-droppo')
module.exports = connect(mapStateToProps)(App)
@@ -42,6 +44,7 @@ function mapStateToProps(state) {
seedWords: state.metamask.seedWords,
unconfTxs: state.metamask.unconfTxs,
unconfMsgs: state.metamask.unconfMsgs,
+ menuOpen: state.appState.menuOpen,
}
}
@@ -143,12 +146,17 @@ App.prototype.renderAppBar = function(){
src: '/images/icon-128.png',
}),
- // metamask name
+ // metamask namlterChangese
h('h1', 'MetaMask'),
// hamburger
- h('i.fa.fa-bars.cursor-pointer.color-orange', {
- onClick: (event) => state.dispatch(actions.showConfigPage()),
+ h(SandwichExpando, {
+ width: 16,
+ barHeight: 2,
+ padding: 0,
+ isOpen: state.menuOpen,
+ color: 'rgb(247,146,30)',
+ onClick: () => this.props.dispatch(actions.toggleMenu()),
}),
])
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 0e0740c9d..a7429c8fb 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -22,6 +22,7 @@ function reduceApp(state, action) {
var seedWords = state.metamask.seedWords
var appState = extend({
+ menuOpen: false,
currentView: seedWords ? seedConfView : defaultView,
accountDetail: {
subview: 'transactions',
@@ -34,6 +35,11 @@ function reduceApp(state, action) {
switch (action.type) {
+ case actions.TOGGLE_MENU:
+ return extend(appState, {
+ menuOpen: !appState.menuOpen,
+ })
+
// intialize
case actions.SHOW_CREATE_VAULT: