From 233094e19d862014937e8f765fd5961d40fc3fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Iv=C3=A1n=20Cuende?= Date: Tue, 13 Dec 2016 23:38:55 -0800 Subject: [PATCH 1/5] Beautified disclaimer --- ui/app/app.js | 1 - ui/app/css/index.css | 4 +--- ui/app/first-time/disclaimer.js | 20 +++++++++++++------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ui/app/app.js b/ui/app/app.js index 9538a6b93..d870cec4a 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -114,7 +114,6 @@ App.prototype.renderAppBar = function () { alignItems: 'center', visibility: props.isUnlocked ? 'visible' : 'none', background: props.isUnlocked ? 'white' : 'none', - height: '36px', position: 'relative', zIndex: 2, }, diff --git a/ui/app/css/index.css b/ui/app/css/index.css index 975a5289b..cdaac9b37 100644 --- a/ui/app/css/index.css +++ b/ui/app/css/index.css @@ -112,9 +112,7 @@ button.btn-thin { font-size: 13px; } -.app-header { - padding: 6px 8px; -} +.app-header {} .app-header h1 { font-family: 'Montserrat Regular'; diff --git a/ui/app/first-time/disclaimer.js b/ui/app/first-time/disclaimer.js index 819d4a110..ff3d91e7f 100644 --- a/ui/app/first-time/disclaimer.js +++ b/ui/app/first-time/disclaimer.js @@ -29,7 +29,8 @@ DisclaimerScreen.prototype.render = function () { style: { background: '#EBEBEB', color: '#AEAEAE', - marginBottom: 24, + marginTop: 0, + marginBottom: 0, width: '100%', fontSize: '20px', textAlign: 'center', @@ -42,8 +43,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; @@ -75,10 +76,10 @@ DisclaimerScreen.prototype.render = function () { } }, style: { - background: 'rgb(235, 235, 235)', - height: '310px', - padding: '6px', - width: '80%', + background: 'transparent', + height: '415px', + padding: '0 5px', + width: '100%', overflowY: 'scroll', }, }, [ @@ -91,7 +92,12 @@ DisclaimerScreen.prototype.render = function () { ]), h('button', { - style: { marginTop: '18px' }, + style: { + width: '100%', + position: 'absolute', + bottom: 0, + left: 0, + }, disabled, onClick: () => this.props.dispatch(actions.agreeToDisclaimer()), }, disabled ? 'Scroll Down to Enable' : 'I Agree'), From b8ee336f0dd1c0a7d5990ddef22e2d17e09bb1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Iv=C3=A1n=20Cuende?= Date: Tue, 13 Dec 2016 23:46:50 -0800 Subject: [PATCH 2/5] Better buttons --- ui/app/first-time/init-menu.js | 5 ++++- ui/app/keychains/hd/create-vault-complete.js | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ui/app/first-time/init-menu.js b/ui/app/first-time/init-menu.js index c41aecc48..ee0094f36 100644 --- a/ui/app/first-time/init-menu.js +++ b/ui/app/first-time/init-menu.js @@ -114,7 +114,10 @@ InitializeMenuScreen.prototype.renderMenu = function (state) { h('button.primary', { onClick: this.createNewVaultAndKeychain.bind(this), style: { - margin: 12, + position: 'absolute', + left: 0, + bottom: 0, + width: '100%', }, }, 'Create'), diff --git a/ui/app/keychains/hd/create-vault-complete.js b/ui/app/keychains/hd/create-vault-complete.js index 7272ebdbd..ae745430c 100644 --- a/ui/app/keychains/hd/create-vault-complete.js +++ b/ui/app/keychains/hd/create-vault-complete.js @@ -35,7 +35,7 @@ CreateVaultCompleteScreen.prototype.render = function () { style: { background: '#EBEBEB', color: '#AEAEAE', - marginTop: 36, + marginTop: 0, marginBottom: 8, width: '100%', fontSize: '20px', @@ -60,8 +60,10 @@ CreateVaultCompleteScreen.prototype.render = function () { h('button.primary', { onClick: () => this.confirmSeedWords(), style: { - margin: '24px', - fontSize: '0.9em', + position: 'absolute', + left: 0, + bottom: 0, + width: '100%', }, }, 'I\'ve copied it somewhere safe'), ]) From c65db9290dd02b762c0260fe98945f63162f285d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Iv=C3=A1n=20Cuende?= Date: Wed, 14 Dec 2016 09:38:20 -0800 Subject: [PATCH 3/5] Better editable label --- ui/app/account-detail.js | 6 +---- ui/app/components/editable-label.js | 37 +++++------------------------ ui/app/components/identicon.js | 2 +- ui/app/css/index.css | 2 +- ui/app/unlock.js | 8 +++++-- 5 files changed, 15 insertions(+), 40 deletions(-) diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index c41ba61fd..a700df52e 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -70,7 +70,7 @@ AccountDetailScreen.prototype.render = function () { // large identicon and addresses h('.identicon-wrapper.select-none', [ h(Identicon, { - diameter: 62, + diameter: 48, address: selected, }), ]), @@ -82,16 +82,12 @@ AccountDetailScreen.prototype.render = function () { }, [ 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', { diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 41936f5e0..bc0f9a5b2 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -11,40 +11,15 @@ function EditableLabel () { } EditableLabel.prototype.render = function () { - 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() - } + return h('div.name-label', { + contentEditable: true, + style: { outline: 'none' }, + onInput: (event) => this.saveText(), + }, this.props.children) } EditableLabel.prototype.saveText = function () { - var container = findDOMNode(this) - var text = container.querySelector('.editable-label input').value + var text = findDOMNode(this).textContent.trim() var truncatedText = text.substring(0, 20) this.props.saveText(truncatedText) this.setState({ isEditingLabel: false, textLabel: truncatedText }) diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js index 6d4871d02..8211867cb 100644 --- a/ui/app/components/identicon.js +++ b/ui/app/components/identicon.js @@ -12,7 +12,7 @@ inherits(IdenticonComponent, Component) function IdenticonComponent () { Component.call(this) - this.defaultDiameter = 46 + this.defaultDiameter = 32 } IdenticonComponent.prototype.render = function () { diff --git a/ui/app/css/index.css b/ui/app/css/index.css index cdaac9b37..7fba8204e 100644 --- a/ui/app/css/index.css +++ b/ui/app/css/index.css @@ -67,7 +67,7 @@ button.spaced { } button:not([disabled]):hover { - transform: scale(1.1); + transform: scale(1.05); } button:not([disabled]):active { transform: scale(0.95); diff --git a/ui/app/unlock.js b/ui/app/unlock.js index 17416766d..7193a8b2d 100644 --- a/ui/app/unlock.js +++ b/ui/app/unlock.js @@ -63,7 +63,10 @@ UnlockScreen.prototype.render = function () { h('button.primary.cursor-pointer', { onClick: this.onSubmit.bind(this), style: { - margin: 10, + position: 'absolute', + bottom: 0, + left: 0, + width: '100%', }, }, 'Unlock'), ]), @@ -72,11 +75,12 @@ 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'), ]), ]) ) From 4a8bc63c8d8cd4191bbfc0e13077f2356ea7cfbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Iv=C3=A1n=20Cuende?= Date: Wed, 14 Dec 2016 10:03:56 -0800 Subject: [PATCH 4/5] Better account details view --- ui/app/account-detail.js | 38 ++++++--------------------- ui/app/app.js | 8 ------ ui/app/components/editable-label.js | 5 +++- ui/app/components/tooltip.js | 2 +- ui/app/components/transaction-list.js | 3 +-- 5 files changed, 14 insertions(+), 42 deletions(-) diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index a700df52e..d456d125a 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -76,6 +76,7 @@ AccountDetailScreen.prototype.render = function () { ]), h('flex-column', { style: { + width: '100%', lineHeight: '10px', marginLeft: '15px', }, @@ -92,28 +93,20 @@ AccountDetailScreen.prototype.render = function () { ]), h('.flex-row', { style: { - width: '15em', + width: '100%', justifyContent: 'space-between', alignItems: 'baseline', }, }, [ - // address - - h('div', { + // balance + h(EthBalance, { + value: account && account.balance, style: { - overflow: 'hidden', - textOverflow: 'ellipsis', - paddingTop: '3px', - width: '5em', - fontSize: '13px', - fontFamily: 'Montserrat Light', - textRendering: 'geometricPrecision', + lineHeight: '7px', marginTop: '10px', - marginBottom: '15px', - color: '#AEAEAE', }, - }, ethUtil.toChecksumAddress(selected)), + }), // copy and export @@ -167,33 +160,18 @@ AccountDetailScreen.prototype.render = function () { ]), ]), ]), - - // account ballence - ]), ]), h('.flex-row', { style: { - justifyContent: 'space-between', - alignItems: 'flex-start', + justifyContent: 'flex-end', }, }, [ - - 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'), diff --git a/ui/app/app.js b/ui/app/app.js index d870cec4a..ba891f1cf 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -126,14 +126,6 @@ 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, diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index bc0f9a5b2..14c0294a2 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -13,7 +13,10 @@ function EditableLabel () { EditableLabel.prototype.render = function () { return h('div.name-label', { contentEditable: true, - style: { outline: 'none' }, + style: { + outline: 'none', + marginTop: '0.5rem', + }, onInput: (event) => this.saveText(), }, this.props.children) } diff --git a/ui/app/components/tooltip.js b/ui/app/components/tooltip.js index edbc074bb..efab2c497 100644 --- a/ui/app/components/tooltip.js +++ b/ui/app/components/tooltip.js @@ -17,6 +17,6 @@ Tooltip.prototype.render = function () { return h(ReactTooltip, { position: position || 'left', title, - fixed: false, + fixed: true, }, children) } diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js index 7e1bedb05..f6a4ed07e 100644 --- a/ui/app/components/transaction-list.js +++ b/ui/app/components/transaction-list.js @@ -79,10 +79,9 @@ TransactionList.prototype.render = function () { height: '100%', }, }, [ - 'No transaction history.', + 'No transaction history', ]), ]), ]) ) } - From 3969526403c487eb45f8a34774b3267ab126cdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Iv=C3=A1n=20Cuende?= Date: Wed, 14 Dec 2016 14:35:36 -0800 Subject: [PATCH 5/5] Fixed header h1 alignment and network name --- ui/app/app.js | 5 +++-- ui/app/css/index.css | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/app/app.js b/ui/app/app.js index ba891f1cf..7da03cdd1 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -140,8 +140,9 @@ App.prototype.renderAppBar = function () { // metamask name h('h1', { style: { - position: 'relative', - left: '9px', + position: 'absolute', + left: '50%', + transform: 'translateX(-50%)', }, }, 'MetaMask'), diff --git a/ui/app/css/index.css b/ui/app/css/index.css index 7fba8204e..6ce426094 100644 --- a/ui/app/css/index.css +++ b/ui/app/css/index.css @@ -163,9 +163,6 @@ textarea.twelve-word-phrase { } .network-name { - position: absolute; - top: 8px; - left: 60px; width: 5.2em; line-height: 9px; text-rendering: geometricPrecision;