default market dropdown category to selected market type

This commit is contained in:
saml33 2023-06-21 09:30:31 +10:00
parent 45f3136bf9
commit 9976698c67
1 changed files with 4 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import {
import MarketLogos from './MarketLogos'
import SoonBadge from '@components/shared/SoonBadge'
import TabButtons from '@components/shared/TabButtons'
import { PerpMarket } from '@blockworks-foundation/mango-v4'
const MARKET_LINK_WRAPPER_CLASSES =
'flex items-center justify-between px-4 md:pl-6 md:pr-4'
@ -35,7 +36,9 @@ const MARKET_LINK_DISABLED_CLASSES =
const MarketSelectDropdown = () => {
const { t } = useTranslation('common')
const { selectedMarket } = useSelectedMarket()
const [spotOrPerp, setSpotOrPerp] = useState('perp')
const [spotOrPerp, setSpotOrPerp] = useState(
selectedMarket instanceof PerpMarket ? 'perp' : 'spot'
)
const serumMarkets = mangoStore((s) => s.serumMarkets)
const allPerpMarkets = mangoStore((s) => s.perpMarkets)
const perpStats = mangoStore((s) => s.perpStats.data)