mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-02 21:03:28 +00:00
WA-234 Include warning message when removing owner if there are pending transactions
This commit is contained in:
parent
9bef7f3894
commit
3cccc34ea7
@ -1,6 +1,7 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import Field from '~/components/forms/Field'
|
import Field from '~/components/forms/Field'
|
||||||
|
import SnackbarContent from '~/components/SnackbarContent'
|
||||||
import Checkbox from '~/components/forms/Checkbox'
|
import Checkbox from '~/components/forms/Checkbox'
|
||||||
import Block from '~/components/layout/Block'
|
import Block from '~/components/layout/Block'
|
||||||
import Heading from '~/components/layout/Heading'
|
import Heading from '~/components/layout/Heading'
|
||||||
@ -12,10 +13,11 @@ type Props = {
|
|||||||
threshold: number,
|
threshold: number,
|
||||||
name: string,
|
name: string,
|
||||||
disabled: boolean,
|
disabled: boolean,
|
||||||
|
pendingTransactions: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
const RemoveOwnerForm = ({
|
const RemoveOwnerForm = ({
|
||||||
numOwners, threshold, name, disabled,
|
numOwners, threshold, name, disabled, pendingTransactions,
|
||||||
}: Props) => () => (
|
}: Props) => () => (
|
||||||
<Block margin="md">
|
<Block margin="md">
|
||||||
<Heading tag="h2" margin="lg">
|
<Heading tag="h2" margin="lg">
|
||||||
@ -24,6 +26,12 @@ const RemoveOwnerForm = ({
|
|||||||
<Heading tag="h4" margin="lg">
|
<Heading tag="h4" margin="lg">
|
||||||
{`Actual number of owners: ${numOwners}, threhsold of safe: ${threshold}`}
|
{`Actual number of owners: ${numOwners}, threhsold of safe: ${threshold}`}
|
||||||
</Heading>
|
</Heading>
|
||||||
|
{ pendingTransactions &&
|
||||||
|
<SnackbarContent
|
||||||
|
variant="warning"
|
||||||
|
message="Be careful removing and owner might incur in some of the pending transactions could never be executed"
|
||||||
|
/>
|
||||||
|
}
|
||||||
<Block margin="md">
|
<Block margin="md">
|
||||||
<Field
|
<Field
|
||||||
name={DECREASE_PARAM}
|
name={DECREASE_PARAM}
|
||||||
|
@ -70,7 +70,7 @@ class RemoveOwner extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { safe, name } = this.props
|
const { safe, name, pendingTransactions } = this.props
|
||||||
const { done } = this.state
|
const { done } = this.state
|
||||||
const steps = getSteps()
|
const steps = getSteps()
|
||||||
const numOwners = safe.get('owners').count()
|
const numOwners = safe.get('owners').count()
|
||||||
@ -90,7 +90,13 @@ class RemoveOwner extends React.Component<Props, State> {
|
|||||||
onReset={this.onReset}
|
onReset={this.onReset}
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
>
|
>
|
||||||
<Stepper.Page numOwners={numOwners} threshold={threshold} name={name} disabled={disabled}>
|
<Stepper.Page
|
||||||
|
numOwners={numOwners}
|
||||||
|
threshold={threshold}
|
||||||
|
name={name}
|
||||||
|
disabled={disabled}
|
||||||
|
pendingTransactions={pendingTransactions}
|
||||||
|
>
|
||||||
{ RemoveOwnerForm }
|
{ RemoveOwnerForm }
|
||||||
</Stepper.Page>
|
</Stepper.Page>
|
||||||
<Stepper.Page name={name}>
|
<Stepper.Page name={name}>
|
||||||
|
@ -78,7 +78,7 @@ class GnoSafe extends React.PureComponent<SafeProps, State> {
|
|||||||
onRemoveOwner = (name: string, address: string) => {
|
onRemoveOwner = (name: string, address: string) => {
|
||||||
const { safe } = this.props
|
const { safe } = this.props
|
||||||
|
|
||||||
this.setState({ component: <RemoveOwner threshold={safe.get('threshold')} safe={safe} name={name} userToRemove={address} /> })
|
this.setState({ component: <RemoveOwner safeAddress={safe.get('address')} threshold={safe.get('threshold')} safe={safe} name={name} userToRemove={address} /> })
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user