mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
New Account modal
This commit is contained in:
parent
5ee6e4d3b3
commit
085551b7e6
@ -37,6 +37,7 @@ AccountImportSubview.prototype.render = function () {
|
|||||||
h('div.flex-center', {
|
h('div.flex-center', {
|
||||||
style: {
|
style: {
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
|
marginTop: '32px',
|
||||||
},
|
},
|
||||||
}, [
|
}, [
|
||||||
h('.section-title.flex-row.flex-center', [
|
h('.section-title.flex-row.flex-center', [
|
||||||
|
@ -23,20 +23,50 @@ function mapStateToProps (state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// identities, accounts, selected, menuItemStyles, actions, keyrings
|
|
||||||
|
|
||||||
function mapDispatchToProps (dispatch) {
|
function mapDispatchToProps (dispatch) {
|
||||||
return {
|
return {
|
||||||
toggleAccountMenu: () => dispatch(actions.toggleAccountMenu()),
|
toggleAccountMenu: () => dispatch(actions.toggleAccountMenu()),
|
||||||
|
showAccountDetail: address => {
|
||||||
|
dispatch(actions.showAccountDetail(address))
|
||||||
|
dispatch(actions.toggleAccountMenu())
|
||||||
|
},
|
||||||
|
lockMetamask: () => {
|
||||||
|
dispatch(actions.lockMetamask())
|
||||||
|
dispatch(actions.toggleAccountMenu())
|
||||||
|
},
|
||||||
|
showConfigPage: () => {
|
||||||
|
console.log('hihihih')
|
||||||
|
dispatch(actions.showConfigPage())
|
||||||
|
dispatch(actions.toggleAccountMenu())
|
||||||
|
},
|
||||||
|
showNewAccountModal: () => {
|
||||||
|
dispatch(actions.showModal({ name: 'NEW_ACCOUNT' }))
|
||||||
|
dispatch(actions.toggleAccountMenu())
|
||||||
|
},
|
||||||
|
showImportPage: () => {
|
||||||
|
dispatch(actions.showImportPage())
|
||||||
|
dispatch(actions.toggleAccountMenu())
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountMenu.prototype.render = function () {
|
AccountMenu.prototype.render = function () {
|
||||||
const { isAccountMenuOpen, toggleAccountMenu } = this.props
|
const {
|
||||||
|
isAccountMenuOpen,
|
||||||
|
toggleAccountMenu,
|
||||||
|
showNewAccountModal,
|
||||||
|
showImportPage,
|
||||||
|
lockMetamask,
|
||||||
|
showConfigPage,
|
||||||
|
} = this.props
|
||||||
|
|
||||||
|
console.log(showConfigPage)
|
||||||
return h(Menu, { className: 'account-menu', isShowing: isAccountMenuOpen }, [
|
return h(Menu, { className: 'account-menu', isShowing: isAccountMenuOpen }, [
|
||||||
h(CloseArea, { onClick: toggleAccountMenu }),
|
h(CloseArea, { onClick: toggleAccountMenu }),
|
||||||
h(Item, { className: 'account-menu__header' }, [
|
h(Item, {
|
||||||
|
className: 'account-menu__header',
|
||||||
|
onClick: lockMetamask,
|
||||||
|
}, [
|
||||||
'My Accounts',
|
'My Accounts',
|
||||||
h('button.account-menu__logout-button', 'Log out'),
|
h('button.account-menu__logout-button', 'Log out'),
|
||||||
]),
|
]),
|
||||||
@ -44,23 +74,22 @@ AccountMenu.prototype.render = function () {
|
|||||||
h('div.account-menu__accounts', this.renderAccounts()),
|
h('div.account-menu__accounts', this.renderAccounts()),
|
||||||
h(Divider),
|
h(Divider),
|
||||||
h(Item, {
|
h(Item, {
|
||||||
onClick: true,
|
onClick: showNewAccountModal,
|
||||||
icon: h('img', { src: 'images/plus-btn-white.svg' }),
|
icon: h('img', { src: 'images/plus-btn-white.svg' }),
|
||||||
text: 'Create Account',
|
text: 'Create Account',
|
||||||
}),
|
}),
|
||||||
h(Item, {
|
h(Item, {
|
||||||
onClick: true,
|
onClick: showImportPage,
|
||||||
icon: h('img', { src: 'images/import-account.svg' }),
|
icon: h('img', { src: 'images/import-account.svg' }),
|
||||||
text: 'Import Account',
|
text: 'Import Account',
|
||||||
}),
|
}),
|
||||||
h(Divider),
|
h(Divider),
|
||||||
h(Item, {
|
h(Item, {
|
||||||
onClick: true,
|
|
||||||
icon: h('img', { src: 'images/mm-info-icon.svg' }),
|
icon: h('img', { src: 'images/mm-info-icon.svg' }),
|
||||||
text: 'Info & Help',
|
text: 'Info & Help',
|
||||||
}),
|
}),
|
||||||
h(Item, {
|
h(Item, {
|
||||||
onClick: true,
|
onClick: showConfigPage,
|
||||||
icon: h('img', { src: 'images/settings.svg' }),
|
icon: h('img', { src: 'images/settings.svg' }),
|
||||||
text: 'Settings',
|
text: 'Settings',
|
||||||
}),
|
}),
|
||||||
@ -68,7 +97,13 @@ AccountMenu.prototype.render = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AccountMenu.prototype.renderAccounts = function () {
|
AccountMenu.prototype.renderAccounts = function () {
|
||||||
const { identities, accounts, selected, actions, keyrings } = this.props
|
const {
|
||||||
|
identities,
|
||||||
|
accounts,
|
||||||
|
selected,
|
||||||
|
keyrings,
|
||||||
|
showAccountDetail,
|
||||||
|
} = this.props
|
||||||
|
|
||||||
return Object.keys(identities).map((key, index) => {
|
return Object.keys(identities).map((key, index) => {
|
||||||
const identity = identities[key]
|
const identity = identities[key]
|
||||||
@ -84,12 +119,8 @@ AccountMenu.prototype.renderAccounts = function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return h(
|
return h(
|
||||||
'div.account-menu__account',
|
'div.account-menu__account.menu__item--clickable',
|
||||||
{
|
{ onClick: () => showAccountDetail(identity.address) },
|
||||||
onClick: () => {
|
|
||||||
this.props.actions.showAccountDetail(identity.address)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
[
|
[
|
||||||
h('div.account-menu__check-mark', [
|
h('div.account-menu__check-mark', [
|
||||||
isSelected ? h('i.fa.fa-check') : null,
|
isSelected ? h('i.fa.fa-check') : null,
|
||||||
@ -104,44 +135,11 @@ AccountMenu.prototype.renderAccounts = function () {
|
|||||||
),
|
),
|
||||||
|
|
||||||
h('div.account-menu__account-info', [
|
h('div.account-menu__account-info', [
|
||||||
|
h('div.account-menu__name', identity.name || ''),
|
||||||
this.indicateIfLoose(keyring),
|
|
||||||
|
|
||||||
h('div.account-menu__name', {
|
|
||||||
style: {
|
|
||||||
fontSize: '18px',
|
|
||||||
maxWidth: '145px',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
overflow: 'hidden',
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
},
|
|
||||||
}, identity.name || ''),
|
|
||||||
|
|
||||||
h('div.account-menu__balance', formattedBalance),
|
h('div.account-menu__balance', formattedBalance),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
h('div.account-menu__action', {
|
this.indicateIfLoose(keyring),
|
||||||
onClick: () => {
|
|
||||||
actions.showEditAccountModal(identity)
|
|
||||||
},
|
|
||||||
}, 'Edit'),
|
|
||||||
|
|
||||||
// =======
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// this.indicateIfLoose(keyring),
|
|
||||||
// h('span', {
|
|
||||||
// style: {
|
|
||||||
// marginLeft: '20px',
|
|
||||||
// fontSize: '24px',
|
|
||||||
// maxWidth: '145px',
|
|
||||||
// whiteSpace: 'nowrap',
|
|
||||||
// overflow: 'hidden',
|
|
||||||
// textOverflow: 'ellipsis',
|
|
||||||
// },
|
|
||||||
// }, identity.name || ''),
|
|
||||||
// h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, isSelected ? h('.check', '✓') : null),
|
|
||||||
// >>>>>>> master:ui/app/components/account-dropdowns.js
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -28,8 +28,8 @@ Item.prototype.render = function () {
|
|||||||
const textComponent = text ? h('div.menu__item__text', text) : null
|
const textComponent = text ? h('div.menu__item__text', text) : null
|
||||||
|
|
||||||
return children
|
return children
|
||||||
? h('div', { className: itemClassName }, children)
|
? h('div', { className: itemClassName, onClick }, children)
|
||||||
: h('div.menu__item', { className: itemClassName }, [ iconComponent, textComponent ]
|
: h('div.menu__item', { className: itemClassName, onClick }, [ iconComponent, textComponent ]
|
||||||
.filter(d => Boolean(d))
|
.filter(d => Boolean(d))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ ConfigScreen.prototype.render = function () {
|
|||||||
var warning = state.warning
|
var warning = state.warning
|
||||||
|
|
||||||
return (
|
return (
|
||||||
h('.flex-column.flex-grow', [
|
h('.flex-column.flex-grow', { style: { marginTop: '32px' } }, [
|
||||||
|
|
||||||
// subtitle and nav
|
// subtitle and nav
|
||||||
h('.section-title.flex-row.flex-center', [
|
h('.section-title.flex-row.flex-center', [
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
|
font-weight: 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
@ -50,8 +51,68 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
height: 272px;
|
max-height: 240px;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 575px) {
|
||||||
|
max-height: 215px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyring-label {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__account {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
padding: 16px 14px;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
|
||||||
|
@media screen and (max-width: 575px) {
|
||||||
|
padding: 12px 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__account-info {
|
||||||
|
flex: 1 0 auto;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__check-mark {
|
||||||
|
width: 14px;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.identicon {
|
||||||
|
margin: 0 12px 0 0;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__name {
|
||||||
|
color: $white;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 200;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__balance {
|
||||||
|
color: $dusty-gray;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__action {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 18px;
|
||||||
|
font-weight: 200;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
top: 0;
|
top: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
height: calc(100vh - 41px - 100px);
|
height: calc(100vh - 58px - 100px);
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,10 @@
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #22232c; // $shark
|
color: #22232c; // $shark
|
||||||
|
|
||||||
|
@media screen and (max-width: 575px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h2.page-subtitle {
|
h2.page-subtitle {
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
|
|
||||||
|
@media screen and (max-width: 575px) {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
&--clickable {
|
&--clickable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
border: 1px solid $shark;
|
border: 1px solid $shark;
|
||||||
border-radius: 82px;
|
border-radius: 82px;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
|
||||||
&.ethereum-network {
|
&.ethereum-network {
|
||||||
border-color: rgb(3, 135, 137);
|
border-color: rgb(3, 135, 137);
|
||||||
|
@ -231,17 +231,15 @@ hr.horizontal-line {
|
|||||||
|
|
||||||
.keyring-label {
|
.keyring-label {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
font-size: 11px;
|
font-size: 8px;
|
||||||
background: rgba(255, 0, 0, .8);
|
line-height: 8px;
|
||||||
bottom: -47px;
|
background: rgba(255, 255, 255, 0.4);
|
||||||
color: $white;
|
color: #fff;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
height: 20px;
|
|
||||||
min-width: 20px;
|
|
||||||
position: absolute;
|
|
||||||
top: 0px;
|
|
||||||
right: 5px;
|
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
width: 41px;
|
||||||
|
text-align: center;
|
||||||
|
height: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ether-balance {
|
.ether-balance {
|
||||||
|
Loading…
Reference in New Issue
Block a user