Revert "Interface enhancements"

This commit is contained in:
Dan Finlay 2016-12-16 10:04:57 -08:00 committed by GitHub
parent e6c01abba4
commit 6d13ef691f
11 changed files with 101 additions and 54 deletions

View File

@ -70,43 +70,54 @@ AccountDetailScreen.prototype.render = function () {
// large identicon and addresses
h('.identicon-wrapper.select-none', [
h(Identicon, {
diameter: 48,
diameter: 62,
address: selected,
}),
]),
h('flex-column', {
style: {
width: '100%',
lineHeight: '10px',
marginLeft: '15px',
},
}, [
h(EditableLabel, {
textValue: identity ? identity.name : '',
state: {
isEditingLabel: false,
},
saveText: (text) => {
props.dispatch(actions.saveAccountLabel(selected, text))
},
}, [
// What is shown when not editing + edit text:
h('label.editing-label', [h('.edit-text', 'edit')]),
h('h2.font-medium.color-forest', {name: 'edit'}, identity && identity.name),
]),
h('.flex-row', {
style: {
width: '100%',
width: '15em',
justifyContent: 'space-between',
alignItems: 'baseline',
},
}, [
// balance
h(EthBalance, {
value: account && account.balance,
// address
h('div', {
style: {
lineHeight: '7px',
overflow: 'hidden',
textOverflow: 'ellipsis',
paddingTop: '3px',
width: '5em',
fontSize: '13px',
fontFamily: 'Montserrat Light',
textRendering: 'geometricPrecision',
marginTop: '10px',
marginBottom: '15px',
color: '#AEAEAE',
},
}),
}, ethUtil.toChecksumAddress(selected)),
// copy and export
@ -160,18 +171,33 @@ AccountDetailScreen.prototype.render = function () {
]),
]),
]),
// account ballence
]),
]),
h('.flex-row', {
style: {
justifyContent: 'flex-end',
justifyContent: 'space-between',
alignItems: 'flex-start',
},
}, [
h(EthBalance, {
value: account && account.balance,
style: {
lineHeight: '7px',
marginTop: '10px',
},
}),
h('button', {
onClick: () => props.dispatch(actions.buyEthView(selected)),
style: {
marginBottom: '20px',
marginRight: '8px',
position: 'absolute',
left: '219px',
},
}, 'BUY'),

View File

@ -114,6 +114,7 @@ App.prototype.renderAppBar = function () {
alignItems: 'center',
visibility: props.isUnlocked ? 'visible' : 'none',
background: props.isUnlocked ? 'white' : 'none',
height: '36px',
position: 'relative',
zIndex: 2,
},
@ -126,6 +127,14 @@ App.prototype.renderAppBar = function () {
alignItems: 'center',
},
}, [
// mini logo
h('img', {
height: 24,
width: 24,
src: '/images/icon-128.png',
}),
h(NetworkIndicator, {
network: this.props.network,
provider: this.props.provider,
@ -140,9 +149,8 @@ App.prototype.renderAppBar = function () {
// metamask name
h('h1', {
style: {
position: 'absolute',
left: '50%',
transform: 'translateX(-50%)',
position: 'relative',
left: '9px',
},
}, 'MetaMask'),

View File

@ -11,18 +11,40 @@ function EditableLabel () {
}
EditableLabel.prototype.render = function () {
return h('div.name-label', {
contentEditable: true,
style: {
outline: 'none',
marginTop: '0.5rem',
},
onInput: (event) => this.saveText(),
}, this.props.children)
const props = this.props
const state = this.state
if (state && state.isEditingLabel) {
return h('div.editable-label', [
h('input.sizing-input', {
defaultValue: props.textValue,
maxLength: '20',
onKeyPress: (event) => {
this.saveIfEnter(event)
},
}),
h('button.editable-button', {
onClick: () => this.saveText(),
}, 'Save'),
])
} else {
return h('div.name-label', {
onClick: (event) => {
this.setState({ isEditingLabel: true })
},
}, this.props.children)
}
}
EditableLabel.prototype.saveIfEnter = function (event) {
if (event.key === 'Enter') {
this.saveText()
}
}
EditableLabel.prototype.saveText = function () {
var text = findDOMNode(this).textContent.trim()
var container = findDOMNode(this)
var text = container.querySelector('.editable-label input').value
var truncatedText = text.substring(0, 20)
this.props.saveText(truncatedText)
this.setState({ isEditingLabel: false, textLabel: truncatedText })

View File

@ -12,7 +12,7 @@ inherits(IdenticonComponent, Component)
function IdenticonComponent () {
Component.call(this)
this.defaultDiameter = 32
this.defaultDiameter = 46
}
IdenticonComponent.prototype.render = function () {

View File

@ -17,6 +17,6 @@ Tooltip.prototype.render = function () {
return h(ReactTooltip, {
position: position || 'left',
title,
fixed: true,
fixed: false,
}, children)
}

View File

@ -79,9 +79,10 @@ TransactionList.prototype.render = function () {
height: '100%',
},
}, [
'No transaction history',
'No transaction history.',
]),
]),
])
)
}

View File

@ -67,7 +67,7 @@ button.spaced {
}
button:not([disabled]):hover {
transform: scale(1.05);
transform: scale(1.1);
}
button:not([disabled]):active {
transform: scale(0.95);
@ -112,7 +112,9 @@ button.btn-thin {
font-size: 13px;
}
.app-header {}
.app-header {
padding: 6px 8px;
}
.app-header h1 {
font-family: 'Montserrat Regular';
@ -163,6 +165,9 @@ textarea.twelve-word-phrase {
}
.network-name {
position: absolute;
top: 8px;
left: 60px;
width: 5.2em;
line-height: 9px;
text-rendering: geometricPrecision;

View File

@ -29,8 +29,7 @@ DisclaimerScreen.prototype.render = function () {
style: {
background: '#EBEBEB',
color: '#AEAEAE',
marginTop: 0,
marginBottom: 0,
marginBottom: 24,
width: '100%',
fontSize: '20px',
textAlign: 'center',
@ -43,8 +42,8 @@ DisclaimerScreen.prototype.render = function () {
h('style', `
.markdown {
font-family: Times New Roman;
overflow-x: hidden;
font-weight: lighter;
}
.markdown h1, .markdown h2, .markdown h3 {
margin: 10px 0;
@ -76,10 +75,10 @@ DisclaimerScreen.prototype.render = function () {
}
},
style: {
background: 'transparent',
height: '415px',
padding: '0 5px',
width: '100%',
background: 'rgb(235, 235, 235)',
height: '310px',
padding: '6px',
width: '80%',
overflowY: 'scroll',
},
}, [
@ -92,12 +91,7 @@ DisclaimerScreen.prototype.render = function () {
]),
h('button', {
style: {
width: '100%',
position: 'absolute',
bottom: 0,
left: 0,
},
style: { marginTop: '18px' },
disabled,
onClick: () => this.props.dispatch(actions.agreeToDisclaimer()),
}, disabled ? 'Scroll Down to Enable' : 'I Agree'),

View File

@ -114,10 +114,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
h('button.primary', {
onClick: this.createNewVaultAndKeychain.bind(this),
style: {
position: 'absolute',
left: 0,
bottom: 0,
width: '100%',
margin: 12,
},
}, 'Create'),

View File

@ -35,7 +35,7 @@ CreateVaultCompleteScreen.prototype.render = function () {
style: {
background: '#EBEBEB',
color: '#AEAEAE',
marginTop: 0,
marginTop: 36,
marginBottom: 8,
width: '100%',
fontSize: '20px',
@ -60,10 +60,8 @@ CreateVaultCompleteScreen.prototype.render = function () {
h('button.primary', {
onClick: () => this.confirmSeedWords(),
style: {
position: 'absolute',
left: 0,
bottom: 0,
width: '100%',
margin: '24px',
fontSize: '0.9em',
},
}, 'I\'ve copied it somewhere safe'),
])

View File

@ -63,10 +63,7 @@ UnlockScreen.prototype.render = function () {
h('button.primary.cursor-pointer', {
onClick: this.onSubmit.bind(this),
style: {
position: 'absolute',
bottom: 0,
left: 0,
width: '100%',
margin: 10,
},
}, 'Unlock'),
]),
@ -75,12 +72,11 @@ UnlockScreen.prototype.render = function () {
h('p.pointer', {
onClick: () => this.props.dispatch(actions.goBackToInitView()),
style: {
marginTop: '1rem',
fontSize: '0.8em',
color: 'rgb(247, 134, 28)',
textDecoration: 'underline',
},
}, 'I forgot my password'),
}, 'I forgot my password.'),
]),
])
)