add modify safe settings type

This commit is contained in:
mmv 2019-07-10 18:25:54 +04:00
parent 9b709f8e29
commit 9a999fd2ea
5 changed files with 34 additions and 23 deletions

View File

@ -27,6 +27,9 @@ const getTxData = (tx: Transaction) => {
} else if (Number(tx.value) > 0) {
txData.recipient = tx.recipient
txData.value = fromWei(toBN(tx.value), 'ether')
} else if (tx.modifySettingsTx) {
txData.recipient = tx.recipient
txData.modifySettingsTx = true
}
return txData
@ -44,11 +47,15 @@ type Props = {
}
const TxDescription = ({ tx, classes }: Props) => {
const { recipient, value } = getTxData(tx)
const { recipient, value, modifySettingsTx } = getTxData(tx)
return (
<Block className={classes.txDataContainer}>
<Paragraph noMargin>
{modifySettingsTx ? (
<Bold>Modify Safe Settings</Bold>
) : (
<>
<Bold>
Send
{' '}
@ -56,13 +63,15 @@ const TxDescription = ({ tx, classes }: Props) => {
{' '}
{tx.symbol}
{' '}
to:
to:
</Bold>
<br />
<a href={getEtherScanLink(recipient, 'rinkeby')} target="_blank" rel="noopener noreferrer">
{shortVersionOf(recipient, 4)}
<OpenInNew style={openIconStyle} />
</a>
</>
)}
</Paragraph>
</Block>
)

View File

@ -46,10 +46,9 @@ export const getTxTableData = (transactions: List<Transaction>): List<Transactio
const rows = transactions.map((tx: Transaction) => {
const txDate = tx.isExecuted ? tx.executionDate : tx.submissionDate
return {
[TX_TABLE_NONCE_ID]: tx.nonce,
[TX_TABLE_TYPE_ID]: 'Outgoing transfer',
[TX_TABLE_TYPE_ID]: tx.modifySettingsTx ? 'Modify Safe Settings' : 'Outgoing transfer',
[TX_TABLE_DATE_ID]: formatDate(tx.isExecuted ? tx.executionDate : tx.submissionDate),
[buildOrderFieldFrom(TX_TABLE_DATE_ID)]: getTime(txDate),
[TX_TABLE_AMOUNT_ID]: getTxAmount(tx),
@ -77,7 +76,7 @@ export const generateColumns = () => {
disablePadding: false,
label: 'Type',
custom: false,
width: 150,
width: 200,
}
const valueColumn: Column = {

View File

@ -90,6 +90,7 @@ const buildTransactionFrom = async (safeAddress: string, tx: TxServiceModel, saf
creationTxHash,
isTokenTransfer,
decodedParams,
modifySettingsTx: tx.to === safeAddress,
})
}

View File

@ -16,6 +16,7 @@ export type TransactionProps = {
submissionDate: Date,
executionDate: Date,
symbol: string,
modifySettingsTx: boolean,
creationTxHash: string,
executionTxHash?: string,
cancelled?: boolean,
@ -38,6 +39,7 @@ export const makeTransaction: RecordFactory<TransactionProps> = Record({
executionTxHash: undefined,
creationTxHash: '',
cancelled: false,
modifySettingsTx: false,
status: 'awaiting',
isTokenTransfer: false,
decodedParams: {},