From 3c1d0f245871cc49bfbb3926b951243461aa1b9a Mon Sep 17 00:00:00 2001 From: Michael Fenn <995541+mfenn@users.noreply.github.com> Date: Tue, 9 Nov 2021 21:16:03 -0500 Subject: [PATCH] link market from desktop open orders table --- components/OpenOrdersTable.tsx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/components/OpenOrdersTable.tsx b/components/OpenOrdersTable.tsx index 6800fb7b..f7ebed55 100644 --- a/components/OpenOrdersTable.tsx +++ b/components/OpenOrdersTable.tsx @@ -8,7 +8,11 @@ import useMangoStore from '../stores/useMangoStore' import { notify } from '../utils/notifications' import SideBadge from './SideBadge' import { Order, Market } from '@project-serum/serum/lib/market' -import { PerpOrder, PerpMarket } from '@blockworks-foundation/mango-client' +import { + PerpOrder, + PerpMarket, + MarketConfig, +} from '@blockworks-foundation/mango-client' import { formatUsdValue, getDecimalCount, usdFormatter } from '../utils' import { Table, Td, Th, TrBody, TrHead } from './TableElements' import { useViewport } from '../hooks/useViewport' @@ -19,6 +23,21 @@ import { useTranslation } from 'next-i18next' const DesktopTable = ({ openOrders, cancelledOrderId, handleCancelOrder }) => { const { t } = useTranslation('common') + const { asPath } = useRouter() + const renderMarketName = (market: MarketConfig) => { + const location = `/${market.kind}/${market.baseSymbol}` + if (!asPath.includes(location)) { + return ( + + + {market.name} + + + ) + } else { + return {market.name} + } + } return (