1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Implemt new account layout

This commit is contained in:
Frankie 2016-06-30 12:43:28 -07:00
parent 5252504e3f
commit 42cd0b69e7
6 changed files with 59 additions and 35 deletions

View File

@ -56,7 +56,7 @@ AccountDetailScreen.prototype.render = function () {
// header - identicon + nav // header - identicon + nav
h('div', { h('div', {
style: { style: {
marginTop: 28, marginTop: '15px',
display: 'flex', display: 'flex',
justifyContent: 'flex-start', justifyContent: 'flex-start',
alignItems: 'flex-start', alignItems: 'flex-start',
@ -90,23 +90,32 @@ AccountDetailScreen.prototype.render = function () {
h('label.editing-label', [h('.edit-text', 'edit')]), h('label.editing-label', [h('.edit-text', 'edit')]),
h('h2.font-medium.color-forest', {name: 'edit'}, identity && identity.name), h('h2.font-medium.color-forest', {name: 'edit'}, identity && identity.name),
]), ]),
h('.flex-row',{ h('.flex-row', {
style:{ style: {
width: '15em', width: '15em',
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'baseline', alignItems: 'baseline',
} },
},[ }, [
// address
h('div', { h('div', {
style: { style: {
overflow: 'hidden', overflow: 'hidden',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
paddingTop: '3px', paddingTop: '3px',
width: '5em', width: '5em',
fontSize: 'smaller', fontSize: '13px',
fontFamily: 'Montserrat Thin',
textRendering: 'geometricPrecision',
marginTop: '10px',
marginBottom: '15px',
color: '#AEAEAE',
}, },
}, ethUtil.toChecksumAddress(selected)), }, ethUtil.toChecksumAddress(selected)),
// copy and export
h('.flex-row', { h('.flex-row', {
style: { style: {
@ -132,20 +141,20 @@ AccountDetailScreen.prototype.render = function () {
margin: '0px 5px', margin: '0px 5px',
width: '20px', width: '20px',
height: '20px', height: '20px',
position: 'relative',
top: '3px',
right: '4px',
}, },
}), }),
]), ]),
]), ]),
]), ]),
]), ]),
// account ballence
h('.flex-row', { h('.flex-row', {
style: { style: {
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'flex-start', alignItems: 'flex-start',
} },
}, [ }, [
h(EtherBalance, { h(EtherBalance, {
@ -158,7 +167,8 @@ AccountDetailScreen.prototype.render = function () {
h('button', { h('button', {
onClick: () => props.dispatch(actions.showSendPage()), onClick: () => props.dispatch(actions.showSendPage()),
style: { style: {
margin: 10, marginBottom: '20px',
marginRight: '8px',
}, },
}, 'SEND'), }, 'SEND'),
@ -166,11 +176,6 @@ AccountDetailScreen.prototype.render = function () {
]), ]),
]), ]),
// address and getter actions
// balance + send
]), ]),
// subview (tx history, pk export confirm) // subview (tx history, pk export confirm)

View File

@ -29,19 +29,29 @@ EthBalanceComponent.prototype.render = function () {
) )
} }
EthBalanceComponent.prototype.renderBalance = function (value) { EthBalanceComponent.prototype.renderBalance = function (value) {
if (value === 'None') return value if (value === 'None') return value
var balance = value[0] var balance = value.split(' ')[0]
var label = value[1] var label = value.split(' ')[1]
return ( return (
h('.flex-column',[ h('.flex-column', {
style: {
alignItems: 'flex-end',
lineHeight: '13px',
fontFamily: 'Montserrat Thin',
textRendering: 'geometricPrecision',
},
}, [
h('div', balance), h('div', balance),
h('div', label) h('div', {
style: {
color: ' #AEAEAE',
fontSize: '12px',
},
}, label),
]) ])
) )
} }

View File

@ -35,6 +35,8 @@ TransactionList.prototype.render = function () {
style: { style: {
background: '#EBEBEB', background: '#EBEBEB',
color: '#AEAEAE', color: '#AEAEAE',
paddingTop: '4px',
paddingBottom: '4px',
}, },
}, [ }, [
'Transactions', 'Transactions',
@ -43,7 +45,7 @@ TransactionList.prototype.render = function () {
h('.tx-list', { h('.tx-list', {
style: { style: {
overflowY: 'auto', overflowY: 'auto',
height: '204px', height: '305px',
padding: '0 20px', padding: '0 20px',
textAlign: 'center', textAlign: 'center',
}, },
@ -67,4 +69,3 @@ TransactionList.prototype.render = function () {
]) ])
) )
} }

View File

@ -7,7 +7,7 @@
src: url('/fonts/Montserrat/Montserrat-Regular.ttf') format('truetype'); src: url('/fonts/Montserrat/Montserrat-Regular.ttf') format('truetype');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
font-size: 'small', font-size: 'small';
} }
@ -18,3 +18,10 @@
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@font-face {
font-family: 'Montserrat Thin';
src: url('/fonts/Montserrat/Montserrat-Regular.woff') format('woff');
src: url('/fonts/Montserrat/Montserrat-Regular.ttf') format('truetype');
text-rendering: geometricPrecision;
}

View File

@ -153,6 +153,7 @@ textarea.twelve-word-phrase {
top: 8px; top: 8px;
width: 5.2em; width: 5.2em;
line-height: 9px; line-height: 9px;
text-rendering: geometricPrecision;
} }
.check { .check {
@ -248,7 +249,7 @@ app sections
.sizing-input{ .sizing-input{
font-size: 1em; font-size: 1em;
height: 31px; height: 30px;
} }
.editable-label{ .editable-label{
display: flex; display: flex;
@ -394,12 +395,12 @@ input.large-input {
visibility: hidden; visibility: hidden;
} }
.editing-label { .editing-label {
cursor: text; display: flex;
width: 100%; justify-content: flex-start;
position: relative; margin-left: 50px;
top: 7px; margin-bottom: 2px;
text-align: right; font-size: 11px;
font-size: small; text-rendering: geometricPrecision;
color: #F7861C; color: #F7861C;
} }
.name-label:hover .edit-text { .name-label:hover .edit-text {

View File

@ -105,14 +105,14 @@ function formatBalance (balance, decimalsToKeep) {
if (afterDecimal !== '0') { if (afterDecimal !== '0') {
var sigFigs = afterDecimal.match(/^0*(.{2})/) // default: grabs 2 most significant digits var sigFigs = afterDecimal.match(/^0*(.{2})/) // default: grabs 2 most significant digits
if (sigFigs) { afterDecimal = sigFigs[0] } if (sigFigs) { afterDecimal = sigFigs[0] }
formatted = ['0.' + afterDecimal, ' ETH'] formatted = '0.' + afterDecimal + ' ETH'
} }
} else { } else {
formatted = [beforeDecimal + '.' + afterDecimal.slice(0, 3), ' ETH'] formatted = beforeDecimal + '.' + afterDecimal.slice(0, 3) + ' ETH'
} }
} else { } else {
afterDecimal += Array(decimalsToKeep).join('0') afterDecimal += Array(decimalsToKeep).join('0')
formatted = [beforeDecimal + '.' + afterDecimal.slice(0, decimalsToKeep), ' ETH'] formatted = beforeDecimal + '.' + afterDecimal.slice(0, decimalsToKeep) + ' ETH'
} }
return formatted return formatted
} }