From 3c0b02ffe61faf1320cdd75957560424d7579b33 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 18 Oct 2016 16:44:09 +0200 Subject: [PATCH] Apply UI PRs after master merge (#2690) --- js/src/index.js | 3 +- js/src/ui/Modal/modal.css | 4 +- js/src/views/Connection/connection.css | 3 +- .../views/Settings/Background/background.js | 4 +- js/src/views/Settings/Proxy/index.js | 17 +++++++ js/src/views/Settings/Proxy/proxy.css | 24 +++++++++ js/src/views/Settings/Proxy/proxy.js | 46 +++++++++++++++++ js/src/views/Settings/index.js | 2 + js/src/views/Settings/layout.css | 15 ++++++ js/src/views/Settings/settings.css | 1 + js/src/views/Settings/settings.js | 16 ++++++ .../TransactionPendingFormReject.js | 49 +------------------ .../Signer/components/constants/constants.js | 5 -- js/src/views/index.js | 3 +- 14 files changed, 132 insertions(+), 60 deletions(-) create mode 100644 js/src/views/Settings/Proxy/index.js create mode 100644 js/src/views/Settings/Proxy/proxy.css create mode 100644 js/src/views/Settings/Proxy/proxy.js diff --git a/js/src/index.js b/js/src/index.js index f432251d0..db173a07f 100644 --- a/js/src/index.js +++ b/js/src/index.js @@ -37,7 +37,7 @@ import ContractInstances from './contracts'; import { initStore } from './redux'; import { ContextProvider, muiTheme } from './ui'; -import { Accounts, Account, Addresses, Address, Application, Contract, Contracts, Dapp, Dapps, Settings, SettingsBackground, SettingsViews, Signer, Status } from './views'; +import { Accounts, Account, Addresses, Address, Application, Contract, Contracts, Dapp, Dapps, Settings, SettingsBackground, SettingsProxy, SettingsViews, Signer, Status } from './views'; import './environment'; @@ -79,6 +79,7 @@ ReactDOM.render( + diff --git a/js/src/ui/Modal/modal.css b/js/src/ui/Modal/modal.css index 8361d4d96..b50e8cb9a 100644 --- a/js/src/ui/Modal/modal.css +++ b/js/src/ui/Modal/modal.css @@ -35,13 +35,11 @@ .content { transform: translate(0px, 0px) !important; + transition: none !important; } .content>div { background: rgba(0, 0, 0, 0.5) !important; -} - -.content div { transition: none !important; } diff --git a/js/src/views/Connection/connection.css b/js/src/views/Connection/connection.css index db147c0a2..968902bfa 100644 --- a/js/src/views/Connection/connection.css +++ b/js/src/views/Connection/connection.css @@ -88,8 +88,9 @@ } .console { - font-family: 'Roboto Mono'; + font-family: 'Roboto Mono', monospace; background: rgba(0, 0, 0, 0.25); + font-size: 16px; padding: 0 0.25em; } diff --git a/js/src/views/Settings/Background/background.js b/js/src/views/Settings/Background/background.js index d7c750581..e86c007e6 100644 --- a/js/src/views/Settings/Background/background.js +++ b/js/src/views/Settings/Background/background.js @@ -57,8 +57,8 @@ class Background extends Component {
-

The background pattern you can see right now is unique to your Parity installation. It will change every time you create a new Signer token. This is so that decentralized applications cannot pretend to be trustworthy.

-

Pick a pattern you like and memorize it. This Pattern will always be shown from now on, unless you clear your browser's cache or use a new Signer token.

+
The background pattern you can see right now is unique to your Parity installation. It will change every time you create a new Signer token. This is so that decentralized applications cannot pretend to be trustworthy.
+
Pick a pattern you like and memorize it. This Pattern will always be shown from now on, unless you clear your browser cache or use a new Signer token.
diff --git a/js/src/views/Settings/Proxy/index.js b/js/src/views/Settings/Proxy/index.js new file mode 100644 index 000000000..5d65ef153 --- /dev/null +++ b/js/src/views/Settings/Proxy/index.js @@ -0,0 +1,17 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +export default from './proxy'; diff --git a/js/src/views/Settings/Proxy/proxy.css b/js/src/views/Settings/Proxy/proxy.css new file mode 100644 index 000000000..0e8d84630 --- /dev/null +++ b/js/src/views/Settings/Proxy/proxy.css @@ -0,0 +1,24 @@ +/* Copyright 2015, 2016 Ethcore (UK) Ltd. +/* This file is part of Parity. +/* +/* Parity is free software: you can redistribute it and/or modify +/* it under the terms of the GNU General Public License as published by +/* the Free Software Foundation, either version 3 of the License, or +/* (at your option) any later version. +/* +/* Parity is distributed in the hope that it will be useful, +/* but WITHOUT ANY WARRANTY; without even the implied warranty of +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/* GNU General Public License for more details. +/* +/* You should have received a copy of the GNU General Public License +/* along with Parity. If not, see . +*/ + +.details { + line-height: 1.5em; +} + +.details div+div { + padding-top: 1.25em; +} diff --git a/js/src/views/Settings/Proxy/proxy.js b/js/src/views/Settings/Proxy/proxy.js new file mode 100644 index 000000000..8c68a8cfe --- /dev/null +++ b/js/src/views/Settings/Proxy/proxy.js @@ -0,0 +1,46 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +import React, { Component } from 'react'; + +import { Container, ContainerTitle } from '../../../ui'; + +import layout from '../layout.css'; +import styles from './proxy.css'; + +export default class Proxy extends Component { + render () { + const proxyurl = 'http://127.0.0.1:8080/proxy/proxy.pac'; + + return ( + + +
+
+
The proxy setup allows you to access Parity and all associated decentralized applications via memororable addresses.
+
+
+
+
Instead of accessing Parity via the IP address and port, you will be able to access it via the .parity subdomain, by visiting http://home.parity/. To setup subdomain-based routing, you need to add the relevant proxy entries to your browser,
+ +
To learn how to configure the proxy, instructions are provided for Windows, Max OS X or Ubuntu.
+
+
+
+
+ ); + } +} diff --git a/js/src/views/Settings/index.js b/js/src/views/Settings/index.js index d61c877ee..6971db224 100644 --- a/js/src/views/Settings/index.js +++ b/js/src/views/Settings/index.js @@ -17,12 +17,14 @@ import settingsReducer from './reducers'; import { toggleView, updateBackground } from './actions'; import SettingsBackground from './Background'; +import SettingsProxy from './Proxy'; import SettingsViews, { defaultViews } from './Views'; export default from './settings'; export { SettingsBackground, + SettingsProxy, SettingsViews, defaultViews, settingsReducer, diff --git a/js/src/views/Settings/layout.css b/js/src/views/Settings/layout.css index d8d953f90..9554973ce 100644 --- a/js/src/views/Settings/layout.css +++ b/js/src/views/Settings/layout.css @@ -41,6 +41,10 @@ opacity: 0.5; } +.overview div { + line-height: 1.5em; +} + .overview>div+div { padding-top: 1.25em; } @@ -52,3 +56,14 @@ width: calc(100% / 12 * 8); padding-left: 3em; } + +.console { + font-family: 'Roboto Mono', monospace; + background: rgba(255, 255, 255, 0.1); + font-size: 16px; + padding: 0 0.25em; +} + +.center { + text-align: center; +} diff --git a/js/src/views/Settings/settings.css b/js/src/views/Settings/settings.css index d2a38ade2..ebd7b4ec0 100644 --- a/js/src/views/Settings/settings.css +++ b/js/src/views/Settings/settings.css @@ -34,6 +34,7 @@ .tabactive { padding: 16px 2em !important; line-height: 24px !important; + width: auto !important; } .tabactive { diff --git a/js/src/views/Settings/settings.js b/js/src/views/Settings/settings.js index 3fee95643..2b9579993 100644 --- a/js/src/views/Settings/settings.js +++ b/js/src/views/Settings/settings.js @@ -18,6 +18,7 @@ import React, { Component, PropTypes } from 'react'; import { Tab, Tabs } from 'material-ui'; +import ActionSettingsEthernet from 'material-ui/svg-icons/action/settings-ethernet'; import ImageBlurOn from 'material-ui/svg-icons/image/blur-on'; import ImageRemoveRedEye from 'material-ui/svg-icons/image/remove-red-eye'; @@ -51,6 +52,20 @@ export default class Settings extends Component { renderTabs () { const hash = (window.location.hash || '').split('?')[0].split('/')[2]; + const isProxied = window.location.hostname.indexOf('.parity') !== -1; + let proxy = null; + + if (!isProxied) { + proxy = ( + } + label={
proxy
} + onActive={ this.onActivate('proxy') } /> + ); + } return ( @@ -68,6 +83,7 @@ export default class Settings extends Component { icon={ } label={
background
} onActive={ this.onActivate('background') } /> + { proxy }
); } diff --git a/js/src/views/Signer/components/TransactionPendingForm/TransactionPendingFormReject/TransactionPendingFormReject.js b/js/src/views/Signer/components/TransactionPendingForm/TransactionPendingFormReject/TransactionPendingFormReject.js index 23d4ed794..2cf039995 100644 --- a/js/src/views/Signer/components/TransactionPendingForm/TransactionPendingFormReject/TransactionPendingFormReject.js +++ b/js/src/views/Signer/components/TransactionPendingForm/TransactionPendingFormReject/TransactionPendingFormReject.js @@ -18,35 +18,16 @@ import React, { Component, PropTypes } from 'react'; import RaisedButton from 'material-ui/RaisedButton'; -import { REJECT_COUNTER_TIME } from '../../constants/constants'; import styles from './TransactionPendingFormReject.css'; export default class TransactionPendingFormReject extends Component { static propTypes = { onReject: PropTypes.func.isRequired, - className: PropTypes.string, - rejectCounterTime: PropTypes.number + className: PropTypes.string }; - static defaultProps = { - rejectCounterTime: REJECT_COUNTER_TIME - }; - - state = { - rejectCounter: this.props.rejectCounterTime - } - - componentWillMount () { - this.onInitCounter(); - } - - componentWillUnmount () { - this.onResetCounter(); - } - render () { - const { rejectCounter } = this.state; const { onReject } = this.props; return ( @@ -58,36 +39,10 @@ export default class TransactionPendingFormReject extends Component { 0 } fullWidth - label={ `Reject Transaction ${this.renderCounter()}` } + label={ 'Reject Transaction' } />
); } - - renderCounter () { - const { rejectCounter } = this.state; - if (!rejectCounter) { - return ''; - } - return `(${rejectCounter})`; - } - - onInitCounter () { - this.rejectInterval = setInterval(() => { - let { rejectCounter } = this.state; - if (rejectCounter === 0) { - return clearInterval(this.rejectInterval); - } - this.setState({ rejectCounter: rejectCounter - 1 }); - }, 1000); - } - - onResetCounter () { - clearInterval(this.rejectInterval); - this.setState({ - rejectCounter: this.props.rejectCounterTime - }); - } } diff --git a/js/src/views/Signer/components/constants/constants.js b/js/src/views/Signer/components/constants/constants.js index cced99bf9..c02384775 100644 --- a/js/src/views/Signer/components/constants/constants.js +++ b/js/src/views/Signer/components/constants/constants.js @@ -14,11 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -// after user clicks 'reject' for the first time, -// a second reject button is rendered and disabled -// for a few seconds to avoid accidential double clicks -export const REJECT_COUNTER_TIME = 3; - // links to chain explorers export const BASE_LINK_ACCOUNT_MORDEN = 'https://testnet.etherscan.io/address/'; export const BASE_LINK_ACCOUNT_HOMESTEAD = 'https://etherscan.io/address/'; diff --git a/js/src/views/index.js b/js/src/views/index.js index 0818c8899..c40219c49 100644 --- a/js/src/views/index.js +++ b/js/src/views/index.js @@ -24,7 +24,7 @@ import Contracts from './Contracts'; import Dapp from './Dapp'; import Dapps from './Dapps'; import ParityBar from './ParityBar'; -import Settings, { SettingsBackground, SettingsViews } from './Settings'; +import Settings, { SettingsBackground, SettingsProxy, SettingsViews } from './Settings'; import Signer from './Signer'; import Status from './Status'; @@ -41,6 +41,7 @@ export { ParityBar, Settings, SettingsBackground, + SettingsProxy, SettingsViews, Signer, Status