Enqueue Snackbar in Safe settings
This commit is contained in:
parent
81323e1808
commit
4dfdfed0b7
|
@ -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) => (
|
||||
<SharedSnackbarConsumer>
|
||||
{({ openSnackbar }) => <ChangeSafeName {...props} openSnackbar={openSnackbar} />}
|
||||
</SharedSnackbarConsumer>
|
||||
)
|
||||
|
||||
export default withStyles(styles)(withSnackbar)
|
||||
export default withStyles(styles)(withSnackbar(ChangeSafeName))
|
||||
|
|
|
@ -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<Owner>,
|
||||
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<ActiveScreen>('selectOwner')
|
||||
const [values, setValues] = useState<Object>({})
|
||||
|
@ -98,59 +100,51 @@ const AddOwner = ({
|
|||
setActiveScreen('reviewAddOwner')
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SharedSnackbarConsumer>
|
||||
{({ openSnackbar }) => {
|
||||
const onAddOwner = async () => {
|
||||
onClose()
|
||||
try {
|
||||
sendAddOwner(values, safeAddress, owners, openSnackbar, createTransaction, addSafeOwner)
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line
|
||||
console.log('Error while removing an owner ' + error)
|
||||
}
|
||||
}
|
||||
const onAddOwner = async () => {
|
||||
onClose()
|
||||
try {
|
||||
sendAddOwner(values, safeAddress, owners, enqueueSnackbar, createTransaction, addSafeOwner)
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line
|
||||
console.log('Error while removing an owner ' + error)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Add owner to Safe"
|
||||
description="Add owner to Safe"
|
||||
handleClose={onClose}
|
||||
open={isOpen}
|
||||
paperClassName={classes.biggerModalWindow}
|
||||
>
|
||||
<>
|
||||
{activeScreen === 'selectOwner' && (
|
||||
<OwnerForm onClose={onClose} onSubmit={ownerSubmitted} owners={owners} />
|
||||
)}
|
||||
{activeScreen === 'selectThreshold' && (
|
||||
<ThresholdForm
|
||||
onClose={onClose}
|
||||
owners={owners}
|
||||
threshold={threshold}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={thresholdSubmitted}
|
||||
/>
|
||||
)}
|
||||
{activeScreen === 'reviewAddOwner' && (
|
||||
<ReviewAddOwner
|
||||
onClose={onClose}
|
||||
safeName={safeName}
|
||||
owners={owners}
|
||||
network={network}
|
||||
values={values}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={onAddOwner}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</Modal>
|
||||
)
|
||||
}}
|
||||
</SharedSnackbarConsumer>
|
||||
</>
|
||||
return (
|
||||
<Modal
|
||||
title="Add owner to Safe"
|
||||
description="Add owner to Safe"
|
||||
handleClose={onClose}
|
||||
open={isOpen}
|
||||
paperClassName={classes.biggerModalWindow}
|
||||
>
|
||||
<>
|
||||
{activeScreen === 'selectOwner' && (
|
||||
<OwnerForm onClose={onClose} onSubmit={ownerSubmitted} owners={owners} />
|
||||
)}
|
||||
{activeScreen === 'selectThreshold' && (
|
||||
<ThresholdForm
|
||||
onClose={onClose}
|
||||
owners={owners}
|
||||
threshold={threshold}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={thresholdSubmitted}
|
||||
/>
|
||||
)}
|
||||
{activeScreen === 'reviewAddOwner' && (
|
||||
<ReviewAddOwner
|
||||
onClose={onClose}
|
||||
safeName={safeName}
|
||||
owners={owners}
|
||||
network={network}
|
||||
values={values}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={onAddOwner}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
export default withStyles(styles)(AddOwner)
|
||||
export default withStyles(styles)(withSnackbar(AddOwner))
|
||||
|
|
|
@ -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, SENTINEL_ADDRESS } from '~/logic/contracts/safeContracts'
|
||||
|
@ -31,7 +31,9 @@ type Props = {
|
|||
network: string,
|
||||
createTransaction: Function,
|
||||
removeSafeOwner: Function,
|
||||
enqueueSnackbar: Function,
|
||||
}
|
||||
|
||||
type ActiveScreen = 'checkOwner' | 'selectThreshold' | 'reviewRemoveOwner'
|
||||
|
||||
export const sendRemoveOwner = async (
|
||||
|
@ -40,7 +42,7 @@ export const sendRemoveOwner = async (
|
|||
ownerAddressToRemove: string,
|
||||
ownerNameToRemove: string,
|
||||
ownersOld: List<Owner>,
|
||||
openSnackbar: Function,
|
||||
enqueueSnackbar: Function,
|
||||
createTransaction: Function,
|
||||
removeSafeOwner: Function,
|
||||
) => {
|
||||
|
@ -54,7 +56,7 @@ export const sendRemoveOwner = async (
|
|||
.removeOwner(prevAddress, ownerAddressToRemove, values.threshold)
|
||||
.encodeABI()
|
||||
|
||||
const txHash = await createTransaction(safeAddress, safeAddress, 0, txData, openSnackbar)
|
||||
const txHash = await createTransaction(safeAddress, safeAddress, 0, txData, enqueueSnackbar)
|
||||
|
||||
if (txHash) {
|
||||
removeSafeOwner({ safeAddress, ownerAddress: ownerAddressToRemove })
|
||||
|
@ -74,6 +76,7 @@ const RemoveOwner = ({
|
|||
network,
|
||||
createTransaction,
|
||||
removeSafeOwner,
|
||||
enqueueSnackbar,
|
||||
}: Props) => {
|
||||
const [activeScreen, setActiveScreen] = useState<ActiveScreen>('checkOwner')
|
||||
const [values, setValues] = useState<Object>({})
|
||||
|
@ -104,71 +107,63 @@ const RemoveOwner = ({
|
|||
setActiveScreen('reviewRemoveOwner')
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SharedSnackbarConsumer>
|
||||
{({ openSnackbar }) => {
|
||||
const onRemoveOwner = () => {
|
||||
onClose()
|
||||
sendRemoveOwner(
|
||||
values,
|
||||
safeAddress,
|
||||
ownerAddress,
|
||||
ownerName,
|
||||
owners,
|
||||
openSnackbar,
|
||||
createTransaction,
|
||||
removeSafeOwner,
|
||||
)
|
||||
}
|
||||
const onRemoveOwner = () => {
|
||||
onClose()
|
||||
sendRemoveOwner(
|
||||
values,
|
||||
safeAddress,
|
||||
ownerAddress,
|
||||
ownerName,
|
||||
owners,
|
||||
enqueueSnackbar,
|
||||
createTransaction,
|
||||
removeSafeOwner,
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Remove owner from Safe"
|
||||
description="Remove owner from Safe"
|
||||
handleClose={onClose}
|
||||
open={isOpen}
|
||||
paperClassName={classes.biggerModalWindow}
|
||||
>
|
||||
<>
|
||||
{activeScreen === 'checkOwner' && (
|
||||
<CheckOwner
|
||||
onClose={onClose}
|
||||
ownerAddress={ownerAddress}
|
||||
ownerName={ownerName}
|
||||
network={network}
|
||||
onSubmit={ownerSubmitted}
|
||||
/>
|
||||
)}
|
||||
{activeScreen === 'selectThreshold' && (
|
||||
<ThresholdForm
|
||||
onClose={onClose}
|
||||
owners={owners}
|
||||
threshold={threshold}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={thresholdSubmitted}
|
||||
/>
|
||||
)}
|
||||
{activeScreen === 'reviewRemoveOwner' && (
|
||||
<ReviewRemoveOwner
|
||||
onClose={onClose}
|
||||
safeName={safeName}
|
||||
owners={owners}
|
||||
network={network}
|
||||
values={values}
|
||||
ownerAddress={ownerAddress}
|
||||
ownerName={ownerName}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={onRemoveOwner}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</Modal>
|
||||
)
|
||||
}}
|
||||
</SharedSnackbarConsumer>
|
||||
</>
|
||||
return (
|
||||
<Modal
|
||||
title="Remove owner from Safe"
|
||||
description="Remove owner from Safe"
|
||||
handleClose={onClose}
|
||||
open={isOpen}
|
||||
paperClassName={classes.biggerModalWindow}
|
||||
>
|
||||
<>
|
||||
{activeScreen === 'checkOwner' && (
|
||||
<CheckOwner
|
||||
onClose={onClose}
|
||||
ownerAddress={ownerAddress}
|
||||
ownerName={ownerName}
|
||||
network={network}
|
||||
onSubmit={ownerSubmitted}
|
||||
/>
|
||||
)}
|
||||
{activeScreen === 'selectThreshold' && (
|
||||
<ThresholdForm
|
||||
onClose={onClose}
|
||||
owners={owners}
|
||||
threshold={threshold}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={thresholdSubmitted}
|
||||
/>
|
||||
)}
|
||||
{activeScreen === 'reviewRemoveOwner' && (
|
||||
<ReviewRemoveOwner
|
||||
onClose={onClose}
|
||||
safeName={safeName}
|
||||
owners={owners}
|
||||
network={network}
|
||||
values={values}
|
||||
ownerAddress={ownerAddress}
|
||||
ownerName={ownerName}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={onRemoveOwner}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
export default withStyles(styles)(RemoveOwner)
|
||||
export default withStyles(styles)(withSnackbar(RemoveOwner))
|
||||
|
|
|
@ -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 { getGnosisSafeInstanceAt, SENTINEL_ADDRESS } from '~/logic/contracts/safeContracts'
|
||||
import OwnerForm from './screens/OwnerForm'
|
||||
|
@ -29,6 +29,7 @@ type Props = {
|
|||
threshold: string,
|
||||
createTransaction: Function,
|
||||
replaceSafeOwner: Function,
|
||||
enqueueSnackbar: Function,
|
||||
}
|
||||
type ActiveScreen = 'checkOwner' | 'reviewReplaceOwner'
|
||||
|
||||
|
@ -36,7 +37,7 @@ export const sendReplaceOwner = async (
|
|||
values: Object,
|
||||
safeAddress: string,
|
||||
ownerAddressToRemove: string,
|
||||
openSnackbar: Function,
|
||||
enqueueSnackbar: Function,
|
||||
createTransaction: Function,
|
||||
replaceSafeOwner: Function,
|
||||
) => {
|
||||
|
@ -50,7 +51,7 @@ export const sendReplaceOwner = async (
|
|||
.swapOwner(prevAddress, ownerAddressToRemove, values.ownerAddress)
|
||||
.encodeABI()
|
||||
|
||||
const txHash = await createTransaction(safeAddress, safeAddress, 0, txData, openSnackbar)
|
||||
const txHash = await createTransaction(safeAddress, safeAddress, 0, txData, enqueueSnackbar)
|
||||
|
||||
if (txHash) {
|
||||
replaceSafeOwner({
|
||||
|
@ -75,6 +76,7 @@ const ReplaceOwner = ({
|
|||
threshold,
|
||||
createTransaction,
|
||||
replaceSafeOwner,
|
||||
enqueueSnackbar,
|
||||
}: Props) => {
|
||||
const [activeScreen, setActiveScreen] = useState<ActiveScreen>('checkOwner')
|
||||
const [values, setValues] = useState<Object>({})
|
||||
|
@ -96,67 +98,59 @@ const ReplaceOwner = ({
|
|||
setActiveScreen('reviewReplaceOwner')
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SharedSnackbarConsumer>
|
||||
{({ openSnackbar }) => {
|
||||
const onReplaceOwner = () => {
|
||||
onClose()
|
||||
try {
|
||||
sendReplaceOwner(
|
||||
values,
|
||||
safeAddress,
|
||||
ownerAddress,
|
||||
openSnackbar,
|
||||
createTransaction,
|
||||
replaceSafeOwner,
|
||||
)
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line
|
||||
console.log('Error while removing an owner ' + error)
|
||||
}
|
||||
}
|
||||
const onReplaceOwner = () => {
|
||||
onClose()
|
||||
try {
|
||||
sendReplaceOwner(
|
||||
values,
|
||||
safeAddress,
|
||||
ownerAddress,
|
||||
enqueueSnackbar,
|
||||
createTransaction,
|
||||
replaceSafeOwner,
|
||||
)
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line
|
||||
console.log('Error while removing an owner ' + error)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Replace owner from Safe"
|
||||
description="Replace owner from Safe"
|
||||
handleClose={onClose}
|
||||
open={isOpen}
|
||||
paperClassName={classes.biggerModalWindow}
|
||||
>
|
||||
<>
|
||||
{activeScreen === 'checkOwner' && (
|
||||
<OwnerForm
|
||||
onClose={onClose}
|
||||
ownerAddress={ownerAddress}
|
||||
ownerName={ownerName}
|
||||
owners={owners}
|
||||
network={network}
|
||||
onSubmit={ownerSubmitted}
|
||||
/>
|
||||
)}
|
||||
{activeScreen === 'reviewReplaceOwner' && (
|
||||
<ReviewReplaceOwner
|
||||
onClose={onClose}
|
||||
safeName={safeName}
|
||||
owners={owners}
|
||||
network={network}
|
||||
values={values}
|
||||
ownerAddress={ownerAddress}
|
||||
ownerName={ownerName}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={onReplaceOwner}
|
||||
threshold={threshold}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</Modal>
|
||||
)
|
||||
}}
|
||||
</SharedSnackbarConsumer>
|
||||
</>
|
||||
return (
|
||||
<Modal
|
||||
title="Replace owner from Safe"
|
||||
description="Replace owner from Safe"
|
||||
handleClose={onClose}
|
||||
open={isOpen}
|
||||
paperClassName={classes.biggerModalWindow}
|
||||
>
|
||||
<>
|
||||
{activeScreen === 'checkOwner' && (
|
||||
<OwnerForm
|
||||
onClose={onClose}
|
||||
ownerAddress={ownerAddress}
|
||||
ownerName={ownerName}
|
||||
owners={owners}
|
||||
network={network}
|
||||
onSubmit={ownerSubmitted}
|
||||
/>
|
||||
)}
|
||||
{activeScreen === 'reviewReplaceOwner' && (
|
||||
<ReviewReplaceOwner
|
||||
onClose={onClose}
|
||||
safeName={safeName}
|
||||
owners={owners}
|
||||
network={network}
|
||||
values={values}
|
||||
ownerAddress={ownerAddress}
|
||||
ownerName={ownerName}
|
||||
onClickBack={onClickBack}
|
||||
onSubmit={onReplaceOwner}
|
||||
threshold={threshold}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
export default withStyles(styles)(ReplaceOwner)
|
||||
export default withStyles(styles)(withSnackbar(ReplaceOwner))
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import React, { useState } from 'react'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import { List } from 'immutable'
|
||||
import { SharedSnackbarConsumer } from '~/components/SharedSnackBar'
|
||||
import { withSnackbar } from 'notistack'
|
||||
import Heading from '~/components/layout/Heading'
|
||||
import Button from '~/components/layout/Button'
|
||||
import Bold from '~/components/layout/Bold'
|
||||
|
@ -22,10 +22,11 @@ type Props = {
|
|||
createTransaction: Function,
|
||||
safeAddress: string,
|
||||
granted: boolean,
|
||||
enqueueSnackbar: Function,
|
||||
}
|
||||
|
||||
const ThresholdSettings = ({
|
||||
owners, threshold, classes, createTransaction, safeAddress, granted,
|
||||
owners, threshold, classes, createTransaction, safeAddress, granted, enqueueSnackbar,
|
||||
}: Props) => {
|
||||
const [isModalOpen, setModalOpen] = useState(false)
|
||||
|
||||
|
@ -33,66 +34,58 @@ const ThresholdSettings = ({
|
|||
setModalOpen((prevOpen) => !prevOpen)
|
||||
}
|
||||
|
||||
const onChangeThreshold = async (newThreshold) => {
|
||||
const safeInstance = await getGnosisSafeInstanceAt(safeAddress)
|
||||
const txData = safeInstance.contract.methods.changeThreshold(newThreshold).encodeABI()
|
||||
|
||||
createTransaction(safeAddress, safeAddress, 0, txData, enqueueSnackbar)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SharedSnackbarConsumer>
|
||||
{({ openSnackbar }) => {
|
||||
const onChangeThreshold = async (newThreshold) => {
|
||||
const safeInstance = await getGnosisSafeInstanceAt(safeAddress)
|
||||
const txData = safeInstance.contract.methods.changeThreshold(newThreshold).encodeABI()
|
||||
|
||||
createTransaction(safeAddress, safeAddress, 0, txData, openSnackbar)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Block className={classes.container}>
|
||||
<Heading tag="h2">Required confirmations</Heading>
|
||||
<Paragraph>
|
||||
Any transaction requires the confirmation of:
|
||||
</Paragraph>
|
||||
<Paragraph size="lg" className={classes.ownersText}>
|
||||
<Bold>{threshold}</Bold>
|
||||
{' '}
|
||||
out of
|
||||
{' '}
|
||||
<Bold>{owners.size}</Bold>
|
||||
{' '}
|
||||
owners
|
||||
</Paragraph>
|
||||
{owners.size > 1 && granted && (
|
||||
<Row className={classes.buttonRow}>
|
||||
<Button
|
||||
color="primary"
|
||||
minWidth={120}
|
||||
className={classes.modifyBtn}
|
||||
onClick={toggleModal}
|
||||
variant="contained"
|
||||
>
|
||||
Modify
|
||||
</Button>
|
||||
</Row>
|
||||
)}
|
||||
</Block>
|
||||
<Modal
|
||||
title="Change Required Confirmations"
|
||||
description="Change Required Confirmations Form"
|
||||
handleClose={toggleModal}
|
||||
open={isModalOpen}
|
||||
>
|
||||
<ChangeThreshold
|
||||
onClose={toggleModal}
|
||||
owners={owners}
|
||||
threshold={threshold}
|
||||
onChangeThreshold={onChangeThreshold}
|
||||
/>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}}
|
||||
</SharedSnackbarConsumer>
|
||||
<Block className={classes.container}>
|
||||
<Heading tag="h2">Required confirmations</Heading>
|
||||
<Paragraph>
|
||||
Any transaction requires the confirmation of:
|
||||
</Paragraph>
|
||||
<Paragraph size="lg" className={classes.ownersText}>
|
||||
<Bold>{threshold}</Bold>
|
||||
{' '}
|
||||
out of
|
||||
{' '}
|
||||
<Bold>{owners.size}</Bold>
|
||||
{' '}
|
||||
owners
|
||||
</Paragraph>
|
||||
{owners.size > 1 && granted && (
|
||||
<Row className={classes.buttonRow}>
|
||||
<Button
|
||||
color="primary"
|
||||
minWidth={120}
|
||||
className={classes.modifyBtn}
|
||||
onClick={toggleModal}
|
||||
variant="contained"
|
||||
>
|
||||
Modify
|
||||
</Button>
|
||||
</Row>
|
||||
)}
|
||||
</Block>
|
||||
<Modal
|
||||
title="Change Required Confirmations"
|
||||
description="Change Required Confirmations Form"
|
||||
handleClose={toggleModal}
|
||||
open={isModalOpen}
|
||||
>
|
||||
<ChangeThreshold
|
||||
onClose={toggleModal}
|
||||
owners={owners}
|
||||
threshold={threshold}
|
||||
onChangeThreshold={onChangeThreshold}
|
||||
/>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default withStyles(styles)(ThresholdSettings)
|
||||
export default withStyles(styles)(withSnackbar(ThresholdSettings))
|
||||
|
|
Loading…
Reference in New Issue