1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Merge branch 'eyeballs' into MenuDroppo

This commit is contained in:
Dan Finlay 2016-05-18 12:30:31 -07:00
commit 79e595754f
5 changed files with 177 additions and 84 deletions

View File

@ -126,6 +126,9 @@ AccountDetailScreen.prototype.render = function() {
h('button', { h('button', {
onClick: () => this.props.dispatch(actions.showSendPage()), onClick: () => this.props.dispatch(actions.showSendPage()),
style: {
margin: 10,
},
}, 'SEND ETH'), }, 'SEND ETH'),
]), ]),

View File

@ -21,7 +21,7 @@ html, body {
background: #F7F7F7; background: #F7F7F7;
} }
input:focus { input:focus, textarea:focus {
outline: none; outline: none;
} }
@ -36,7 +36,7 @@ button {
font-family: 'Transat Black'; font-family: 'Transat Black';
outline: none; outline: none;
cursor: pointer; cursor: pointer;
margin: 10px; /*margin: 10px;*/
padding: 8px 12px; padding: 8px 12px;
border: none; border: none;
background: #F7861C; background: #F7861C;
@ -52,16 +52,6 @@ button:active {
transform: scale(0.95); transform: scale(0.95);
} }
/*input, textarea {
width: 300px;
padding: 6px;
border-radius: 6px;
border-style: solid;
outline: none;
border: 1px solid #F5A623;
background: #FAF6F0;
}*/
a { a {
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;
@ -80,7 +70,6 @@ app
} }
button.primary { button.primary {
margin: 10px;
padding: 8px 12px; padding: 8px 12px;
background: #F7861C; background: #F7861C;
box-shadow: 0px 3px 6px rgba(247, 134, 28, 0.36); box-shadow: 0px 3px 6px rgba(247, 134, 28, 0.36);
@ -234,32 +223,43 @@ app sections
.unlock-screen input[type=password] { .unlock-screen input[type=password] {
width: 260px; width: 260px;
height: 36px; /*height: 36px;
margin-bottom: 24px; margin-bottom: 24px;
padding: 8px; padding: 8px;*/
} }
/* Webkit */ /* Webkit */
.password-box::-webkit-input-placeholder { .unlock-screen input::-webkit-input-placeholder {
text-align: center; text-align: center;
font-size: 1.2em; font-size: 1.2em;
} }
/* Firefox 18- */ /* Firefox 18- */
.password-box:-moz-placeholder { .unlock-screen input:-moz-placeholder {
text-align: center; text-align: center;
font-size: 1.2em; font-size: 1.2em;
} }
/* Firefox 19+ */ /* Firefox 19+ */
.password-box::-moz-placeholder { .unlock-screen input::-moz-placeholder {
text-align: center; text-align: center;
font-size: 1.2em; font-size: 1.2em;
} }
/* IE */ /* IE */
.password-box:-ms-input-placeholder { .unlock-screen input:-ms-input-placeholder {
text-align: center; text-align: center;
font-size: 1.2em; font-size: 1.2em;
} }
input.large-input, textarea.large-input {
/*margin-bottom: 24px;*/
padding: 8px;
}
input.large-input {
height: 36px;
}
/* accounts */ /* accounts */
.accounts-section { .accounts-section {
@ -369,3 +369,19 @@ app sections
background: #FAF6F0; background: #FAF6F0;
} }
/* Send Screen */
.send-screen {
}
.send-screen section {
margin: 8px 16px;
}
.send-screen input {
width: 100%;
font-size: 12px;
letter-spacing: 0.1em;
}

View File

@ -151,23 +151,6 @@
font-size: 1.2em; font-size: 1.2em;
} }
/* Send Screen */
.send-screen {
margin: 0 20px;
}
.send-screen section {
margin: 7px;
display: flex;
flex-direction: row;
justify-content: center;
}
.send-screen details {
width: 100%;
}
.send-screen section input {
width: 100%;
}
hr.horizontal-line { hr.horizontal-line {
display: block; display: block;
height: 1px; height: 1px;

View File

@ -2,9 +2,12 @@ const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('react-redux').connect const connect = require('react-redux').connect
const Identicon = require('./components/identicon')
const actions = require('./actions') const actions = require('./actions')
const util = require('./util') const util = require('./util')
const numericBalance = require('./util').numericBalance const numericBalance = require('./util').numericBalance
const formatBalance = require('./util').formatBalance
const addressSummary = require('./util').addressSummary
const AccountPanel = require('./components/account-panel') const AccountPanel = require('./components/account-panel')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
@ -32,78 +35,163 @@ function SendTransactionScreen() {
SendTransactionScreen.prototype.render = function() { SendTransactionScreen.prototype.render = function() {
var state = this.props var state = this.props
var address = state.address
var account = state.account var account = state.account
var identity = state.identity var identity = state.identity
return ( return (
h('.send-screen.flex-column.flex-grow', [ h('.send-screen.flex-column.flex-grow', [
// subtitle and nav //
h('.section-title.flex-row.flex-center', [ // Sender Profile
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', { //
h('.account-data-subsection.flex-column.flex-grow', {
style: {
margin: '0 20px',
},
}, [
// header - identicon + nav
h('.flex-row.flex-space-between', {
style: {
marginTop: 28,
},
}, [
// invisible placeholder for later
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer.color-orange', {
onClick: this.back.bind(this), onClick: this.back.bind(this),
}), }),
h('h2.page-subtitle', 'Send Transaction'),
// large identicon
h('.identicon-wrapper.flex-column.flex-center.select-none', [
h(Identicon, {
diameter: 62,
address: address,
}),
]), ]),
h(AccountPanel, { // small accounts nav
showFullAddress: true, h('i.fa.fa-users.fa-lg.cursor-pointer.color-orange', {
identity: identity, onClick: this.navigateToAccounts.bind(this),
account: account,
}), }),
h('section.recipient', [ ]),
h('input.address', {
// account label
h('h2.font-medium.color-forest.flex-center', {
style: {
paddingTop: 8,
marginBottom: 8,
},
}, identity && identity.name),
// address and getter actions
h('.flex-row.flex-center', {
style: {
marginBottom: 8,
},
}, [
h('div', {
style: {
lineHeight: '16px',
},
}, addressSummary(address)),
]),
// balance
h('.flex-row.flex-center', [
h('div', formatBalance(account && account.balance)),
]),
]),
//
// Required Fields
//
h('h3.flex-center.text-transform-uppercase', {
style: {
background: '#EBEBEB',
color: '#AEAEAE',
marginTop: 32,
marginBottom: 16,
},
}, [
'Send Transaction',
]),
// 'to' field
h('section.flex-row.flex-center', [
h('input.address.large-input', {
placeholder: 'Recipient Address', placeholder: 'Recipient Address',
}) })
]), ]),
h('section.ammount', [ // 'amount' and send button
h('input.ether', { h('section.flex-row.flex-center', [
h('input.ether.large-input', {
placeholder: 'Amount', placeholder: 'Amount',
type: 'number', type: 'number',
style: { marginRight: '6px' } style: {
marginRight: 6,
},
}), }),
h('select.currency', {
name: 'currency', h('button.primary', {
}, [ onClick: this.onSubmit.bind(this),
h('option', { value: 'ether' }, 'Ether (1e18 wei)'), style: {
h('option', { value: 'wei' }, 'Wei'), textTransform: 'uppercase',
]), },
}, 'Send')
]), ]),
h('section.data', [ //
h('details', [ // Optional Fields
h('summary', { //
h('h3.flex-center.text-transform-uppercase', {
style: { style: {
cursor: 'pointer', background: '#EBEBEB',
outline: 'none', color: '#AEAEAE',
marginTop: 16,
marginBottom: 16,
}, },
}, 'Advanced'), }, [
h('textarea.txData', { 'Tranasactional Data (optional)',
type: 'textarea', ]),
placeholder: 'Transaction data (optional)',
// 'data' field
h('section.flex-row.flex-center', [
h('input.txData.large-input', {
placeholder: '0x01234',
style: { style: {
height: '100px',
width: '100%', width: '100%',
resize: 'none', resize: 'none',
} }
}) }),
])
]), ]),
h('section', { // state.warning ? h('span.error', state.warning.split('.')[0]) : null,
}, [
h('button', {
onClick: this.onSubmit.bind(this),
}, 'Send')
]),
state.warning ? h('span.error', state.warning.split('.')[0]) : null,
]) ])
) )
} }
SendTransactionScreen.prototype.navigateToAccounts = function(event){
event.stopPropagation()
this.props.dispatch(actions.showAccountsPage())
}
SendTransactionScreen.prototype.back = function() { SendTransactionScreen.prototype.back = function() {
var address = this.props.address var address = this.props.address
this.props.dispatch(actions.backToAccountDetail(address)) this.props.dispatch(actions.backToAccountDetail(address))

View File

@ -41,7 +41,7 @@ UnlockScreen.prototype.render = function() {
}, },
}, 'MetaMask'), }, 'MetaMask'),
h('input.password-box', { h('input.large-input', {
type: 'password', type: 'password',
id: 'password-box', id: 'password-box',
placeholder: 'enter password', placeholder: 'enter password',
@ -60,6 +60,9 @@ UnlockScreen.prototype.render = function() {
h('button.primary.cursor-pointer', { h('button.primary.cursor-pointer', {
onClick: this.onSubmit.bind(this), onClick: this.onSubmit.bind(this),
style: {
margin: 10,
},
}, 'Unlock'), }, 'Unlock'),
]) ])