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

View File

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

View File

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