-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(suite): mark potentially phishy zero-value transactions
- Loading branch information
Showing
14 changed files
with
256 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
...ages/suite/src/components/wallet/TransactionItem/components/TokenTransferAddressLabel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { ArrayElement } from '@trezor/type-utils'; | ||
import { Translation, AddressLabeling } from '@suite-components'; | ||
import { WalletAccountTransaction } from '@wallet-types'; | ||
import { ArrayElement } from '@trezor/type-utils'; | ||
|
||
const BlurWrapper = styled.span<{ isBlurred: boolean }>` | ||
filter: ${({ isBlurred }) => isBlurred && 'blur(2px)'}; | ||
`; | ||
|
||
interface TokenTransferAddressLabelProps { | ||
transfer: ArrayElement<WalletAccountTransaction['tokens']>; | ||
type: WalletAccountTransaction['type']; | ||
isZeroValuePhishing: boolean; | ||
} | ||
|
||
export const TokenTransferAddressLabel = ({ transfer, type }: TokenTransferAddressLabelProps) => { | ||
export const TokenTransferAddressLabel = ({ | ||
transfer, | ||
type, | ||
isZeroValuePhishing, | ||
}: TokenTransferAddressLabelProps) => { | ||
if (type === 'self') { | ||
return <Translation id="TR_SENT_TO_SELF" />; | ||
} | ||
if (type === 'sent') { | ||
return <AddressLabeling address={transfer.to} />; | ||
} | ||
|
||
return <>{transfer.to}</>; | ||
return <BlurWrapper isBlurred={isZeroValuePhishing}>{transfer.to}</BlurWrapper>; | ||
}; |
Oops, something went wrong.