fix(trading): show deal ticket in sidebar by default (#5292)
This commit is contained in:
parent
5661b74082
commit
79a16b8562
@ -1,7 +1,5 @@
|
|||||||
import { Route, Routes, useParams } from 'react-router-dom';
|
import { Route, Routes } from 'react-router-dom';
|
||||||
import { MarketState } from '@vegaprotocol/types';
|
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useMarket } from '@vegaprotocol/markets';
|
|
||||||
import { VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
import { VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
||||||
import {
|
import {
|
||||||
SidebarButton,
|
SidebarButton,
|
||||||
@ -11,12 +9,7 @@ import {
|
|||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
|
||||||
export const MarketsSidebar = () => {
|
export const MarketsSidebar = () => {
|
||||||
const { marketId } = useParams();
|
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
const { data } = useMarket(marketId);
|
|
||||||
const active =
|
|
||||||
data &&
|
|
||||||
[MarketState.STATE_ACTIVE, MarketState.STATE_PENDING].includes(data.state);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -44,14 +37,12 @@ export const MarketsSidebar = () => {
|
|||||||
element={
|
element={
|
||||||
<>
|
<>
|
||||||
<SidebarDivider />
|
<SidebarDivider />
|
||||||
{active && (
|
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
view={ViewType.Order}
|
view={ViewType.Order}
|
||||||
icon={VegaIconNames.TICKET}
|
icon={VegaIconNames.TICKET}
|
||||||
tooltip={t('Order')}
|
tooltip={t('Order')}
|
||||||
routeId={currentRouteId}
|
routeId={currentRouteId}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
view={ViewType.Info}
|
view={ViewType.Info}
|
||||||
icon={VegaIconNames.BREAKDOWN}
|
icon={VegaIconNames.BREAKDOWN}
|
||||||
|
Loading…
Reference in New Issue
Block a user