From 7767f9f7ad7321d88a0b738d2c272961cc1ce286 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Wed, 2 Aug 2017 13:03:36 -0700 Subject: Hook up responsive sidebar --- ui/app/reducers/app.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 2fcc9bfe0..bf1de4577 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -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 -- cgit From aab0fda9acf58c638a03a43de4260c079adf258f Mon Sep 17 00:00:00 2001 From: sdtsui Date: Tue, 8 Aug 2017 13:37:16 -0700 Subject: Add actions and reducers for global modal --- ui/app/reducers/app.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index bf1de4577..ac8cbf158 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -36,6 +36,7 @@ function reduceApp (state, action) { var appState = extend({ shouldClose: false, menuOpen: false, + modalOpen: false, sidebarOpen: false, currentView: seedWords ? seedConfView : defaultView, accountDetail: { @@ -58,6 +59,17 @@ function reduceApp (state, action) { sidebarOpen: false, }) + // modal methods: + case actions.MODAL_OPEN: + return extend(appState, { + modalOpen: true, + }) + + case actions.MODAL_CLOSE: + return extend(appState, { + modalOpen: false, + }) + // transition methods case actions.TRANSITION_FORWARD: -- cgit From 4cd33453dc14ae9e6a797c16cccb52598904941a Mon Sep 17 00:00:00 2001 From: sdtsui Date: Sun, 13 Aug 2017 22:15:21 +0200 Subject: [WIP] Extract network dropdown into own component --- ui/app/reducers/app.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 878852bf6..3e74fb732 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -38,6 +38,7 @@ function reduceApp (state, action) { menuOpen: false, modalOpen: false, sidebarOpen: false, + networkDropdownOpen: false, currentView: seedWords ? seedConfView : defaultView, accountDetail: { subview: 'transactions', @@ -51,6 +52,17 @@ function reduceApp (state, action) { }, state.appState) switch (action.type) { + // dropdown methods + case actions.NETWORK_DROPDOWN_OPEN: + return extend(appState, { + networkDropdownOpen: true, + }) + + case actions.NETWORK_DROPDOWN_CLOSE: + return extend(appState, { + networkDropdownOpen: false, + }) + // sidebar methods case actions.SIDEBAR_OPEN: return extend(appState, { @@ -74,7 +86,6 @@ function reduceApp (state, action) { }) // transition methods - case actions.TRANSITION_FORWARD: return extend(appState, { transForward: true, -- cgit From 4e9376ca7129611d12a7ec263741f1dee0e4d79c Mon Sep 17 00:00:00 2001 From: sdtsui Date: Sun, 20 Aug 2017 18:32:58 -0700 Subject: Extend modal implementation and state management to accomodate multiple modal types --- ui/app/reducers/app.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 3e74fb732..ea7145f22 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -36,7 +36,12 @@ function reduceApp (state, action) { var appState = extend({ shouldClose: false, menuOpen: false, - modalOpen: false, + modal: { + open: false, + modalState: { + name: null, + }, + }, sidebarOpen: false, networkDropdownOpen: false, currentView: seedWords ? seedConfView : defaultView, @@ -77,12 +82,20 @@ function reduceApp (state, action) { // modal methods: case actions.MODAL_OPEN: return extend(appState, { - modalOpen: true, + modal: Object.assign( + state.appState.modal, + { open: true }, + { modalState: action.payload }, + ), }) case actions.MODAL_CLOSE: return extend(appState, { - modalOpen: false, + modal: Object.assign( + state.appState.modal, + { open: false }, + { modalState: action.payload || state.appState.modal.modalState }, + ), }) // transition methods -- cgit From 8b919758e51e16536b6edaf33d4978d551363249 Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Thu, 7 Sep 2017 04:24:03 -0700 Subject: Send Token screen partial UI --- ui/app/reducers/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index ea7145f22..f444aaf38 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -219,6 +219,16 @@ function reduceApp (state, action) { warning: null, }) + case actions.SHOW_SEND_TOKEN_PAGE: + return extend(appState, { + currentView: { + name: 'sendToken', + context: appState.currentView.context, + }, + transForward: true, + warning: null, + }) + case actions.SHOW_NEW_KEYCHAIN: return extend(appState, { currentView: { -- cgit From aa60944e30b7d1d9680b5ca53e8b61a8edb47904 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 30 Aug 2017 00:08:35 -0230 Subject: Remove default to confirm screen on login. --- ui/app/reducers/app.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index f444aaf38..b2e5543ea 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -14,10 +14,6 @@ function reduceApp (state, action) { if (selectedAddress) { name = 'accountDetail' } - if (hasUnconfActions) { - log.debug('pending txs detected, defaulting to conf-tx view.') - name = 'confTx' - } var defaultView = { name, -- cgit From 6d3b3d42034c88475cd90172ddd97b95f04df60e Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 30 Aug 2017 00:46:30 -0230 Subject: Show confirm transaction screen when clicking a pending transaction in the list. --- ui/app/reducers/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index b2e5543ea..c55ba179f 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -360,7 +360,7 @@ function reduceApp (state, action) { return extend(appState, { currentView: { name: 'confTx', - context: 0, + context: action.id && indexForPending(state, action.id) || 0, }, transForward: action.transForward, warning: null, -- cgit From 3e6b619bd8862d27b18f22ff3645fa96a96b185b Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 6 Sep 2017 09:40:39 -0230 Subject: Use ternary operator instead of two conditionals. --- ui/app/reducers/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index c55ba179f..d8b9d5e8b 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -360,7 +360,7 @@ function reduceApp (state, action) { return extend(appState, { currentView: { name: 'confTx', - context: action.id && indexForPending(state, action.id) || 0, + context: action.id ? indexForPending(state, action.id) : 0, }, transForward: action.transForward, warning: null, -- cgit From e2dc9328fcd227530156727af95a10ca4a68f0fe Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 13 Sep 2017 14:58:07 -0230 Subject: Send user to most recent pending transaction after sending a transaction. --- ui/app/reducers/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index d8b9d5e8b..fbabad0ef 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -176,7 +176,7 @@ function reduceApp (state, action) { transForward: true, }) - case actions.CREATE_NEW_VAULT_IN_PROGRESS: + case actions.CREATE_NEW_VAULT_IN_PROGRESS: return extend(appState, { currentView: { name: 'createVault', @@ -360,7 +360,7 @@ function reduceApp (state, action) { return extend(appState, { currentView: { name: 'confTx', - context: action.id ? indexForPending(state, action.id) : 0, + context: action.id ? indexForPending(state, action.id) : indexForLastPending(state), }, transForward: action.transForward, warning: null, @@ -639,3 +639,7 @@ function indexForPending (state, txId) { const index = unconfTxList.indexOf(match) return index } + +function indexForLastPending (state) { + return getUnconfActionList(state).length +} -- cgit From e1077836ce916e2bd788451e3f365324024a1c0c Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Fri, 22 Sep 2017 14:34:56 -0700 Subject: Add Confirm Send token screen --- ui/app/reducers/app.js | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index fbabad0ef..c64046518 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -380,36 +380,36 @@ function reduceApp (state, action) { case actions.COMPLETED_TX: log.debug('reducing COMPLETED_TX for tx ' + action.value) - const otherUnconfActions = getUnconfActionList(state) - .filter(tx => tx.id !== action.value) - const hasOtherUnconfActions = otherUnconfActions.length > 0 - - if (hasOtherUnconfActions) { - log.debug('reducer detected txs - rendering confTx view') - return extend(appState, { - transForward: false, - currentView: { - name: 'confTx', - context: 0, - }, - warning: null, - }) - } else { - log.debug('attempting to close popup') - return extend(appState, { - // indicate notification should close - shouldClose: true, - transForward: false, - warning: null, - currentView: { - name: 'accountDetail', - context: state.metamask.selectedAddress, - }, - accountDetail: { - subview: 'transactions', - }, - }) - } + // const otherUnconfActions = getUnconfActionList(state) + // .filter(tx => tx.id !== action.value) + // const hasOtherUnconfActions = otherUnconfActions.length > 0 + + // if (hasOtherUnconfActions) { + // log.debug('reducer detected txs - rendering confTx view') + // return extend(appState, { + // transForward: false, + // currentView: { + // name: 'confTx', + // context: 0, + // }, + // warning: null, + // }) + // } else { + log.debug('attempting to close popup') + return extend(appState, { + // indicate notification should close + shouldClose: true, + transForward: false, + warning: null, + currentView: { + name: 'accountDetail', + context: state.metamask.selectedAddress, + }, + accountDetail: { + subview: 'transactions', + }, + }) + // } case actions.NEXT_TX: return extend(appState, { -- cgit From 25c2865076784f3e5346f7e34cbf80b9fe210ade Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 26 Sep 2017 21:33:36 -0230 Subject: Restore notification functionality --- ui/app/reducers/app.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index c64046518..6d805521b 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -15,6 +15,11 @@ function reduceApp (state, action) { name = 'accountDetail' } + if (hasUnconfActions) { + log.debug('pending txs detected, defaulting to conf-tx view.') + name = 'confTx' + } + var defaultView = { name, detailView: null, -- cgit From 01816e1b2216e0cf849ec3d67f01b1e571d69fa4 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 22 Sep 2017 17:27:18 -0230 Subject: Adds a back button to export private key modal; connects account details to same modal. --- ui/app/reducers/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ui/app/reducers/app.js') diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 6d805521b..4f10d9857 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -42,6 +42,9 @@ function reduceApp (state, action) { modalState: { name: null, }, + previousModalState: { + name: null, + } }, sidebarOpen: false, networkDropdownOpen: false, @@ -87,6 +90,7 @@ function reduceApp (state, action) { state.appState.modal, { open: true }, { modalState: action.payload }, + { previousModalState: appState.modal.modalState}, ), }) @@ -95,7 +99,8 @@ function reduceApp (state, action) { modal: Object.assign( state.appState.modal, { open: false }, - { modalState: action.payload || state.appState.modal.modalState }, + { modalState: { name: null } }, + { previousModalState: appState.modal.modalState}, ), }) -- cgit