diff --git a/suite-native/notifications/src/components/TransactionNotification.tsx b/suite-native/notifications/src/components/TransactionNotification.tsx index 67f96987040..7db45b76556 100644 --- a/suite-native/notifications/src/components/TransactionNotification.tsx +++ b/suite-native/notifications/src/components/TransactionNotification.tsx @@ -125,7 +125,6 @@ export const TransactionNotification = ({ transactionType={transactionType} symbol={notification.symbol} isAnimated={isIconAnimated} - iconColor={isIconAnimated ? 'iconAlertYellow' : 'iconSubdued'} /> } iconRight={} diff --git a/suite-native/transactions/src/components/TransactionDetail/TransactionDetailHeader.tsx b/suite-native/transactions/src/components/TransactionDetail/TransactionDetailHeader.tsx index b1451fa58b8..a75307fb825 100644 --- a/suite-native/transactions/src/components/TransactionDetail/TransactionDetailHeader.tsx +++ b/suite-native/transactions/src/components/TransactionDetail/TransactionDetailHeader.tsx @@ -1,20 +1,20 @@ -import { Badge, Box, DiscreetTextTrigger, Text, VStack } from '@suite-native/atoms'; -import { isPending } from '@suite-common/wallet-utils'; import { AccountKey } from '@suite-common/wallet-types'; +import { isPending } from '@suite-common/wallet-utils'; +import { Badge, Box, DiscreetTextTrigger, Text, VStack } from '@suite-native/atoms'; import { CryptoAmountFormatter, CryptoToFiatAmountFormatter, + SignValueFormatter, TokenAmountFormatter, TokenToFiatAmountFormatter, - SignValueFormatter, } from '@suite-native/formatters'; +import { Translation } from '@suite-native/intl'; import { TypedTokenTransfer, WalletAccountTransaction } from '@suite-native/tokens'; import { prepareNativeStyle, useNativeStyles } from '@trezor/styles'; -import { Translation } from '@suite-native/intl'; import { useTransactionFiatRate } from '../../hooks/useTransactionFiatRate'; -import { TransactionIcon } from '../TransactionsList/TransactionIcon'; import { getTransactionValueSign } from '../../utils'; +import { TransactionIcon } from '../TransactionsList/TransactionIcon'; type TransactionDetailHeaderProps = { transaction: WalletAccountTransaction; @@ -22,9 +22,6 @@ type TransactionDetailHeaderProps = { accountKey: AccountKey; }; -const ICON_SIZE = 56; -const ICON_SPINNER_WIDTH = 3; - const failedTxStyle = prepareNativeStyle<{ isFailedTx: boolean }>((_, { isFailedTx }) => ({ extend: { condition: isFailedTx, @@ -65,11 +62,8 @@ export const TransactionDetailHeader = ({ diff --git a/suite-native/transactions/src/components/TransactionsList/TransactionIcon.tsx b/suite-native/transactions/src/components/TransactionsList/TransactionIcon.tsx index 99f391be8a3..4b76fa3a424 100644 --- a/suite-native/transactions/src/components/TransactionsList/TransactionIcon.tsx +++ b/suite-native/transactions/src/components/TransactionsList/TransactionIcon.tsx @@ -12,16 +12,11 @@ type TransactionIconProps = { symbol?: NetworkSymbol; contractAddress?: TokenAddress; isAnimated?: boolean; - iconColor?: Color; - spinnerColor?: Color; - spinnerWidth?: number; backgroundColor?: Color; containerSize?: number; iconSize?: IconSize; }; -const DEFAULT_CONTAINER_SIZE = 48; - const transactionIconMap: Record = { recv: 'arrowDown', sent: 'arrowUp', @@ -46,12 +41,9 @@ export const TransactionIcon = ({ contractAddress, transactionType, backgroundColor, - spinnerColor, - spinnerWidth, - containerSize = DEFAULT_CONTAINER_SIZE, + containerSize = 48, iconSize = 'mediumLarge', isAnimated = false, - iconColor = 'iconSubdued', }: TransactionIconProps) => { const { applyStyle } = useNativeStyles(); @@ -59,7 +51,6 @@ export const TransactionIcon = ({ )} {symbol && ( diff --git a/suite-native/transactions/src/components/TransactionsList/TransactionIconSpinner.tsx b/suite-native/transactions/src/components/TransactionsList/TransactionIconSpinner.tsx index c356cb5391a..a858c69b9a5 100644 --- a/suite-native/transactions/src/components/TransactionsList/TransactionIconSpinner.tsx +++ b/suite-native/transactions/src/components/TransactionsList/TransactionIconSpinner.tsx @@ -17,22 +17,17 @@ import { ENDLESS_ANIMATION_VALUE } from '@suite-native/atoms'; type TransactionIconSpinnerProps = { size: number; color: Color; - width?: number; + width: number; }; const FULL_CIRCLE_TURN = 360; const ROTATION_DURATION = 2500; -const DEFAULT_STROKE_WIDTH = 8; const ContainerStyle = prepareNativeStyle(_ => ({ position: 'absolute', })); -export const TransactionIconSpinner = ({ - size, - color, - width = DEFAULT_STROKE_WIDTH, -}: TransactionIconSpinnerProps) => { +export const TransactionIconSpinner = ({ size, color, width }: TransactionIconSpinnerProps) => { const { applyStyle, utils } = useNativeStyles(); const rotation = useSharedValue(0); diff --git a/suite-native/transactions/src/components/TransactionsList/TransactionListItemContainer.tsx b/suite-native/transactions/src/components/TransactionsList/TransactionListItemContainer.tsx index 2fde478cb19..c477f55c661 100644 --- a/suite-native/transactions/src/components/TransactionsList/TransactionListItemContainer.tsx +++ b/suite-native/transactions/src/components/TransactionsList/TransactionListItemContainer.tsx @@ -4,6 +4,7 @@ import { useSelector } from 'react-redux'; import { useNavigation } from '@react-navigation/native'; +import { isPending } from '@suite-common/wallet-utils'; import { AccountKey, TransactionType, WalletAccountTransaction } from '@suite-common/wallet-types'; import { prepareNativeStyle, useNativeStyles } from '@trezor/styles'; import { @@ -15,14 +16,12 @@ import { Badge, Box, DiscreetText, HStack, Text } from '@suite-native/atoms'; import { useFormatters } from '@suite-common/formatters'; import { selectIsPhishingTransaction, - selectIsTransactionPending, selectTransactionBlockTimeById, selectTransactionByAccountKeyAndTxid, TransactionsRootState, } from '@suite-common/wallet-core'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { TypedTokenTransfer } from '@suite-native/tokens'; -import { Color } from '@trezor/theme'; import { Translation } from '@suite-native/intl'; import { TokenDefinitionsRootState } from '@suite-common/token-definitions'; @@ -129,16 +128,12 @@ export const TransactionListItemContainer = ({ selectTransactionBlockTimeById(state, accountKey, txid), ); - const isTransactionPending = useSelector((state: TransactionsRootState) => - selectIsTransactionPending(state, txid, accountKey), - ); - + const isTransactionPending = isPending(transaction); const isPhishingTransaction = useSelector( (state: TokenDefinitionsRootState & TransactionsRootState) => selectIsPhishingTransaction(state, txid, accountKey), ); - const iconColor: Color = isTransactionPending ? 'backgroundAlertYellowBold' : 'iconSubdued'; const coinSymbol = isPhishingTransaction ? undefined : symbol; const contractAddress = isPhishingTransaction ? undefined : tokenTransfer?.contract; @@ -155,7 +150,6 @@ export const TransactionListItemContainer = ({ contractAddress={contractAddress} transactionType={transactionType} isAnimated={isTransactionPending} - iconColor={iconColor} />