fix(trading): update filter for market selector to include suspended via governance (#4957)
This commit is contained in:
parent
c65c296db2
commit
a19ea1c939
@ -7,6 +7,8 @@ import * as Schema from '@vegaprotocol/types';
|
|||||||
import { HeaderStat } from '../header';
|
import { HeaderStat } from '../header';
|
||||||
import { useCallback, useRef, useState } from 'react';
|
import { useCallback, useRef, useState } from 'react';
|
||||||
import * as constants from '../constants';
|
import * as constants from '../constants';
|
||||||
|
import { DocsLinks } from '@vegaprotocol/environment';
|
||||||
|
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||||
|
|
||||||
export const MarketState = ({ market }: { market: Market | null }) => {
|
export const MarketState = ({ market }: { market: Market | null }) => {
|
||||||
const [marketState, setMarketState] = useState<Schema.MarketState | null>(
|
const [marketState, setMarketState] = useState<Schema.MarketState | null>(
|
||||||
@ -90,5 +92,20 @@ const getMarketStateTooltip = (state: Schema.MarketState | null) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state === Schema.MarketState.STATE_SUSPENDED_VIA_GOVERNANCE) {
|
||||||
|
return (
|
||||||
|
<p>
|
||||||
|
{t(
|
||||||
|
`This market has been suspended via a governance vote and can be resumed or terminated by further votes.`
|
||||||
|
)}
|
||||||
|
{DocsLinks && (
|
||||||
|
<ExternalLink href={DocsLinks.MARKET_LIFECYCLE} className="ml-1">
|
||||||
|
{t('Find out more')}
|
||||||
|
</ExternalLink>
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
@ -5,6 +5,7 @@ const MARKET_TEMPLATE = [
|
|||||||
MarketState.STATE_ACTIVE,
|
MarketState.STATE_ACTIVE,
|
||||||
MarketState.STATE_SUSPENDED,
|
MarketState.STATE_SUSPENDED,
|
||||||
MarketState.STATE_PENDING,
|
MarketState.STATE_PENDING,
|
||||||
|
MarketState.STATE_SUSPENDED_VIA_GOVERNANCE,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const isMarketActive = (state: MarketState) => {
|
export const isMarketActive = (state: MarketState) => {
|
||||||
|
@ -114,6 +114,20 @@ export const TradingModeTooltip = ({
|
|||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
case Schema.MarketTradingMode.TRADING_MODE_SUSPENDED_VIA_GOVERNANCE: {
|
||||||
|
return (
|
||||||
|
<section data-testid="trading-mode-suspended-via-governance">
|
||||||
|
{t(
|
||||||
|
`This market has been suspended via a governance vote and can be resumed or terminated by further votes.`
|
||||||
|
)}
|
||||||
|
{DocsLinks && (
|
||||||
|
<ExternalLink href={DocsLinks.MARKET_LIFECYCLE} className="ml-1">
|
||||||
|
{t('Find out more')}
|
||||||
|
</ExternalLink>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
}
|
||||||
case Schema.MarketTradingMode.TRADING_MODE_MONITORING_AUCTION: {
|
case Schema.MarketTradingMode.TRADING_MODE_MONITORING_AUCTION: {
|
||||||
switch (trigger) {
|
switch (trigger) {
|
||||||
case Schema.AuctionTrigger.AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET: {
|
case Schema.AuctionTrigger.AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET: {
|
||||||
|
@ -80,6 +80,7 @@ export const DocsLinks = VEGA_DOCS_URL
|
|||||||
LIQUIDITY: `${VEGA_DOCS_URL}/concepts/liquidity/provision`,
|
LIQUIDITY: `${VEGA_DOCS_URL}/concepts/liquidity/provision`,
|
||||||
WITHDRAWAL_LIMITS: `${VEGA_DOCS_URL}/concepts/assets/deposits-withdrawals#withdrawal-limits`,
|
WITHDRAWAL_LIMITS: `${VEGA_DOCS_URL}/concepts/assets/deposits-withdrawals#withdrawal-limits`,
|
||||||
VALIDATOR_SCORES_REWARDS: `${VEGA_DOCS_URL}/concepts/vega-chain/validator-scores-and-rewards`,
|
VALIDATOR_SCORES_REWARDS: `${VEGA_DOCS_URL}/concepts/vega-chain/validator-scores-and-rewards`,
|
||||||
|
MARKET_LIFECYCLE: `${VEGA_DOCS_URL}/concepts/trading-on-vega/market-lifecycle`,
|
||||||
}
|
}
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user