move View type to trading-compoments, tidy comments

This commit is contained in:
Matthew Russell 2022-03-02 08:20:12 -08:00
parent da80f8848c
commit 026dd0f2c3
3 changed files with 3 additions and 5 deletions

View File

@ -44,7 +44,6 @@ export const GridTabs = ({ children, group }: GridTabsProps) => {
className="h-full grid grid-rows-[min-content_1fr]"
onValueChange={(value) => setActiveTab(value)}
>
{/* the tabs */}
<Tabs.List className="flex gap-[2px] bg-neutral-200" role="tablist">
{Children.map(children, (child) => {
if (!isValidElement(child)) return null;
@ -66,7 +65,6 @@ export const GridTabs = ({ children, group }: GridTabsProps) => {
);
})}
</Tabs.List>
{/* the content */}
<div className="h-full overflow-auto">
{Children.map(children, (child) => {
if (!isValidElement(child)) return null;

View File

@ -2,7 +2,7 @@ import classNames from 'classnames';
import AutoSizer from 'react-virtualized-auto-sizer';
import { useState, ReactNode } from 'react';
import { Market_market } from './__generated__/Market';
import { Views } from './trading-components';
import { View, Views } from './trading-components';
import { GridTab, GridTabs } from './grid-tabs';
interface TradeGridProps {
@ -74,8 +74,6 @@ const TradeGridChild = ({ children, className }: TradeGridChildProps) => {
);
};
type View = keyof typeof Views;
interface TradePanelsProps {
market: Market_market;
}

View File

@ -5,6 +5,8 @@ export const Orders = () => <div>TODO: Orders</div>;
export const Positions = () => <div>TODO: Positions</div>;
export const Collateral = () => <div>TODO: Collateral</div>;
export type View = keyof typeof Views;
export const Views = {
chart: Chart,
ticket: Ticket,