Skip to content

Commit

Permalink
refactor(suite): renamed currency to cryptoId
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasBoda authored and tomasklim committed Jan 3, 2025
1 parent 0b15d7f commit b6de9c9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/suite/src/types/coinmarket/coinmarketVerify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface CoinmarketVerifyFormAccountOptionProps {
}

export interface CoinmarketVerifyAccountProps {
currency: CryptoId | undefined;
cryptoId: CryptoId | undefined;
}

export interface CoinmarketGetTranslationIdsProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ export const CoinmarketOfferBuy = ({
paymentMethod,
paymentMethodName,
}: CoinmarketOfferBuyProps) => {
const currency = selectedQuote?.receiveCurrency;
const coinmarketVerifyAccount = useCoinmarketVerifyAccount({ currency });
const cryptoId = selectedQuote?.receiveCurrency;
const coinmarketVerifyAccount = useCoinmarketVerifyAccount({ cryptoId });

return (
<>
<Card>
{currency && (
{cryptoId && (
<CoinmarketVerify
coinmarketVerifyAccount={coinmarketVerifyAccount}
currency={currency}
cryptoId={cryptoId}
/>
)}
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ export const CoinmarketOfferExchange = ({
quoteAmounts,
}: CoinmarketOfferExchangeProps) => {
const { exchangeStep } = useCoinmarketFormContext<CoinmarketTradeExchangeType>();
const currency = selectedQuote?.receive;
const coinmarketVerifyAccount = useCoinmarketVerifyAccount({ currency });
const cryptoId = selectedQuote?.receive;
const coinmarketVerifyAccount = useCoinmarketVerifyAccount({ cryptoId });

const steps: CoinmarketSelectedOfferStepperItemProps[] = [
{
step: 'RECEIVING_ADDRESS',
translationId: 'TR_EXCHANGE_VERIFY_ADDRESS_STEP',
isActive: exchangeStep === 'RECEIVING_ADDRESS',
component: currency ? (
component: cryptoId ? (
<CoinmarketVerify
coinmarketVerifyAccount={coinmarketVerifyAccount}
currency={currency}
cryptoId={cryptoId}
/>
) : null,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import { getCoinmarketNetworkDisplaySymbol } from 'src/utils/wallet/coinmarket/c

interface CoinmarketVerifyProps {
coinmarketVerifyAccount: CoinmarketVerifyAccountReturnProps;
currency: CryptoId;
cryptoId: CryptoId;
}

export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: CoinmarketVerifyProps) => {
export const CoinmarketVerify = ({ coinmarketVerifyAccount, cryptoId }: CoinmarketVerifyProps) => {
const dispatch = useDispatch();
const { translationString } = useTranslation();
const { cryptoIdToCoinSymbol, cryptoIdToNativeCoinSymbol } = useCoinmarketInfo();
Expand Down Expand Up @@ -60,13 +60,13 @@ export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: Coinmark
const { accountTooltipTranslationId, addressTooltipTranslationId } = getTranslationIds(
selectedAccountOption?.type,
);
const coinSymbol = getCoinmarketNetworkDisplaySymbol(cryptoIdToCoinSymbol(currency) ?? '');
const coinSymbol = getCoinmarketNetworkDisplaySymbol(cryptoIdToCoinSymbol(cryptoId) ?? '');

const { ref: networkRef, ...networkField } = form.register('address', {
required: translationString('TR_EXCHANGE_RECEIVING_ADDRESS_REQUIRED'),
validate: value => {
if (selectedAccountOption?.type === 'NON_SUITE' && currency) {
const symbol = cryptoIdToNativeCoinSymbol(currency);
if (selectedAccountOption?.type === 'NON_SUITE' && cryptoId) {
const symbol = cryptoIdToNativeCoinSymbol(cryptoId);
if (value && !addressValidator.validate(value, symbol)) {
return translationString('TR_EXCHANGE_RECEIVING_ADDRESS_INVALID');
}
Expand Down Expand Up @@ -111,7 +111,7 @@ export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: Coinmark
/>
</Paragraph>
<CoinmarketVerifyOptions
receiveNetwork={currency}
receiveNetwork={cryptoId}
selectedAccountOption={selectedAccountOption}
selectAccountOptions={selectAccountOptions}
isMenuOpen={isMenuOpen}
Expand All @@ -129,7 +129,7 @@ export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: Coinmark
account={selectedAccountOption?.account}
address={address}
control={form.control}
receiveSymbol={currency}
receiveSymbol={cryptoId}
setValue={form.setValue}
label={
<Tooltip
Expand Down

0 comments on commit b6de9c9

Please sign in to comment.