Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #265 from gnosis/release-without-tx-history-servic…
Browse files Browse the repository at this point in the history
…e-refactor

Release without tx history service refactor
  • Loading branch information
mmv08 authored Nov 14, 2019
2 parents c4f6904 + cdd091d commit fd661c5
Show file tree
Hide file tree
Showing 30 changed files with 788 additions and 1,775 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"precommit"
],
"dependencies": {
"@gnosis.pm/safe-contracts": "^1.0.0",
"@gnosis.pm/safe-contracts": "1.0.0",
"@gnosis.pm/util-contracts": "2.0.4",
"@material-ui/core": "4.6.0",
"@material-ui/core": "4.6.1",
"@material-ui/icons": "4.5.1",
"@portis/web3": "^2.0.0-beta.45",
"@testing-library/jest-dom": "4.2.3",
Expand All @@ -57,7 +57,7 @@
"react-dom": "16.11.0",
"react-final-form": "6.3.0",
"react-final-form-listeners": "^1.0.2",
"react-hot-loader": "4.12.16",
"react-hot-loader": "4.12.17",
"react-qr-reader": "^2.2.1",
"react-redux": "7.1.3",
"react-router-dom": "5.1.2",
Expand Down Expand Up @@ -116,15 +116,15 @@
"detect-port": "^1.3.0",
"eslint": "5.16.0",
"eslint-config-airbnb": "18.0.1",
"eslint-plugin-flowtype": "4.3.0",
"eslint-plugin-flowtype": "4.4.1",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jest": "23.0.3",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.16.0",
"ethereumjs-abi": "0.6.8",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "4.2.0",
"flow-bin": "0.111.3",
"flow-bin": "0.112.0",
"fs-extra": "8.1.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
Expand All @@ -141,7 +141,7 @@
"storybook-host": "5.1.0",
"storybook-router": "^0.3.4",
"style-loader": "1.0.0",
"truffle": "5.0.44",
"truffle": "5.1.0",
"truffle-contract": "4.0.31",
"truffle-solidity-loader": "0.1.32",
"uglifyjs-webpack-plugin": "2.2.0",
Expand Down
12 changes: 2 additions & 10 deletions src/components/ConnectButton/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import React from 'react'
import { connect } from 'react-redux'
import Web3Connect from 'web3connect'
import Torus from '@toruslabs/torus-embed'
import WalletConnectProvider from '@walletconnect/web3-provider'
Expand Down Expand Up @@ -54,15 +53,11 @@ web3Connect.on('connect', (provider: any) => {
})

type Props = {
registerProvider: Function,
enqueueSnackbar: Function,
closeSnackbar: Function,
}

const ConnectButton = ({
registerProvider, ...props
}: Props) => (

const ConnectButton = (props: Props) => (
<Button
color="primary"
variant="contained"
Expand All @@ -76,7 +71,4 @@ const ConnectButton = ({
</Button>
)

export default connect(
null,
{ registerProvider: fetchProvider },
)(ConnectButton)
export default ConnectButton
23 changes: 23 additions & 0 deletions src/components/layout/Backdrop/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @flow
import React from 'react'
import { makeStyles } from '@material-ui/core/styles'
import ReactDOM from 'react-dom'
import Backdrop from '@material-ui/core/Backdrop'

const useStyles = makeStyles({
root: {
zIndex: 1300,
},
})

const BackdropLayout = ({ isOpen = false }: { isOpen: boolean }) => {
if (!isOpen) {
return null
}

const classes = useStyles()

return ReactDOM.createPortal(<Backdrop classes={{ root: classes.root }} open />, document.body)
}

export default BackdropLayout
7 changes: 7 additions & 0 deletions src/components/layout/PageFrame/assets/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 53 additions & 32 deletions src/components/layout/PageFrame/index.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
// @flow
import * as React from 'react'
import { connect } from 'react-redux'
import { SnackbarProvider } from 'notistack'
import { withStyles } from '@material-ui/core/styles'
import { getNetwork } from '~/config'
import { ETHEREUM_NETWORK } from '~/logic/wallets/getWeb3'
import SidebarProvider from '~/components/Sidebar'
import Header from '~/components/Header'
import Backdrop from '~/components/layout/Backdrop'
import Img from '~/components/layout/Img'
import Notifier from '~/components/Notifier'
import AlertLogo from './assets/alert.svg'
import CheckLogo from './assets/check.svg'
import ErrorLogo from './assets/error.svg'
import { networkSelector } from '~/logic/wallets/store/selectors'
import AlertIcon from './assets/alert.svg'
import CheckIcon from './assets/check.svg'
import ErrorIcon from './assets/error.svg'
import InfoIcon from './assets/info.svg'
import styles from './index.scss'

const notificationStyles = {
Expand Down Expand Up @@ -40,11 +46,11 @@ const notificationStyles = {
boxShadow: '0 0 10px 0 rgba(212, 212, 211, 0.59)',
},
info: {
background: '#e8673c',
background: '#ffffff',
fontFamily: 'Averta',
fontSize: '14px',
lineHeight: 1.43,
color: '#ffffff',
color: '#001428',
minHeight: '58px',
boxShadow: '0 0 10px 0 rgba(212, 212, 211, 0.59)',
},
Expand All @@ -53,33 +59,48 @@ const notificationStyles = {
type Props = {
children: React.Node,
classes: Object,
currentNetwork: string,
}

const PageFrame = ({ children, classes }: Props) => (
<div className={styles.frame}>
<SnackbarProvider
maxSnack={5}
anchorOrigin={{ vertical: 'top', horizontal: 'right' }}
classes={{
variantSuccess: classes.success,
variantError: classes.error,
variantWarning: classes.warning,
variantInfo: classes.info,
}}
iconVariant={{
success: <Img src={CheckLogo} alt="Success" />,
error: <Img src={ErrorLogo} alt="Error" />,
warning: <Img src={AlertLogo} alt="Warning" />,
info: '',
}}
>
<Notifier />
<SidebarProvider>
<Header />
{children}
</SidebarProvider>
</SnackbarProvider>
</div>
)
const desiredNetwork = getNetwork()

const PageFrame = ({ children, classes, currentNetwork }: Props) => {
const isWrongNetwork = currentNetwork !== ETHEREUM_NETWORK.UNKNOWN && currentNetwork !== desiredNetwork

export default withStyles(notificationStyles)(PageFrame)
return (
<div className={styles.frame}>
<Backdrop isOpen={isWrongNetwork} />
<SnackbarProvider
maxSnack={5}
anchorOrigin={{ vertical: 'top', horizontal: 'right' }}
classes={{
variantSuccess: classes.success,
variantError: classes.error,
variantWarning: classes.warning,
variantInfo: classes.info,
}}
iconVariant={{
success: <Img src={CheckIcon} alt="Success" />,
error: <Img src={ErrorIcon} alt="Error" />,
warning: <Img src={AlertIcon} alt="Warning" />,
info: <Img src={InfoIcon} alt="Info" />,
}}
>
<Notifier />
<SidebarProvider>
<Header />
{children}
</SidebarProvider>
</SnackbarProvider>
</div>
)
}

export default withStyles(notificationStyles)(
connect(
(state) => ({
currentNetwork: networkSelector(state),
}),
null,
)(PageFrame),
)
2 changes: 1 addition & 1 deletion src/config/staging-mainnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TX_SERVICE_HOST, RELAY_API_URL } from '~/config/names'

const stagingMainnetConfig = {
...stagingConfig,
[TX_SERVICE_HOST]: 'https://safe-transaction.mainnet.staging.gnosisdev.com/api/v1/',
[TX_SERVICE_HOST]: 'https://safe-transaction.mainnet.gnosis.io/api/v1/',
[RELAY_API_URL]: 'https://safe-relay.gnosis.io/api/v1/',
}

Expand Down
2 changes: 1 addition & 1 deletion src/config/staging.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { TX_SERVICE_HOST, SIGNATURES_VIA_METAMASK, RELAY_API_URL } from '~/config/names'

const stagingConfig = {
[TX_SERVICE_HOST]: 'https://safe-transaction.staging.gnosisdev.com/api/v1/',
[TX_SERVICE_HOST]: 'https://safe-transaction.rinkeby.gnosis.io/api/v1/',
[SIGNATURES_VIA_METAMASK]: false,
[RELAY_API_URL]: 'https://safe-relay.staging.gnosisdev.com/api/v1/',
}
Expand Down
4 changes: 3 additions & 1 deletion src/logic/contracts/safeContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export const deploySafeContract = async (safeAccounts: string[], numConfirmation
const gas = await calculateGasOf(proxyFactoryData, userAccount, proxyFactoryMaster.address)
const gasPrice = await calculateGasPrice()

return proxyFactoryMaster.createProxy(safeMaster.address, gnosisSafeData, { from: userAccount, gas, gasPrice })
return proxyFactoryMaster.createProxy(safeMaster.address, gnosisSafeData, {
from: userAccount, gas, gasPrice, value: 0,
})
}

export const estimateGasForDeployingSafe = async (
Expand Down
Loading

0 comments on commit fd661c5

Please sign in to comment.