mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add "import account" menu item + template view
This commit is contained in:
parent
1f2840a7be
commit
77bd010543
@ -32,11 +32,13 @@ var actions = {
|
|||||||
SHOW_INIT_MENU: 'SHOW_INIT_MENU',
|
SHOW_INIT_MENU: 'SHOW_INIT_MENU',
|
||||||
SHOW_NEW_VAULT_SEED: 'SHOW_NEW_VAULT_SEED',
|
SHOW_NEW_VAULT_SEED: 'SHOW_NEW_VAULT_SEED',
|
||||||
SHOW_INFO_PAGE: 'SHOW_INFO_PAGE',
|
SHOW_INFO_PAGE: 'SHOW_INFO_PAGE',
|
||||||
|
SHOW_IMPORT_PAGE: 'SHOW_IMPORT_PAGE',
|
||||||
unlockMetamask: unlockMetamask,
|
unlockMetamask: unlockMetamask,
|
||||||
unlockFailed: unlockFailed,
|
unlockFailed: unlockFailed,
|
||||||
showCreateVault: showCreateVault,
|
showCreateVault: showCreateVault,
|
||||||
showRestoreVault: showRestoreVault,
|
showRestoreVault: showRestoreVault,
|
||||||
showInitializeMenu: showInitializeMenu,
|
showInitializeMenu: showInitializeMenu,
|
||||||
|
showImportPage,
|
||||||
createNewVaultAndKeychain: createNewVaultAndKeychain,
|
createNewVaultAndKeychain: createNewVaultAndKeychain,
|
||||||
createNewVaultAndRestore: createNewVaultAndRestore,
|
createNewVaultAndRestore: createNewVaultAndRestore,
|
||||||
createNewVaultInProgress: createNewVaultInProgress,
|
createNewVaultInProgress: createNewVaultInProgress,
|
||||||
@ -376,6 +378,12 @@ function showInitializeMenu () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showImportPage () {
|
||||||
|
return {
|
||||||
|
type: actions.SHOW_IMPORT_PAGE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function agreeToDisclaimer () {
|
function agreeToDisclaimer () {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(this.showLoadingIndication())
|
dispatch(this.showLoadingIndication())
|
||||||
|
@ -20,6 +20,7 @@ const NoticeScreen = require('./components/notice')
|
|||||||
const generateLostAccountsNotice = require('../lib/lost-accounts-notice')
|
const generateLostAccountsNotice = require('../lib/lost-accounts-notice')
|
||||||
// other views
|
// other views
|
||||||
const ConfigScreen = require('./config')
|
const ConfigScreen = require('./config')
|
||||||
|
const Import = require('./import')
|
||||||
const InfoScreen = require('./info')
|
const InfoScreen = require('./info')
|
||||||
const LoadingIndicator = require('./components/loading')
|
const LoadingIndicator = require('./components/loading')
|
||||||
const SandwichExpando = require('sandwich-expando')
|
const SandwichExpando = require('sandwich-expando')
|
||||||
@ -304,6 +305,13 @@ App.prototype.renderDropdown = function () {
|
|||||||
icon: h('i.fa.fa-gear.fa-lg'),
|
icon: h('i.fa.fa-gear.fa-lg'),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
h(DropMenuItem, {
|
||||||
|
label: 'Import Account',
|
||||||
|
closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }),
|
||||||
|
action: () => this.props.dispatch(actions.showImportPage()),
|
||||||
|
icon: h('i.fa.fa-arrow-circle-o-up.fa-lg'),
|
||||||
|
}),
|
||||||
|
|
||||||
h(DropMenuItem, {
|
h(DropMenuItem, {
|
||||||
label: 'Lock',
|
label: 'Lock',
|
||||||
closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }),
|
closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }),
|
||||||
@ -411,6 +419,9 @@ App.prototype.renderPrimary = function () {
|
|||||||
case 'config':
|
case 'config':
|
||||||
return h(ConfigScreen, {key: 'config'})
|
return h(ConfigScreen, {key: 'config'})
|
||||||
|
|
||||||
|
case 'import-menu':
|
||||||
|
return h(Import, {key: 'import-menu'})
|
||||||
|
|
||||||
case 'reveal-seed-conf':
|
case 'reveal-seed-conf':
|
||||||
return h(RevealSeedConfirmation, {key: 'reveal-seed-conf'})
|
return h(RevealSeedConfirmation, {key: 'reveal-seed-conf'})
|
||||||
|
|
||||||
|
36
ui/app/import/index.js
Normal file
36
ui/app/import/index.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
const inherits = require('util').inherits
|
||||||
|
const Component = require('react').Component
|
||||||
|
const h = require('react-hyperscript')
|
||||||
|
const connect = require('react-redux').connect
|
||||||
|
|
||||||
|
module.exports = connect(mapStateToProps)(ImportIndex)
|
||||||
|
|
||||||
|
function mapStateToProps (state) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
|
inherits(ImportIndex, Component)
|
||||||
|
function ImportIndex () {
|
||||||
|
Component.call(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
ImportIndex.prototype.render = function () {
|
||||||
|
const props = this.props
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
h('.accounts-section.flex-grow', [
|
||||||
|
|
||||||
|
// subtitle and nav
|
||||||
|
h('.section-title.flex-center', [
|
||||||
|
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', {
|
||||||
|
onClick: this.goHome.bind(this),
|
||||||
|
}),
|
||||||
|
h('h2.page-subtitle', 'Select Account'),
|
||||||
|
]),
|
||||||
|
|
||||||
|
])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -99,6 +99,14 @@ function reduceApp (state, action) {
|
|||||||
transForward: action.value,
|
transForward: action.value,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
case actions.SHOW_IMPORT_PAGE:
|
||||||
|
return extend(appState, {
|
||||||
|
currentView: {
|
||||||
|
name: 'import-menu',
|
||||||
|
},
|
||||||
|
transForward: true,
|
||||||
|
})
|
||||||
|
|
||||||
case actions.SHOW_INFO_PAGE:
|
case actions.SHOW_INFO_PAGE:
|
||||||
return extend(appState, {
|
return extend(appState, {
|
||||||
currentView: {
|
currentView: {
|
||||||
|
Loading…
Reference in New Issue
Block a user