mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-17 12:07:09 +00:00
Rename TX_NOTIFICATION_TYPES
This commit is contained in:
parent
85177d3ddd
commit
d159dba60e
@ -2,7 +2,7 @@
|
||||
import * as React from 'react'
|
||||
import { IconButton } from '@material-ui/core'
|
||||
import { Close as IconClose } from '@material-ui/icons'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import { type Notification, NOTIFICATIONS } from './notificationTypes'
|
||||
|
||||
type NotificationsQueue = {
|
||||
@ -108,31 +108,31 @@ export const getNofiticationsFromTxType = (txType: string) => {
|
||||
let notificationsQueue: NotificationsQueue
|
||||
|
||||
switch (txType) {
|
||||
case NOTIFIED_TRANSACTIONS.STANDARD_TX: {
|
||||
case TX_NOTIFICATION_TYPES.STANDARD_TX: {
|
||||
notificationsQueue = standardTxNotificationsQueue
|
||||
break
|
||||
}
|
||||
case NOTIFIED_TRANSACTIONS.CONFIRMATION_TX: {
|
||||
case TX_NOTIFICATION_TYPES.CONFIRMATION_TX: {
|
||||
notificationsQueue = confirmationTxNotificationsQueue
|
||||
break
|
||||
}
|
||||
case NOTIFIED_TRANSACTIONS.CANCELLATION_TX: {
|
||||
case TX_NOTIFICATION_TYPES.CANCELLATION_TX: {
|
||||
notificationsQueue = cancellationTxNotificationsQueue
|
||||
break
|
||||
}
|
||||
case NOTIFIED_TRANSACTIONS.OWNER_CHANGE_TX: {
|
||||
case TX_NOTIFICATION_TYPES.OWNER_CHANGE_TX: {
|
||||
notificationsQueue = ownerChangeTxNotificationsQueue
|
||||
break
|
||||
}
|
||||
case NOTIFIED_TRANSACTIONS.SAFE_NAME_CHANGE_TX: {
|
||||
case TX_NOTIFICATION_TYPES.SAFE_NAME_CHANGE_TX: {
|
||||
notificationsQueue = safeNameChangeNotificationsQueue
|
||||
break
|
||||
}
|
||||
case NOTIFIED_TRANSACTIONS.OWNER_NAME_CHANGE_TX: {
|
||||
case TX_NOTIFICATION_TYPES.OWNER_NAME_CHANGE_TX: {
|
||||
notificationsQueue = ownerNameChangeNotificationsQueue
|
||||
break
|
||||
}
|
||||
case NOTIFIED_TRANSACTIONS.THRESHOLD_CHANGE_TX: {
|
||||
case TX_NOTIFICATION_TYPES.THRESHOLD_CHANGE_TX: {
|
||||
notificationsQueue = thresholdChangeTxNotificationsQueue
|
||||
break
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ export type NotifiedTransaction = {
|
||||
THRESHOLD_CHANGE_TX: string,
|
||||
}
|
||||
|
||||
export const NOTIFIED_TRANSACTIONS: NotifiedTransaction = {
|
||||
export const TX_NOTIFICATION_TYPES: NotifiedTransaction = {
|
||||
STANDARD_TX: 'STANDARD_TX',
|
||||
CONFIRMATION_TX: 'CONFIRMATION_TX',
|
||||
CANCELLATION_TX: 'CANCELLATION_TX',
|
||||
|
@ -4,8 +4,6 @@ import { ETHEREUM_NETWORK_IDS, ETHEREUM_NETWORK } from '~/logic/wallets/getWeb3'
|
||||
import type { ProviderProps } from '~/logic/wallets/store/model/provider'
|
||||
import { makeProvider } from '~/logic/wallets/store/model/provider'
|
||||
import { NOTIFICATIONS, showSnackbar } from '~/logic/notifications'
|
||||
// import enqueueSnackbar as enqueueSnackbarAction from '~/logic/notifications/store/actions/enqueueSnackbar'
|
||||
// import closeSnackbar as closeSnackbarAction from '~/logic/notifications/store/actions/closeSnackbar'
|
||||
import addProvider from './addProvider'
|
||||
|
||||
export const processProviderResponse = (dispatch: ReduxDispatch<*>, provider: ProviderProps) => {
|
||||
|
@ -18,7 +18,7 @@ import { copyToClipboard } from '~/utils/clipboard'
|
||||
import SafeInfo from '~/routes/safe/components/Balances/SendModal/SafeInfo'
|
||||
import { setImageToPlaceholder } from '~/routes/safe/components/Balances/utils'
|
||||
import { getWeb3 } from '~/logic/wallets/getWeb3'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import { getEthAsToken } from '~/logic/tokens/utils/tokenHelpers'
|
||||
import ArrowDown from '../assets/arrow-down.svg'
|
||||
import { secondary } from '~/theme/variables'
|
||||
@ -67,7 +67,7 @@ const ReviewCustomTx = ({
|
||||
txRecipient,
|
||||
txValue,
|
||||
txData,
|
||||
NOTIFIED_TRANSACTIONS.STANDARD_TX,
|
||||
TX_NOTIFICATION_TYPES.STANDARD_TX,
|
||||
enqueueSnackbar,
|
||||
closeSnackbar,
|
||||
)
|
||||
|
@ -20,7 +20,7 @@ import { setImageToPlaceholder } from '~/routes/safe/components/Balances/utils'
|
||||
import { getStandardTokenContract } from '~/logic/tokens/store/actions/fetchTokens'
|
||||
import { EMPTY_DATA } from '~/logic/wallets/ethTransactions'
|
||||
import { getWeb3 } from '~/logic/wallets/getWeb3'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import ArrowDown from '../assets/arrow-down.svg'
|
||||
import { secondary } from '~/theme/variables'
|
||||
import { isEther } from '~/logic/tokens/utils/tokenHelpers'
|
||||
@ -81,7 +81,7 @@ const ReviewTx = ({
|
||||
txRecipient,
|
||||
txAmount,
|
||||
txData,
|
||||
NOTIFIED_TRANSACTIONS.STANDARD_TX,
|
||||
TX_NOTIFICATION_TYPES.STANDARD_TX,
|
||||
enqueueSnackbar,
|
||||
closeSnackbar,
|
||||
)
|
||||
|
@ -13,7 +13,7 @@ import Row from '~/components/layout/Row'
|
||||
import Paragraph from '~/components/layout/Paragraph'
|
||||
import Button from '~/components/layout/Button'
|
||||
import { getNofiticationsFromTxType, showSnackbar } from '~/logic/notifications'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import { styles } from './style'
|
||||
|
||||
export const SAFE_NAME_INPUT_TEST_ID = 'safe-name-input'
|
||||
@ -36,7 +36,7 @@ const ChangeSafeName = (props: Props) => {
|
||||
const handleSubmit = (values) => {
|
||||
updateSafe({ address: safeAddress, name: values.safeName })
|
||||
|
||||
const notification = getNofiticationsFromTxType(NOTIFIED_TRANSACTIONS.SAFE_NAME_CHANGE_TX)
|
||||
const notification = getNofiticationsFromTxType(TX_NOTIFICATION_TYPES.SAFE_NAME_CHANGE_TX)
|
||||
showSnackbar(notification.afterExecution, enqueueSnackbar, closeSnackbar)
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { withSnackbar } from 'notistack'
|
||||
import Modal from '~/components/Modal'
|
||||
import { type Owner } from '~/routes/safe/store/models/owner'
|
||||
import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import OwnerForm from './screens/OwnerForm'
|
||||
import ThresholdForm from './screens/ThresholdForm'
|
||||
import ReviewAddOwner from './screens/Review'
|
||||
@ -52,7 +52,7 @@ export const sendAddOwner = async (
|
||||
safeAddress,
|
||||
0,
|
||||
txData,
|
||||
NOTIFIED_TRANSACTIONS.OWNER_CHANGE_TX,
|
||||
TX_NOTIFICATION_TYPES.OWNER_CHANGE_TX,
|
||||
enqueueSnackbar,
|
||||
closeSnackbar,
|
||||
)
|
||||
|
@ -17,7 +17,7 @@ import Paragraph from '~/components/layout/Paragraph'
|
||||
import Identicon from '~/components/Identicon'
|
||||
import { composeValidators, required, minMaxLength } from '~/components/forms/validator'
|
||||
import { getNofiticationsFromTxType, showSnackbar } from '~/logic/notifications'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import { getEtherScanLink } from '~/logic/wallets/getWeb3'
|
||||
import Modal from '~/components/Modal'
|
||||
import { styles } from './style'
|
||||
@ -59,7 +59,7 @@ const EditOwnerComponent = ({
|
||||
const handleSubmit = (values) => {
|
||||
editSafeOwner({ safeAddress, ownerAddress, ownerName: values.ownerName })
|
||||
|
||||
const notification = getNofiticationsFromTxType(NOTIFIED_TRANSACTIONS.OWNER_NAME_CHANGE_TX)
|
||||
const notification = getNofiticationsFromTxType(TX_NOTIFICATION_TYPES.OWNER_NAME_CHANGE_TX)
|
||||
showSnackbar(notification.afterExecution, enqueueSnackbar, closeSnackbar)
|
||||
|
||||
onClose()
|
||||
|
@ -6,7 +6,7 @@ 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'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import CheckOwner from './screens/CheckOwner'
|
||||
import ThresholdForm from './screens/ThresholdForm'
|
||||
import ReviewRemoveOwner from './screens/Review'
|
||||
@ -64,7 +64,7 @@ export const sendRemoveOwner = async (
|
||||
safeAddress,
|
||||
0,
|
||||
txData,
|
||||
NOTIFIED_TRANSACTIONS.OWNER_CHANGE_TX,
|
||||
TX_NOTIFICATION_TYPES.OWNER_CHANGE_TX,
|
||||
enqueueSnackbar,
|
||||
closeSnackbar,
|
||||
)
|
||||
|
@ -4,7 +4,7 @@ import { List } from 'immutable'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import { withSnackbar } from 'notistack'
|
||||
import Modal from '~/components/Modal'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import { getGnosisSafeInstanceAt, SENTINEL_ADDRESS } from '~/logic/contracts/safeContracts'
|
||||
import OwnerForm from './screens/OwnerForm'
|
||||
import ReviewReplaceOwner from './screens/Review'
|
||||
@ -59,7 +59,7 @@ export const sendReplaceOwner = async (
|
||||
safeAddress,
|
||||
0,
|
||||
txData,
|
||||
NOTIFIED_TRANSACTIONS.OWNER_CHANGE_TX,
|
||||
TX_NOTIFICATION_TYPES.OWNER_CHANGE_TX,
|
||||
enqueueSnackbar,
|
||||
closeSnackbar,
|
||||
)
|
||||
|
@ -10,7 +10,7 @@ import Block from '~/components/layout/Block'
|
||||
import Row from '~/components/layout/Row'
|
||||
import Modal from '~/components/Modal'
|
||||
import Paragraph from '~/components/layout/Paragraph'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import ChangeThreshold from './ChangeThreshold'
|
||||
import type { Owner } from '~/routes/safe/store/models/owner'
|
||||
import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts'
|
||||
@ -52,7 +52,7 @@ const ThresholdSettings = ({
|
||||
safeAddress,
|
||||
0,
|
||||
txData,
|
||||
NOTIFIED_TRANSACTIONS.THRESHOLD_CHANGE_TX,
|
||||
TX_NOTIFICATION_TYPES.THRESHOLD_CHANGE_TX,
|
||||
enqueueSnackbar,
|
||||
closeSnackbar,
|
||||
)
|
||||
|
@ -13,7 +13,7 @@ import Row from '~/components/layout/Row'
|
||||
import Bold from '~/components/layout/Bold'
|
||||
import Block from '~/components/layout/Block'
|
||||
import Paragraph from '~/components/layout/Paragraph'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import { type Transaction } from '~/routes/safe/store/models/transaction'
|
||||
import { styles } from './style'
|
||||
|
||||
@ -72,7 +72,7 @@ const ApproveTxModal = ({
|
||||
safeAddress,
|
||||
tx,
|
||||
userAddress,
|
||||
NOTIFIED_TRANSACTIONS.CONFIRMATION_TX,
|
||||
TX_NOTIFICATION_TYPES.CONFIRMATION_TX,
|
||||
enqueueSnackbar,
|
||||
closeSnackbar,
|
||||
approveAndExecute,
|
||||
|
@ -13,7 +13,7 @@ import Block from '~/components/layout/Block'
|
||||
import Paragraph from '~/components/layout/Paragraph'
|
||||
import { type Transaction } from '~/routes/safe/store/models/transaction'
|
||||
import { EMPTY_DATA } from '~/logic/wallets/ethTransactions'
|
||||
import { NOTIFIED_TRANSACTIONS } from '~/logic/safe/transactions'
|
||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||
import { styles } from './style'
|
||||
|
||||
type Props = {
|
||||
@ -43,7 +43,7 @@ const CancelTxModal = ({
|
||||
safeAddress,
|
||||
0,
|
||||
EMPTY_DATA,
|
||||
NOTIFIED_TRANSACTIONS.CANCELLATION_TX,
|
||||
TX_NOTIFICATION_TYPES.CANCELLATION_TX,
|
||||
enqueueSnackbar,
|
||||
closeSnackbar,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user