dep bump, add copy/etherscan buttons to header provider details dropdown

This commit is contained in:
Mikhail Mikheev 2019-10-04 12:01:17 +04:00
parent 0760bfbdc3
commit fec212f2d6
3 changed files with 35 additions and 37 deletions

View File

@ -50,8 +50,8 @@
"notistack": "https://github.com/gnosis/notistack.git#v0.9.4", "notistack": "https://github.com/gnosis/notistack.git#v0.9.4",
"optimize-css-assets-webpack-plugin": "5.0.3", "optimize-css-assets-webpack-plugin": "5.0.3",
"qrcode.react": "^0.9.3", "qrcode.react": "^0.9.3",
"react": "16.10.1", "react": "16.10.2",
"react-dom": "16.10.1", "react-dom": "16.10.2",
"react-final-form": "6.3.0", "react-final-form": "6.3.0",
"react-final-form-listeners": "^1.0.2", "react-final-form-listeners": "^1.0.2",
"react-hot-loader": "4.12.14", "react-hot-loader": "4.12.14",
@ -97,7 +97,7 @@
"@storybook/addon-knobs": "5.2.1", "@storybook/addon-knobs": "5.2.1",
"@storybook/addon-links": "5.2.1", "@storybook/addon-links": "5.2.1",
"@storybook/react": "5.2.1", "@storybook/react": "5.2.1",
"@testing-library/react": "9.2.0", "@testing-library/react": "9.3.0",
"autoprefixer": "9.6.1", "autoprefixer": "9.6.1",
"babel-core": "^7.0.0-bridge.0", "babel-core": "^7.0.0-bridge.0",
"babel-eslint": "10.0.3", "babel-eslint": "10.0.3",

View File

@ -1,11 +1,11 @@
// @flow // @flow
import * as React from 'react' import * as React from 'react'
import classNames from 'classnames' import classNames from 'classnames'
import OpenInNew from '@material-ui/icons/OpenInNew'
import { withStyles } from '@material-ui/core/styles' import { withStyles } from '@material-ui/core/styles'
import Dot from '@material-ui/icons/FiberManualRecord' import Dot from '@material-ui/icons/FiberManualRecord'
import EtherscanBtn from '~/components/EtherscanBtn'
import CopyBtn from '~/components/CopyBtn'
import Paragraph from '~/components/layout/Paragraph' import Paragraph from '~/components/layout/Paragraph'
import Link from '~/components/layout/Link'
import Button from '~/components/layout/Button' import Button from '~/components/layout/Button'
import Identicon from '~/components/Identicon' import Identicon from '~/components/Identicon'
import Hairline from '~/components/layout/Hairline' import Hairline from '~/components/layout/Hairline'
@ -14,11 +14,10 @@ import Row from '~/components/layout/Row'
import Block from '~/components/layout/Block' import Block from '~/components/layout/Block'
import Spacer from '~/components/Spacer' import Spacer from '~/components/Spacer'
import { import {
xs, sm, md, lg, background, secondary, warning, connected as connectedBg, xs, sm, md, lg, background, warning, connected as connectedBg,
} from '~/theme/variables' } from '~/theme/variables'
import { upperFirst } from '~/utils/css' import { upperFirst } from '~/utils/css'
import { shortVersionOf } from '~/logic/wallets/ethAddresses' import { shortVersionOf } from '~/logic/wallets/ethAddresses'
import { getEtherScanLink } from '~/logic/wallets/getWeb3'
import CircleDot from '~/components/Header/component/CircleDot' import CircleDot from '~/components/Header/component/CircleDot'
const metamaskIcon = require('../../assets/metamask-icon.svg') const metamaskIcon = require('../../assets/metamask-icon.svg')
@ -34,11 +33,6 @@ type Props = {
onDisconnect: Function, onDisconnect: Function,
} }
const openIconStyle = {
height: '16px',
color: secondary,
}
const styles = () => ({ const styles = () => ({
container: { container: {
padding: `${md} 12px`, padding: `${md} 12px`,
@ -65,7 +59,7 @@ const styles = () => ({
flexGrow: 1, flexGrow: 1,
textAlign: 'center', textAlign: 'center',
letterSpacing: '-0.5px', letterSpacing: '-0.5px',
fontSize: '12px', marginRight: sm,
}, },
labels: { labels: {
fontSize: '12px', fontSize: '12px',
@ -119,13 +113,15 @@ const UserDetails = ({
)} )}
</Row> </Row>
<Block justify="center" className={classes.user}> <Block justify="center" className={classes.user}>
<Paragraph className={classes.address} size="xs" noMargin> <Paragraph className={classes.address} size="sm" noMargin>
{address} {address}
</Paragraph> </Paragraph>
{userAddress && ( {userAddress && (
<Link className={classes.open} to={getEtherScanLink('address', userAddress)} target="_blank"> <>
<OpenInNew style={openIconStyle} /> {' '}
</Link> <CopyBtn content={userAddress} />
<EtherscanBtn type="address" value={userAddress} />
</>
)} )}
</Block> </Block>
</Block> </Block>
@ -146,9 +142,11 @@ const UserDetails = ({
Wallet Wallet
</Paragraph> </Paragraph>
<Spacer /> <Spacer />
{provider === 'safe' {provider === 'safe' ? (
? <Img className={classes.logo} src={safeIcon} height={14} alt="Safe client" /> <Img className={classes.logo} src={safeIcon} height={14} alt="Safe client" />
: <Img className={classes.logo} src={metamaskIcon} height={14} alt="Metamask client" />} ) : (
<Img className={classes.logo} src={metamaskIcon} height={14} alt="Metamask client" />
)}
<Paragraph noMargin align="right" weight="bolder" className={classes.labels}> <Paragraph noMargin align="right" weight="bolder" className={classes.labels}>
{upperFirst(provider)} {upperFirst(provider)}
</Paragraph> </Paragraph>

View File

@ -2531,10 +2531,10 @@
pretty-format "^24.0.0" pretty-format "^24.0.0"
redent "^3.0.0" redent "^3.0.0"
"@testing-library/react@9.2.0": "@testing-library/react@9.3.0":
version "9.2.0" version "9.3.0"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-9.2.0.tgz#143ad2d96b03c3c334e47aaf33cc2c9b7d007123" resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-9.3.0.tgz#1dabf46d1ea018a1c89acecc0e7b86859b34c0f8"
integrity sha512-Hr87KZflfI+vPZjgyzBKQHolQHiXGU5aTGjQSCJdH/yGPbm+IzrvuWPS97GD3RUH3rSS1IXq1e2Sn8Hmyw2ctA== integrity sha512-FTPCwmLo0tLtP50Au2uGz4/N1BcJTnBx4StDVHZ47zPMEj1/+J2rk/RTj8SLoHRKWCtcmhN4wRmudOXQNP29/w==
dependencies: dependencies:
"@babel/runtime" "^7.6.0" "@babel/runtime" "^7.6.0"
"@testing-library/dom" "^6.3.0" "@testing-library/dom" "^6.3.0"
@ -14609,15 +14609,15 @@ react-docgen@^4.1.0:
node-dir "^0.1.10" node-dir "^0.1.10"
recast "^0.17.3" recast "^0.17.3"
react-dom@16.10.1: react-dom@16.10.2:
version "16.10.1" version "16.10.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.10.1.tgz#479a6511ba34a429273c213cbc2a9ac4d296dac1" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.10.2.tgz#4840bce5409176bc3a1f2bd8cb10b92db452fda6"
integrity sha512-SmM4ZW0uug0rn95U8uqr52I7UdNf6wdGLeXDmNLfg3y5q5H9eAbdjF5ubQc3bjDyRrvdAB2IKG7X0GzSpnn5Mg== integrity sha512-kWGDcH3ItJK4+6Pl9DZB16BXYAZyrYQItU4OMy0jAkv5aNqc+mAKb4TpFtAteI6TJZu+9ZlNhaeNQSVQDHJzkw==
dependencies: dependencies:
loose-envify "^1.1.0" loose-envify "^1.1.0"
object-assign "^4.1.1" object-assign "^4.1.1"
prop-types "^15.6.2" prop-types "^15.6.2"
scheduler "^0.16.1" scheduler "^0.16.2"
react-dom@^16.8.3: react-dom@^16.8.3:
version "16.8.6" version "16.8.6"
@ -14912,10 +14912,10 @@ react-window@^1.8.5:
"@babel/runtime" "^7.0.0" "@babel/runtime" "^7.0.0"
memoize-one ">=3.1.1 <6" memoize-one ">=3.1.1 <6"
react@16.10.1: react@16.10.2:
version "16.10.1" version "16.10.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.10.1.tgz#967c1e71a2767dfa699e6ba702a00483e3b0573f" resolved "https://registry.yarnpkg.com/react/-/react-16.10.2.tgz#a5ede5cdd5c536f745173c8da47bda64797a4cf0"
integrity sha512-2bisHwMhxQ3XQz4LiJJwG3360pY965pTl/MRrZYxIBKVj4fOHoDs5aZAkYXGxDRO1Li+SyjTAilQEbOmtQJHzA== integrity sha512-MFVIq0DpIhrHFyqLU0S3+4dIcBhhOvBE8bJ/5kHPVOVaGdo0KuiQzpcjCPsf585WvhypqtrMILyoE2th6dT+Lw==
dependencies: dependencies:
loose-envify "^1.1.0" loose-envify "^1.1.0"
object-assign "^4.1.1" object-assign "^4.1.1"
@ -15817,10 +15817,10 @@ scheduler@^0.13.6:
loose-envify "^1.1.0" loose-envify "^1.1.0"
object-assign "^4.1.1" object-assign "^4.1.1"
scheduler@^0.16.1: scheduler@^0.16.2:
version "0.16.1" version "0.16.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.16.1.tgz#a6fb6ddec12dc2119176e6eb54ecfe69a9eba8df" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.16.2.tgz#f74cd9d33eff6fc554edfb79864868e4819132c1"
integrity sha512-MIuie7SgsqMYOdCXVFZa8SKoNorJZUWHW8dPgto7uEHn1lX3fg2Gu0TzgK8USj76uxV7vB5eRMnZs/cdEHg+cg== integrity sha512-BqYVWqwz6s1wZMhjFvLfVR5WXP7ZY32M/wYPo04CcuPM7XZEbV2TBNW7Z0UkguPTl0dWMA59VbNXxK6q+pHItg==
dependencies: dependencies:
loose-envify "^1.1.0" loose-envify "^1.1.0"
object-assign "^4.1.1" object-assign "^4.1.1"