diff --git a/src/constants/localization.ts b/src/constants/localization.ts index 108d374..dc8e05a 100644 --- a/src/constants/localization.ts +++ b/src/constants/localization.ts @@ -34,6 +34,8 @@ export const STRING_KEYS = { ...WARNINGS_STRING_KEYS, }; +export type StringKey = keyof typeof STRING_KEYS; + export type LocaleData = typeof EN_LOCALE_DATA; export type StringGetterFunction = (a: { diff --git a/src/constants/markets.ts b/src/constants/markets.ts index 6d534c6..edb44f9 100644 --- a/src/constants/markets.ts +++ b/src/constants/markets.ts @@ -1,36 +1,6 @@ import { Asset, PerpetualMarket } from '@/constants/abacus'; import { STRING_KEYS } from '@/constants/localization'; -export interface Market { - market: string; - status: string; - baseAsset: string; - quoteAsset: string; - stepSize: string; - tickSize: string; - oraclePrice: string; - priceChange24H: string; - nextFundingRate: string; - nextFundingAt: string; - minOrderSize: string; - type: string; - initialMarginFraction: string; - maintenanceMarginFraction: string; - volume24H: string; - trades24H: string; - openInterest: string; - incrementalInitialMarginFraction: string; - incrementalPositionSize: string; - maxPositionSize: string; - baselinePositionSize: string; - assetResolution: string; - syntheticAssetId: string; -} - -export type AllMarkets = { - [market: string]: Market; -}; - export type MarketData = { asset: Asset; tickSizeDecimals: number; diff --git a/src/hooks/useCurrentMarketId.ts b/src/hooks/useCurrentMarketId.ts index 2ae40ee..087ef9c 100644 --- a/src/hooks/useCurrentMarketId.ts +++ b/src/hooks/useCurrentMarketId.ts @@ -4,7 +4,7 @@ import { useMatch, useNavigate } from 'react-router-dom'; import { LocalStorageKey } from '@/constants/localStorage'; import { DEFAULT_MARKETID } from '@/constants/markets'; -import { AppRoute, DEFAULT_TRADE_ROUTE } from '@/constants/routes'; +import { AppRoute } from '@/constants/routes'; import { getSelectedNetwork } from '@/state/appSelectors'; import { closeDialogInTradeBox } from '@/state/dialogs'; diff --git a/src/views/MarketDetails.tsx b/src/views/MarketDetails.tsx index 3f3ec7b..f9a7a56 100644 --- a/src/views/MarketDetails.tsx +++ b/src/views/MarketDetails.tsx @@ -2,7 +2,7 @@ import { shallowEqual, useSelector } from 'react-redux'; import styled, { type AnyStyledComponent } from 'styled-components'; import { ButtonShape, ButtonSize, ButtonType } from '@/constants/buttons'; -import { STRING_KEYS } from '@/constants/localization'; +import { STRING_KEYS, type StringKey } from '@/constants/localization'; import { useBreakpoints, useStringGetter } from '@/hooks'; import { breakpoints } from '@/styles'; import { layoutMixins } from '@/styles/layoutMixins'; @@ -34,10 +34,7 @@ export const MarketDetails: React.FC = () => { initialMarginFraction, maintenanceMarginFraction, minOrderSize, - maxPositionSize, - baselinePositionSize, - incrementalInitialMarginFraction, - incrementalPositionSize, + stepSizeDecimals, tickSizeDecimals, } = configs; @@ -72,12 +69,28 @@ export const MarketDetails: React.FC = () => { key: 'step-size', label: stringGetter({ key: STRING_KEYS.STEP_SIZE }), tooltip: 'step-size', - value: , + value: ( + + ), }, { key: 'min-order-size', label: stringGetter({ key: STRING_KEYS.MINIMUM_ORDER_SIZE }), - value: , + value: ( + + ), }, { key: 'max-leverage', @@ -105,36 +118,6 @@ export const MarketDetails: React.FC = () => { tooltip: 'initial-margin-fraction', value: , }, - { - key: 'incremental-initial-margin-fraction', - label: stringGetter({ key: STRING_KEYS.INCREMENTAL_INITIAL_MARGIN_FRACTION }), - value: ( - - ), - }, - { - key: 'incremental-position-size', - label: stringGetter({ key: STRING_KEYS.INCREMENTAL_POSITION_SIZE }), - value: ( - - ), - }, - { - key: 'baseline-position-size', - label: stringGetter({ key: STRING_KEYS.BASELINE_POSITION_SIZE }), - value: ( - - ), - }, - { - key: 'max-position-size', - label: stringGetter({ key: STRING_KEYS.MAXIMUM_POSITION_SIZE }), - value: , - }, ]; return ( @@ -150,10 +133,10 @@ export const MarketDetails: React.FC = () => { {primaryDescriptionKey && ( -

{stringGetter({ key: STRING_KEYS[primaryDescriptionKey] })}

+

{stringGetter({ key: STRING_KEYS[primaryDescriptionKey as StringKey] })}

)} {secondaryDescriptionKey && ( -

{stringGetter({ key: STRING_KEYS[secondaryDescriptionKey] })}

+

{stringGetter({ key: STRING_KEYS[secondaryDescriptionKey as StringKey] })}

)}