move notifications to separate file so processTransaction and createTransaction actions able to use it

This commit is contained in:
Mikhail Mikheev 2019-09-05 15:22:32 +04:00
parent 816b3c5ab5
commit 3660174530
4 changed files with 24 additions and 17 deletions

View File

@ -4,3 +4,4 @@ export * from './send'
export * from './safeBlockchainOperations' export * from './safeBlockchainOperations'
export * from './safeTxSignerEIP712' export * from './safeTxSignerEIP712'
export * from './txHistory' export * from './txHistory'
export * from './notifications'

View File

@ -0,0 +1,14 @@
// @flow
export type Notifications = {
BEFORE_EXECUTION_OR_CREATION: string,
AFTER_EXECUTION: string,
CREATED_MORE_CONFIRMATIONS_NEEDED: string,
ERROR: string,
}
export const DEFAULT_NOTIFICATIONS: Notifications = {
BEFORE_EXECUTION_OR_CREATION: 'Transaction in progress',
AFTER_EXECUTION: 'Transaction successfully executed',
CREATED_MORE_CONFIRMATIONS_NEEDED: 'Transaction in progress: More confirmations required to execute',
ERROR: 'Transaction failed',
}

View File

@ -36,7 +36,7 @@ const Transactions = ({
const hasTransactions = transactions.size > 0 const hasTransactions = transactions.size > 0
return ( return (
<React.Fragment> <>
{hasTransactions ? ( {hasTransactions ? (
<TxsTable <TxsTable
transactions={transactions} transactions={transactions}
@ -51,7 +51,7 @@ const Transactions = ({
) : ( ) : (
<NoTransactions /> <NoTransactions />
)} )}
</React.Fragment> </>
) )
} }

View File

@ -5,21 +5,13 @@ import { userAccountSelector } from '~/logic/wallets/store/selectors'
import fetchTransactions from '~/routes/safe/store/actions/fetchTransactions' import fetchTransactions from '~/routes/safe/store/actions/fetchTransactions'
import { type GlobalState } from '~/store' import { type GlobalState } from '~/store'
import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts' import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts'
import { approveTransaction, executeTransaction, CALL } from '~/logic/safe/transactions' import {
approveTransaction,
export type Notifications = { executeTransaction,
BEFORE_EXECUTION_OR_CREATION: string, CALL,
AFTER_EXECUTION: string, type Notifications,
CREATED_MORE_CONFIRMATIONS_NEEDED: string, DEFAULT_NOTIFICATIONS,
ERROR: string, } from '~/logic/safe/transactions'
}
const DEFAULT_NOTIFICATIONS: Notifications = {
BEFORE_EXECUTION_OR_CREATION: 'Transaction in progress',
AFTER_EXECUTION: 'Transaction successfully executed',
CREATED_MORE_CONFIRMATIONS_NEEDED: 'Transaction in progress: More confirmations required to execute',
ERROR: 'Transaction failed',
}
const createTransaction = ( const createTransaction = (
safeAddress: string, safeAddress: string,