Merge pull request #2639 from alextsg/cb-372

[NewUI] Update font weights to 300, remove animation from network dropdown, f…
feature/default_network_editable
Chi Kei Chan 7 years ago committed by GitHub
commit 8defb365b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      ui/app/components/dropdowns/network-dropdown.js
  2. 14
      ui/app/components/network.js
  3. 6
      ui/app/css/itcss/components/account-menu.scss
  4. 2
      ui/app/css/itcss/components/menu.scss
  5. 2
      ui/app/css/itcss/components/newui-sections.scss

@ -6,6 +6,16 @@ const actions = require('../../actions')
const Dropdown = require('./components/dropdown').Dropdown const Dropdown = require('./components/dropdown').Dropdown
const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem
const NetworkDropdownIcon = require('./components/network-dropdown-icon') const NetworkDropdownIcon = require('./components/network-dropdown-icon')
const R = require('ramda')
// classes from nodes of the toggle element.
const notToggleElementClassnames = [
'menu-icon',
'network-name',
'network-indicator',
'network-caret',
'network-component',
]
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
@ -32,8 +42,8 @@ function mapDispatchToProps (dispatch) {
showConfigPage: () => { showConfigPage: () => {
dispatch(actions.showConfigPage()) dispatch(actions.showConfigPage())
}, },
showNetworkDropdown: () => { dispatch(actions.showNetworkDropdown()) }, showNetworkDropdown: () => dispatch(actions.showNetworkDropdown()),
hideNetworkDropdown: () => { dispatch(actions.hideNetworkDropdown()) }, hideNetworkDropdown: () => dispatch(actions.hideNetworkDropdown()),
} }
} }
@ -59,18 +69,13 @@ NetworkDropdown.prototype.render = function () {
} }
return h(Dropdown, { return h(Dropdown, {
useCssTransition: true,
isOpen, isOpen,
onClickOutside: (event) => { onClickOutside: (event) => {
const { classList } = event.target const { classList } = event.target
const isNotToggleElement = [ const isInClassList = className => classList.contains(className)
classList.contains('menu-icon'), const notToggleElementIndex = R.findIndex(isInClassList)(notToggleElementClassnames)
classList.contains('network-name'),
classList.contains('network-indicator'), if (notToggleElementIndex === -1) {
].filter(bool => bool).length === 0
// classes from three constituent nodes of the toggle element
if (isNotToggleElement) {
this.props.hideNetworkDropdown() this.props.hideNetworkDropdown()
} }
}, },

@ -39,7 +39,7 @@ Network.prototype.render = function () {
}, },
src: 'images/loading.svg', src: 'images/loading.svg',
}), }),
h('i.fa.fa-caret-down'), h('i.fa.fa-caret-down.network-caret'),
]) ])
} else if (providerName === 'mainnet') { } else if (providerName === 'mainnet') {
hoverText = 'Main Ethereum Network' hoverText = 'Main Ethereum Network'
@ -63,7 +63,7 @@ Network.prototype.render = function () {
return ( return (
h('div.network-component.pointer', { h('div.network-component.pointer', {
className: classnames('network-component pointer', { className: classnames({
'network-component--disabled': this.props.disabled, 'network-component--disabled': this.props.disabled,
'ethereum-network': providerName === 'mainnet', 'ethereum-network': providerName === 'mainnet',
'ropsten-test-network': providerName === 'ropsten' || parseInt(networkNumber) === 3, 'ropsten-test-network': providerName === 'ropsten' || parseInt(networkNumber) === 3,
@ -90,7 +90,7 @@ Network.prototype.render = function () {
color: '#039396', color: '#039396',
}}, }},
'Main Network'), 'Main Network'),
h('i.fa.fa-caret-down.fa-lg'), h('i.fa.fa-caret-down.fa-lg.network-caret'),
]) ])
case 'ropsten-test-network': case 'ropsten-test-network':
return h('.network-indicator', [ return h('.network-indicator', [
@ -103,7 +103,7 @@ Network.prototype.render = function () {
color: '#ff6666', color: '#ff6666',
}}, }},
'Ropsten Test Net'), 'Ropsten Test Net'),
h('i.fa.fa-caret-down.fa-lg'), h('i.fa.fa-caret-down.fa-lg.network-caret'),
]) ])
case 'kovan-test-network': case 'kovan-test-network':
return h('.network-indicator', [ return h('.network-indicator', [
@ -116,7 +116,7 @@ Network.prototype.render = function () {
color: '#690496', color: '#690496',
}}, }},
'Kovan Test Net'), 'Kovan Test Net'),
h('i.fa.fa-caret-down.fa-lg'), h('i.fa.fa-caret-down.fa-lg.network-caret'),
]) ])
case 'rinkeby-test-network': case 'rinkeby-test-network':
return h('.network-indicator', [ return h('.network-indicator', [
@ -129,7 +129,7 @@ Network.prototype.render = function () {
color: '#e7a218', color: '#e7a218',
}}, }},
'Rinkeby Test Net'), 'Rinkeby Test Net'),
h('i.fa.fa-caret-down.fa-lg'), h('i.fa.fa-caret-down.fa-lg.network-caret'),
]) ])
default: default:
return h('.network-indicator', [ return h('.network-indicator', [
@ -145,7 +145,7 @@ Network.prototype.render = function () {
color: '#AEAEAE', color: '#AEAEAE',
}}, }},
'Private Network'), 'Private Network'),
h('i.fa.fa-caret-down.fa-lg'), h('i.fa.fa-caret-down.fa-lg.network-caret'),
]) ])
} }
})(), })(),

@ -40,7 +40,7 @@
font-size: 12px; font-size: 12px;
line-height: 23px; line-height: 23px;
padding: 0 24px; padding: 0 24px;
font-weight: 200; font-weight: 300;
} }
img { img {
@ -113,7 +113,7 @@
&__name { &__name {
color: $white; color: $white;
font-size: 18px; font-size: 18px;
font-weight: 200; font-weight: 300;
line-height: 16px; line-height: 16px;
} }
@ -126,7 +126,7 @@
&__action { &__action {
font-size: 16px; font-size: 16px;
line-height: 18px; line-height: 18px;
font-weight: 200; font-weight: 300;
cursor: pointer; cursor: pointer;
} }
} }

@ -11,8 +11,8 @@
flex-flow: row nowrap; flex-flow: row nowrap;
align-items: center; align-items: center;
position: relative; position: relative;
font-weight: 300;
z-index: 201; z-index: 201;
font-weight: 200;
@media screen and (max-width: 575px) { @media screen and (max-width: 575px) {
padding: 14px; padding: 14px;

@ -248,7 +248,7 @@ $wallet-view-bg: $wild-sand;
// wallet view // wallet view
.account-name { .account-name {
font-size: 24px; font-size: 24px;
font-weight: 200; font-weight: 300;
line-height: 20px; line-height: 20px;
color: $scorpion; color: $scorpion;
margin-top: 8px; margin-top: 8px;

Loading…
Cancel
Save