fix: capitalize trading mode
This commit is contained in:
parent
7bc838e12c
commit
8ddeadfdce
@ -32,6 +32,7 @@ const MARKET_QUERY = gql`
|
|||||||
bestStaticBidVolume
|
bestStaticBidVolume
|
||||||
bestStaticOfferVolume
|
bestStaticOfferVolume
|
||||||
indicativeVolume
|
indicativeVolume
|
||||||
|
trigger
|
||||||
}
|
}
|
||||||
tradableInstrument {
|
tradableInstrument {
|
||||||
instrument {
|
instrument {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// @generated
|
// @generated
|
||||||
// This file was automatically generated and should not be edited.
|
// This file was automatically generated and should not be edited.
|
||||||
|
|
||||||
import { Interval, MarketTradingMode, MarketState } from "@vegaprotocol/types";
|
import { Interval, MarketTradingMode, MarketState, AuctionTrigger } from "@vegaprotocol/types";
|
||||||
|
|
||||||
// ====================================================
|
// ====================================================
|
||||||
// GraphQL query operation: Market
|
// GraphQL query operation: Market
|
||||||
@ -47,6 +47,10 @@ export interface Market_market_data {
|
|||||||
* the aggregated volume being offered at the best static offer price, excluding pegged orders.
|
* the aggregated volume being offered at the best static offer price, excluding pegged orders.
|
||||||
*/
|
*/
|
||||||
bestStaticOfferVolume: string;
|
bestStaticOfferVolume: string;
|
||||||
|
/**
|
||||||
|
* what triggered an auction (if an auction was started)
|
||||||
|
*/
|
||||||
|
trigger: AuctionTrigger;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Market_market_tradableInstrument_instrument_metadata {
|
export interface Market_market_tradableInstrument_instrument_metadata {
|
||||||
@ -145,7 +149,7 @@ export interface Market_market {
|
|||||||
*/
|
*/
|
||||||
decimalPlaces: number;
|
decimalPlaces: number;
|
||||||
/**
|
/**
|
||||||
* positionDecimalPlaces indicate the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
|
* positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
|
||||||
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
|
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
|
||||||
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
|
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
|
||||||
*/
|
*/
|
||||||
|
@ -23,6 +23,7 @@ import {
|
|||||||
PriceCellChange,
|
PriceCellChange,
|
||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import type { CandleClose } from '@vegaprotocol/types';
|
import type { CandleClose } from '@vegaprotocol/types';
|
||||||
|
import { MarketTradingMode } from '@vegaprotocol/types';
|
||||||
import capitalize from 'lodash/capitalize';
|
import capitalize from 'lodash/capitalize';
|
||||||
import startCase from 'lodash/startCase';
|
import startCase from 'lodash/startCase';
|
||||||
|
|
||||||
@ -45,6 +46,8 @@ interface TradeMarketHeaderProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formatLabel = (str: string) => capitalize(startCase(str).toLowerCase());
|
||||||
|
|
||||||
export const TradeMarketHeader = ({
|
export const TradeMarketHeader = ({
|
||||||
market,
|
market,
|
||||||
className,
|
className,
|
||||||
@ -99,7 +102,11 @@ export const TradeMarketHeader = ({
|
|||||||
<div className={headerItemClassName}>
|
<div className={headerItemClassName}>
|
||||||
<span className={itemClassName}>Trading mode</span>
|
<span className={itemClassName}>Trading mode</span>
|
||||||
<span data-testid="trading-mode" className={itemValueClassName}>
|
<span data-testid="trading-mode" className={itemValueClassName}>
|
||||||
{capitalize(startCase(market.tradingMode).toLowerCase())}
|
{market.tradingMode === MarketTradingMode.MonitoringAuction
|
||||||
|
? `${formatLabel(
|
||||||
|
market.tradingMode
|
||||||
|
)} - ${market.data?.trigger.toLowerCase()}`
|
||||||
|
: formatLabel(market.tradingMode)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user