diff --git a/src/routes/safe/components/Settings/ChangeSafeName/index.jsx b/src/routes/safe/components/Settings/ChangeSafeName/index.jsx
index 886016eb..7c368172 100644
--- a/src/routes/safe/components/Settings/ChangeSafeName/index.jsx
+++ b/src/routes/safe/components/Settings/ChangeSafeName/index.jsx
@@ -1,11 +1,11 @@
// @flow
import React from 'react'
import { withStyles } from '@material-ui/core/styles'
+import { withSnackbar } from 'notistack'
import Block from '~/components/layout/Block'
import Col from '~/components/layout/Col'
import Field from '~/components/forms/Field'
import Heading from '~/components/layout/Heading'
-import { SharedSnackbarConsumer } from '~/components/SharedSnackBar'
import { composeValidators, required, minMaxLength } from '~/components/forms/validator'
import TextField from '~/components/forms/TextField'
import GnoForm from '~/components/forms/GnoForm'
@@ -22,17 +22,17 @@ type Props = {
safeAddress: string,
safeName: string,
updateSafe: Function,
- openSnackbar: Function,
+ enqueueSnackbar: Function,
}
const ChangeSafeName = (props: Props) => {
const {
- classes, safeAddress, safeName, updateSafe, openSnackbar,
+ classes, safeAddress, safeName, updateSafe, enqueueSnackbar,
} = props
const handleSubmit = (values) => {
updateSafe({ address: safeAddress, name: values.safeName })
- openSnackbar('Safe name changed', 'success')
+ enqueueSnackbar('Safe name changed', 'success')
}
return (
@@ -80,10 +80,4 @@ const ChangeSafeName = (props: Props) => {
)
}
-const withSnackbar = (props) => (
-
- {({ openSnackbar }) => }
-
-)
-
-export default withStyles(styles)(withSnackbar)
+export default withStyles(styles)(withSnackbar(ChangeSafeName))
diff --git a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/index.jsx b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/index.jsx
index 1ace6021..893ba5db 100644
--- a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/index.jsx
+++ b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/index.jsx
@@ -2,7 +2,7 @@
import React, { useState, useEffect } from 'react'
import { List } from 'immutable'
import { withStyles } from '@material-ui/core/styles'
-import { SharedSnackbarConsumer } from '~/components/SharedSnackBar'
+import { withSnackbar } from 'notistack'
import Modal from '~/components/Modal'
import { type Owner } from '~/routes/safe/store/models/owner'
import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts'
@@ -29,6 +29,7 @@ type Props = {
network: string,
addSafeOwner: Function,
createTransaction: Function,
+ enqueueSnackbar: Function,
}
type ActiveScreen = 'selectOwner' | 'selectThreshold' | 'reviewAddOwner'
@@ -36,14 +37,14 @@ export const sendAddOwner = async (
values: Object,
safeAddress: string,
ownersOld: List,
- openSnackbar: Function,
+ enqueueSnackbar: Function,
createTransaction: Function,
addSafeOwner: Function,
) => {
const gnosisSafe = await getGnosisSafeInstanceAt(safeAddress)
const txData = gnosisSafe.contract.methods.addOwnerWithThreshold(values.ownerAddress, values.threshold).encodeABI()
- const txHash = await createTransaction(safeAddress, safeAddress, 0, txData, openSnackbar)
+ const txHash = await createTransaction(safeAddress, safeAddress, 0, txData, enqueueSnackbar)
if (txHash) {
addSafeOwner({ safeAddress, ownerName: values.ownerName, ownerAddress: values.ownerAddress })
@@ -61,6 +62,7 @@ const AddOwner = ({
network,
createTransaction,
addSafeOwner,
+ enqueueSnackbar,
}: Props) => {
const [activeScreen, setActiveScreen] = useState('selectOwner')
const [values, setValues] = useState