mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-24 09:18:09 +00:00
Fix pending transactions styling
This commit is contained in:
parent
5329460d89
commit
3202ba2f6d
@ -246,7 +246,7 @@ export const init = (): AsyncAction => async (dispatch: Dispatch, getState: GetS
|
|||||||
|
|
||||||
|
|
||||||
// const gasPrice: BigNumber = new BigNumber(EthereumjsUnits.convert(web3.gasPrice, 'wei', 'gwei')) || new BigNumber(network.defaultGasPrice);
|
// const gasPrice: BigNumber = new BigNumber(EthereumjsUnits.convert(web3.gasPrice, 'wei', 'gwei')) || new BigNumber(network.defaultGasPrice);
|
||||||
const gasPrice: BigNumber = await dispatch( BlockchainActions.getGasPrice(network.network, network.defaultGasPrice) );
|
const gasPrice: BigNumber = await dispatch(BlockchainActions.getGasPrice(network.network, network.defaultGasPrice));
|
||||||
// const gasPrice: BigNumber = new BigNumber(network.defaultGasPrice);
|
// const gasPrice: BigNumber = new BigNumber(network.defaultGasPrice);
|
||||||
const gasLimit: string = network.defaultGasLimit.toString();
|
const gasLimit: string = network.defaultGasLimit.toString();
|
||||||
const feeLevels: Array<FeeLevel> = getFeeLevels(network.symbol, gasPrice, gasLimit);
|
const feeLevels: Array<FeeLevel> = getFeeLevels(network.symbol, gasPrice, gasLimit);
|
||||||
@ -733,7 +733,7 @@ const estimateGasPrice = (): AsyncAction => async (dispatch: Dispatch, getState:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gasLimit: number = await dispatch( BlockchainActions.estimateGasLimit(network.network, state.data, state.amount, state.gasPrice) );
|
const gasLimit: number = await dispatch(BlockchainActions.estimateGasLimit(network.network, state.data, state.amount, state.gasPrice));
|
||||||
|
|
||||||
if (getState().sendForm.data === requestedData) {
|
if (getState().sendForm.data === requestedData) {
|
||||||
dispatch(onGasLimitChange(gasLimit.toString()));
|
dispatch(onGasLimitChange(gasLimit.toString()));
|
||||||
@ -783,7 +783,7 @@ export const onSend = (): AsyncAction => async (dispatch: Dispatch, getState: Ge
|
|||||||
const pendingNonce: number = stateUtils.getPendingNonce(pending);
|
const pendingNonce: number = stateUtils.getPendingNonce(pending);
|
||||||
const nonce = pendingNonce > 0 && pendingNonce >= account.nonce ? pendingNonce : account.nonce;
|
const nonce = pendingNonce > 0 && pendingNonce >= account.nonce ? pendingNonce : account.nonce;
|
||||||
|
|
||||||
const txData = await dispatch( prepareEthereumTx({
|
const txData = await dispatch(prepareEthereumTx({
|
||||||
network: network.network,
|
network: network.network,
|
||||||
token: isToken ? findToken(getState().tokens, account.address, currentState.currency, account.deviceState) : null,
|
token: isToken ? findToken(getState().tokens, account.address, currentState.currency, account.deviceState) : null,
|
||||||
from: account.address,
|
from: account.address,
|
||||||
@ -792,8 +792,8 @@ export const onSend = (): AsyncAction => async (dispatch: Dispatch, getState: Ge
|
|||||||
data: currentState.data,
|
data: currentState.data,
|
||||||
gasLimit: currentState.gasLimit,
|
gasLimit: currentState.gasLimit,
|
||||||
gasPrice: currentState.gasPrice,
|
gasPrice: currentState.gasPrice,
|
||||||
nonce
|
nonce,
|
||||||
}) );
|
}));
|
||||||
|
|
||||||
const selected: ?TrezorDevice = getState().wallet.selectedDevice;
|
const selected: ?TrezorDevice = getState().wallet.selectedDevice;
|
||||||
if (!selected) return;
|
if (!selected) return;
|
||||||
@ -828,14 +828,14 @@ export const onSend = (): AsyncAction => async (dispatch: Dispatch, getState: Ge
|
|||||||
txData.v = signedTransaction.payload.v;
|
txData.v = signedTransaction.payload.v;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const serializedTx: string = await dispatch( serializeEthereumTx(txData) );
|
const serializedTx: string = await dispatch(serializeEthereumTx(txData));
|
||||||
const push = await TrezorConnect.pushTransaction({
|
const push = await TrezorConnect.pushTransaction({
|
||||||
tx: serializedTx,
|
tx: serializedTx,
|
||||||
coin: network.network
|
coin: network.network,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!push.success) {
|
if (!push.success) {
|
||||||
throw new Error( push.payload.error );
|
throw new Error(push.payload.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
const txid = push.payload.txid;
|
const txid = push.payload.txid;
|
||||||
|
@ -18,12 +18,17 @@ type Props = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
|
padding-top: 20px;
|
||||||
border-top: 1px solid ${colors.DIVIDER};
|
border-top: 1px solid ${colors.DIVIDER};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const StyledLink = styled(Link)`
|
||||||
|
text-decoration: none;
|
||||||
|
`;
|
||||||
|
|
||||||
const TransactionWrapper = styled.div`
|
const TransactionWrapper = styled.div`
|
||||||
border-bottom: 1px solid ${colors.DIVIDER};
|
border-bottom: 1px solid ${colors.DIVIDER};
|
||||||
padding: 14px 48px;
|
padding: 14px 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -54,7 +59,9 @@ const TransactionName = styled.div`
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const TransactionAmount = styled.div``;
|
const TransactionAmount = styled.div`
|
||||||
|
color: colors.TEXT_SECONDARY;
|
||||||
|
`;
|
||||||
|
|
||||||
class PendingTransactions extends Component<Props> {
|
class PendingTransactions extends Component<Props> {
|
||||||
getPendingTransactions() {
|
getPendingTransactions() {
|
||||||
@ -142,13 +149,14 @@ class PendingTransactions extends Component<Props> {
|
|||||||
</TransactionIcon>
|
</TransactionIcon>
|
||||||
|
|
||||||
<TransactionName>
|
<TransactionName>
|
||||||
<Link
|
<StyledLink
|
||||||
href={`${this.props.network.explorer.tx}${tx.id}`}
|
href={`${this.props.network.explorer.tx}${tx.id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener"
|
rel="noreferrer noopener"
|
||||||
|
isGray
|
||||||
>
|
>
|
||||||
{this.getTransactionName(tx)}
|
{this.getTransactionName(tx)}
|
||||||
</Link>
|
</StyledLink>
|
||||||
</TransactionName>
|
</TransactionName>
|
||||||
|
|
||||||
<TransactionAmount>
|
<TransactionAmount>
|
||||||
|
Loading…
Reference in New Issue
Block a user