import { memo, type ReactNode } from 'react'; import { LayoutPriority } from 'allotment'; import classNames from 'classnames'; import AutoSizer from 'react-virtualized-auto-sizer'; import { useFeatureFlags } from '@vegaprotocol/environment'; import { type PinnedAsset } from '@vegaprotocol/accounts'; import { type Market } from '@vegaprotocol/markets'; import { Tab, LocalStoragePersistTabs as Tabs } from '@vegaprotocol/ui-toolkit'; import { ResizableGrid, ResizableGridPanel, usePaneLayout, } from '../../components/resizable-grid'; import { TradingViews } from './trade-views'; import { useT } from '../../lib/use-t'; import { ErrorBoundary } from '../../components/error-boundary'; import { MarketBanner } from '../../components/market-banner'; interface TradeGridProps { market: Market; pinnedAsset?: PinnedAsset | undefined; } const MainGrid = memo( ({ market, pinnedAsset }: { market: Market; pinnedAsset?: PinnedAsset }) => { const featureFlags = useFeatureFlags((state) => state.flags); const t = useT(); const [sizes, handleOnLayoutChange] = usePaneLayout({ id: 'top' }); const [sizesMiddle, handleOnMiddleLayoutChange] = usePaneLayout({ id: 'middle-1', }); return ( } > {market && market.tradableInstrument.instrument.product.__typename === 'Perpetual' ? ( ) : null} {market && market.tradableInstrument.instrument.product.__typename === 'Perpetual' ? ( } > ) : null} } > } settings={} > } settings={} > } > } > } settings={} > {featureFlags.STOP_ORDERS ? ( } > ) : null} } > } settings={} > ); } ); MainGrid.displayName = 'MainGrid'; export const TradeGrid = ({ market, pinnedAsset }: TradeGridProps) => { const wrapperClasses = classNames( 'h-full grid', 'grid-rows-[min-content_1fr]' ); return (
); }; interface TradeGridChildProps { children: ReactNode; } const TradeGridChild = ({ children }: TradeGridChildProps) => { return (
{({ width, height }) => (
{children}
)}
); };