From 78dc0d7bb038051f59411124cb464de8ff493d21 Mon Sep 17 00:00:00 2001 From: mmv Date: Thu, 7 Mar 2019 19:05:57 +0400 Subject: [PATCH] WIP commit: add link to the index page in header --- src/components/Header/component/Layout.jsx | 13 ++++++------- src/components/forms/validator.js | 12 ++++-------- src/logic/contracts/safeContracts.js | 2 -- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/components/Header/component/Layout.jsx b/src/components/Header/component/Layout.jsx index df166bd8..5b5a180e 100644 --- a/src/components/Header/component/Layout.jsx +++ b/src/components/Header/component/Layout.jsx @@ -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) => ( - Gnosis Team Safe + + Gnosis Team Safe + @@ -58,9 +59,7 @@ const Layout = openHoc(({ {providerRef => ( {({ TransitionProps }) => ( - + {providerDetails} diff --git a/src/components/forms/validator.js b/src/components/forms/validator.js index a268f08f..bf2e40ea 100644 --- a/src/components/forms/validator.js +++ b/src/components/forms/validator.js @@ -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) diff --git a/src/logic/contracts/safeContracts.js b/src/logic/contracts/safeContracts.js index 9f072a6e..f0362b8b 100644 --- a/src/logic/contracts/safeContracts.js +++ b/src/logic/contracts/safeContracts.js @@ -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()