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 committed Jan 2, 2025
1 parent 465685a commit f4a0ebc
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 @@ -26,10 +26,10 @@ import {

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 @@ -63,8 +63,8 @@ export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: Coinmark
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 @@ -105,11 +105,11 @@ export const CoinmarketVerify = ({ coinmarketVerifyAccount, currency }: Coinmark
<Paragraph typographyStyle="hint" variant="tertiary">
<Translation
id="TR_EXCHANGE_RECEIVING_ADDRESS_INFO"
values={{ symbol: cryptoIdToCoinSymbol(currency) }}
values={{ symbol: cryptoIdToCoinSymbol(cryptoId) }}
/>
</Paragraph>
<CoinmarketVerifyOptions
receiveNetwork={currency}
receiveNetwork={cryptoId}
selectedAccountOption={selectedAccountOption}
selectAccountOptions={selectAccountOptions}
isMenuOpen={isMenuOpen}
Expand All @@ -127,7 +127,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 f4a0ebc

Please sign in to comment.