Skip to content

Commit b6de9c9

Browse files
TomasBodatomasklim
authored andcommitted
refactor(suite): renamed currency to cryptoId
1 parent 0b15d7f commit b6de9c9

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

packages/suite/src/types/coinmarket/coinmarketVerify.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface CoinmarketVerifyFormAccountOptionProps {
2020
}
2121

2222
export interface CoinmarketVerifyAccountProps {
23-
currency: CryptoId | undefined;
23+
cryptoId: CryptoId | undefined;
2424
}
2525

2626
export interface CoinmarketGetTranslationIdsProps {

packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferBuy/CoinmarketOfferBuy.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ export const CoinmarketOfferBuy = ({
1414
paymentMethod,
1515
paymentMethodName,
1616
}: CoinmarketOfferBuyProps) => {
17-
const currency = selectedQuote?.receiveCurrency;
18-
const coinmarketVerifyAccount = useCoinmarketVerifyAccount({ currency });
17+
const cryptoId = selectedQuote?.receiveCurrency;
18+
const coinmarketVerifyAccount = useCoinmarketVerifyAccount({ cryptoId });
1919

2020
return (
2121
<>
2222
<Card>
23-
{currency && (
23+
{cryptoId && (
2424
<CoinmarketVerify
2525
coinmarketVerifyAccount={coinmarketVerifyAccount}
26-
currency={currency}
26+
cryptoId={cryptoId}
2727
/>
2828
)}
2929
</Card>

packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchange.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ export const CoinmarketOfferExchange = ({
2525
quoteAmounts,
2626
}: CoinmarketOfferExchangeProps) => {
2727
const { exchangeStep } = useCoinmarketFormContext<CoinmarketTradeExchangeType>();
28-
const currency = selectedQuote?.receive;
29-
const coinmarketVerifyAccount = useCoinmarketVerifyAccount({ currency });
28+
const cryptoId = selectedQuote?.receive;
29+
const coinmarketVerifyAccount = useCoinmarketVerifyAccount({ cryptoId });
3030

3131
const steps: CoinmarketSelectedOfferStepperItemProps[] = [
3232
{
3333
step: 'RECEIVING_ADDRESS',
3434
translationId: 'TR_EXCHANGE_VERIFY_ADDRESS_STEP',
3535
isActive: exchangeStep === 'RECEIVING_ADDRESS',
36-
component: currency ? (
36+
component: cryptoId ? (
3737
<CoinmarketVerify
3838
coinmarketVerifyAccount={coinmarketVerifyAccount}
39-
currency={currency}
39+
cryptoId={cryptoId}
4040
/>
4141
) : null,
4242
},

packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerify.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import { getCoinmarketNetworkDisplaySymbol } from 'src/utils/wallet/coinmarket/c
2727

2828
interface CoinmarketVerifyProps {
2929
coinmarketVerifyAccount: CoinmarketVerifyAccountReturnProps;
30-
currency: CryptoId;
30+
cryptoId: CryptoId;
3131
}
3232

33-
export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: CoinmarketVerifyProps) => {
33+
export const CoinmarketVerify = ({ coinmarketVerifyAccount, cryptoId }: CoinmarketVerifyProps) => {
3434
const dispatch = useDispatch();
3535
const { translationString } = useTranslation();
3636
const { cryptoIdToCoinSymbol, cryptoIdToNativeCoinSymbol } = useCoinmarketInfo();
@@ -60,13 +60,13 @@ export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: Coinmark
6060
const { accountTooltipTranslationId, addressTooltipTranslationId } = getTranslationIds(
6161
selectedAccountOption?.type,
6262
);
63-
const coinSymbol = getCoinmarketNetworkDisplaySymbol(cryptoIdToCoinSymbol(currency) ?? '');
63+
const coinSymbol = getCoinmarketNetworkDisplaySymbol(cryptoIdToCoinSymbol(cryptoId) ?? '');
6464

6565
const { ref: networkRef, ...networkField } = form.register('address', {
6666
required: translationString('TR_EXCHANGE_RECEIVING_ADDRESS_REQUIRED'),
6767
validate: value => {
68-
if (selectedAccountOption?.type === 'NON_SUITE' && currency) {
69-
const symbol = cryptoIdToNativeCoinSymbol(currency);
68+
if (selectedAccountOption?.type === 'NON_SUITE' && cryptoId) {
69+
const symbol = cryptoIdToNativeCoinSymbol(cryptoId);
7070
if (value && !addressValidator.validate(value, symbol)) {
7171
return translationString('TR_EXCHANGE_RECEIVING_ADDRESS_INVALID');
7272
}
@@ -111,7 +111,7 @@ export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: Coinmark
111111
/>
112112
</Paragraph>
113113
<CoinmarketVerifyOptions
114-
receiveNetwork={currency}
114+
receiveNetwork={cryptoId}
115115
selectedAccountOption={selectedAccountOption}
116116
selectAccountOptions={selectAccountOptions}
117117
isMenuOpen={isMenuOpen}
@@ -129,7 +129,7 @@ export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: Coinmark
129129
account={selectedAccountOption?.account}
130130
address={address}
131131
control={form.control}
132-
receiveSymbol={currency}
132+
receiveSymbol={cryptoId}
133133
setValue={form.setValue}
134134
label={
135135
<Tooltip

0 commit comments

Comments
 (0)