Skip to content

Commit e2ea915

Browse files
committed
feat(suite): display view-only address labels in coin control
1 parent b7b4f6f commit e2ea915

File tree

1 file changed

+14
-4
lines changed
  • packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection

1 file changed

+14
-4
lines changed

packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoSelection.tsx

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { MouseEventHandler, ReactNode } from 'react';
33
import styled, { css, useTheme } from 'styled-components';
44

55
import { formatNetworkAmount, isSameUtxo } from '@suite-common/wallet-utils';
6-
import { Checkbox, Row, Spinner, TextButton, Tooltip } from '@trezor/components';
6+
import { Checkbox, Row, Spinner, Text, TextButton, Tooltip } from '@trezor/components';
77
import { CheckContainer } from '@trezor/components/src/components/form/Checkbox/Checkbox';
88
import { AccountUtxo } from '@trezor/connect';
99
import { borders, spacings, spacingsPx, typography } from '@trezor/theme';
@@ -174,7 +174,7 @@ export const UtxoSelection = ({ transaction, utxo }: UtxoSelectionProps) => {
174174
},
175175
} = useSendFormContext();
176176
// selecting metadata from store rather than send form context which does not update on metadata change
177-
const { outputLabels } = useSelector(selectLabelingDataForSelectedAccount);
177+
const { addressLabels, outputLabels } = useSelector(selectLabelingDataForSelectedAccount);
178178

179179
const dispatch = useDispatch();
180180

@@ -247,8 +247,18 @@ export const UtxoSelection = ({ transaction, utxo }: UtxoSelectionProps) => {
247247
iconColor={utxoTagIconColor}
248248
/>
249249
)}
250-
251-
<Address>{utxo.address}</Address>
250+
<Text typographyStyle="hint">
251+
<MetadataLabeling
252+
payload={{
253+
type: 'addressLabel',
254+
entityKey: account.key,
255+
defaultValue: utxo.address,
256+
value: addressLabels[utxo.address],
257+
}}
258+
isDisabled
259+
defaultVisibleValue={<Address>{utxo.address}</Address>}
260+
/>
261+
</Text>
252262

253263
<StyledCryptoAmount
254264
value={formatNetworkAmount(utxo.amount, account.symbol)}

0 commit comments

Comments
 (0)