WIP commit: add link to the index page in header

This commit is contained in:
mmv 2019-03-07 19:05:57 +04:00
parent ea0b5f58c5
commit 78dc0d7bb0
3 changed files with 10 additions and 17 deletions

View File

@ -1,5 +1,6 @@
// @flow // @flow
import * as React from 'react' import * as React from 'react'
import { Link } from 'react-router-dom'
import { withStyles } from '@material-ui/core/styles' import { withStyles } from '@material-ui/core/styles'
import Grow from '@material-ui/core/Grow' import Grow from '@material-ui/core/Grow'
import ClickAwayListener from '@material-ui/core/ClickAwayListener' import ClickAwayListener from '@material-ui/core/ClickAwayListener'
@ -43,13 +44,13 @@ const styles = () => ({
}, },
}) })
const Layout = openHoc(({ const Layout = openHoc(({ open, toggle, clickAway, classes, providerInfo, providerDetails }: Props) => (
open, toggle, clickAway, classes, providerInfo, providerDetails,
}: Props) => (
<React.Fragment> <React.Fragment>
<Row className={classes.summary}> <Row className={classes.summary}>
<Col start="xs" middle="xs" className={classes.logo}> <Col start="xs" middle="xs" className={classes.logo}>
<Link to="/">
<Img src={logo} height={32} alt="Gnosis Team Safe" /> <Img src={logo} height={32} alt="Gnosis Team Safe" />
</Link>
</Col> </Col>
<Divider /> <Divider />
<Spacer /> <Spacer />
@ -58,9 +59,7 @@ const Layout = openHoc(({
{providerRef => ( {providerRef => (
<Popper open={open} anchorEl={providerRef.current} placement="bottom-end"> <Popper open={open} anchorEl={providerRef.current} placement="bottom-end">
{({ TransitionProps }) => ( {({ TransitionProps }) => (
<Grow <Grow {...TransitionProps}>
{...TransitionProps}
>
<ClickAwayListener onClickAway={clickAway} mouseEvent="onClick" touchEvent={false}> <ClickAwayListener onClickAway={clickAway} mouseEvent="onClick" touchEvent={false}>
<List className={classes.root} component="div"> <List className={classes.root} component="div">
{providerDetails} {providerDetails}

View File

@ -6,11 +6,9 @@ type Field = boolean | string | null | typeof undefined
export const required = (value: Field) => (value ? undefined : 'Required') export const required = (value: Field) => (value ? undefined : 'Required')
export const mustBeInteger = (value: string) => export const mustBeInteger = (value: string) => (!Number.isInteger(Number(value)) || value.includes('.') ? 'Must be an integer' : undefined)
(!Number.isInteger(Number(value)) || value.includes('.') ? 'Must be an integer' : undefined)
export const mustBeFloat = (value: number) => export const mustBeFloat = (value: number) => (Number.isNaN(Number(value)) ? 'Must be a number' : undefined)
(Number.isNaN(Number(value)) ? 'Must be a number' : undefined)
export const greaterThan = (min: number) => (value: string) => { export const greaterThan = (min: number) => (value: string) => {
if (Number.isNaN(Number(value)) || Number.parseFloat(value) > Number(min)) { if (Number.isNaN(Number(value)) || Number.parseFloat(value) > Number(min)) {
@ -56,11 +54,9 @@ export const mustBeEthereumAddress = (address: Field) => {
export const ADDRESS_REPEATED_ERROR = 'Address already introduced' export const ADDRESS_REPEATED_ERROR = 'Address already introduced'
export const uniqueAddress = (addresses: string[]) => (value: string) => export const uniqueAddress = (addresses: string[]) => (value: string) => (addresses.includes(value) ? ADDRESS_REPEATED_ERROR : undefined)
(addresses.includes(value) ? ADDRESS_REPEATED_ERROR : undefined)
export const composeValidators = (...validators: Function[]): FieldValidator => (value: Field) => export const composeValidators = (...validators: Function[]): FieldValidator => (value: Field) => validators.reduce((error, validator) => error || validator(value), undefined)
validators.reduce((error, validator) => error || validator(value), undefined)
export const inLimit = (limit: number, base: number, baseText: string, symbol: string = 'ETH') => (value: string) => { export const inLimit = (limit: number, base: number, baseText: string, symbol: string = 'ETH') => (value: string) => {
const amount = Number(value) const amount = Number(value)

View File

@ -61,11 +61,9 @@ export const getSafeMasterContract = async () => {
} }
export const deploySafeContract = async (safeAccounts: string[], numConfirmations: number, userAccount: string) => { export const deploySafeContract = async (safeAccounts: string[], numConfirmations: number, userAccount: string) => {
console.log(safeMaster)
const gnosisSafeData = await safeMaster.contract.methods const gnosisSafeData = await safeMaster.contract.methods
.setup(safeAccounts, numConfirmations, '0x0000000000000000000000000000000000000000', '0x') .setup(safeAccounts, numConfirmations, '0x0000000000000000000000000000000000000000', '0x')
.encodeABI() .encodeABI()
console.log('got safe data')
const proxyFactoryData = proxyFactoryMaster.contract.methods const proxyFactoryData = proxyFactoryMaster.contract.methods
.createProxy(safeMaster.address, gnosisSafeData) .createProxy(safeMaster.address, gnosisSafeData)
.encodeABI() .encodeABI()