fix: build

This commit is contained in:
AzizbekFayziyev 2025-08-13 14:15:53 +05:00
parent 113c125d47
commit 5ca9dc4bea
52 changed files with 21 additions and 25 deletions

View file

@ -2,5 +2,5 @@ export interface AssetRowProps {
name: string;
link: string;
id: string;
code: string | undefined;
code: string | undefined | null;
}

View file

@ -1,8 +1,9 @@
import Image from 'next/image';
import { getAssetIcon } from '@/utils/utils';
import { CurrencyIconProps } from './types';
const CurrencyIcon = ({ code, size = 50 }: CurrencyIconProps) => (
<Image width={size} height={size} src={`/currencies/trade_${code}.svg`} alt="currency" />
<Image width={size} height={size} src={getAssetIcon(String(code))} alt="currency" />
);
export default CurrencyIcon;

View file

@ -1,4 +1,4 @@
export interface CurrencyIconProps {
code: string | undefined;
code: string | undefined | null;
size?: number;
}

View file

@ -3,16 +3,13 @@ import { ReactComponent as UpIcon } from '@/assets/images/UI/up_icon.svg';
import { ReactComponent as DownIcon } from '@/assets/images/UI/down_icon.svg';
import { ReactComponent as VolumeIcon } from '@/assets/images/UI/volume_icon.svg';
import BackButton from '@/components/default/BackButton/BackButton';
import { tradingKnownCurrencies, roundTo, notationToString } from '@/utils/utils';
import { roundTo, notationToString } from '@/utils/utils';
import styles from './styles.module.scss';
import StatItem from '../StatItem';
import { TradingHeaderProps } from './types';
import CurrencyIcon from './components/CurrencyIcon';
import AssetRow from './components/AssetRow';
const getCurrencyCode = (code?: string) =>
tradingKnownCurrencies.includes(code || '') ? code : 'tsds';
const TradingHeader = ({
pairStats,
pairRateUsd,
@ -28,8 +25,6 @@ const TradingHeader = ({
};
const { firstCurrencyName, secondCurrencyName } = currencyNames;
const imgCode = getCurrencyCode(pairData?.first_currency?.code || '');
const imgCode2 = getCurrencyCode(pairData?.second_currency?.code || '');
const coefficient = pairStats?.coefficient || 0;
const coefficientOutput =
@ -65,7 +60,7 @@ const TradingHeader = ({
<div className={styles.header}>
<div className={styles.header__currency}>
<div className={styles.header__currency_icon}>
<CurrencyIcon code={imgCode} />
<CurrencyIcon code={firstAssetId} />
</div>
<div className={styles.header__currency_item}>
@ -96,13 +91,13 @@ const TradingHeader = ({
name={firstCurrencyName}
link={firstAssetLink}
id={firstAssetId || ''}
code={imgCode}
code={firstAssetId}
/>
<AssetRow
name={secondCurrencyName}
link={secondAssetLink}
id={secondAssetId || ''}
code={imgCode2}
code={secondAssetId}
/>
</div>
)}

View file

@ -2,7 +2,7 @@ import { useState, useEffect } from 'react';
import Decimal from 'decimal.js';
import PairData from '@/interfaces/common/PairData';
import OrderFormOutput from '@/interfaces/common/orderFormOutput';
import { handleInputChange } from '../helpers/handleInputChange';
import { handleInputChange } from '@/utils/handleInputChange';
interface UseOrderFormParams {
type: 'buy' | 'sell';

View file

@ -18,18 +18,18 @@ import { Trade } from '@/interfaces/responses/trades/GetTradeRes';
import { periods, buySellValues } from '@/constants';
import { useAlert } from '@/hook/useAlert';
import useScroll from '@/hook/useScroll';
import CandleChart from './components/CandleChart';
import InputPanelItem from './components/InputPanelItem';
import TradingHeader from './components/TradingHeader';
import UserOrders from './components/UserOrders';
import AllTrades from './components/AllTrades';
import OrdersPool from './components/OrdersPool';
import { useSocketListeners } from './hooks/useSocketListeners';
import { useTradingData } from './hooks/useTradingData';
import takeOrderClick from './helpers/takeOrderClick';
import useFilteredData from './hooks/useFilteredData';
import useTradeInit from './hooks/useTradeInit';
import useMatrixAddresses from './hooks/useMatrixAddresses';
import InputPanelItem from '@/components/dex/InputPanelItem';
import TradingHeader from '@/components/dex/TradingHeader';
import UserOrders from '@/components/dex/UserOrders';
import OrdersPool from '@/components/dex/OrdersPool';
import CandleChart from '@/components/dex/CandleChart';
import AllTrades from '@/components/dex/AllTrades';
import { useSocketListeners } from '@/hook/useSocketListeners';
import { useTradingData } from '@/hook/useTradingData';
import useFilteredData from '@/hook/useFilteredData';
import useTradeInit from '@/hook/useTradeInit';
import useMatrixAddresses from '@/hook/useMatrixAddresses';
import takeOrderClick from '@/utils/takeOrderClick';
const CHART_OPTIONS = [{ name: 'Zano Chart' }, { name: 'Trading View', disabled: true }];
const DEFAULT_CHART = CHART_OPTIONS[0];