diff --git a/components/MarketSelect.tsx b/components/MarketSelect.tsx index 570986d5..faa5c27c 100644 --- a/components/MarketSelect.tsx +++ b/components/MarketSelect.tsx @@ -15,16 +15,11 @@ const StyledMarketSelectWrapper = styled.div` } ` -// const StyledMarketTypeToggleWrapper = styled.div` -// background: rgba(255, 255, 255, 0.12); -// ` - const StyledArrow = styled.div` width: 0; height: 0; border-top: 20px solid transparent; border-bottom: 20px solid transparent; - // border-left: 20px solid rgba(255, 255, 255, 0.12); padding-right: 0.5rem; ` @@ -46,10 +41,8 @@ const MarketSelect = () => { found.markets.push(market) } }) - setSortedMarkets( - markets.sort((a, b) => a.baseAsset.localeCompare(b.baseAsset)) - ) - }, []) + setSortedMarkets(markets) + }, [groupConfig]) return ( <> diff --git a/components/MarketsModal.tsx b/components/MarketsModal.tsx index acafdb33..469d5a38 100644 --- a/components/MarketsModal.tsx +++ b/components/MarketsModal.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import React from 'react' import styled from '@emotion/styled' import Link from 'next/link' import { EyeIcon, EyeOffIcon } from '@heroicons/react/outline' @@ -20,6 +20,8 @@ const MarketsModal = ({ markets: Array onClose?: (x?) => void }) => { + const mangoGroup = useMangoStore((s) => s.selectedMangoGroup.current) + const mangoCache = useMangoStore((s) => s.selectedMangoGroup.cache) const [hiddenMarkets, setHiddenMarkets] = useLocalStorageState( 'hiddenMarkets', [] @@ -45,26 +47,26 @@ const MarketsModal = ({ Show all in Nav - {markets.map((m) => ( -
+ {markets.map((mkt, index) => ( +
- {m.baseAsset} + {mkt.baseAsset}
- {hiddenMarkets.includes(m.baseAsset) ? ( + {hiddenMarkets.includes(mkt.baseAsset) ? ( handleHideShowMarket(m.baseAsset)} + onClick={() => handleHideShowMarket(mkt.baseAsset)} /> ) : ( handleHideShowMarket(m.baseAsset)} + onClick={() => handleHideShowMarket(mkt.baseAsset)} /> )}
@@ -74,16 +76,16 @@ const MarketsModal = ({ Price - + {/* 24h Change 24h Vol - + */}
- {m.markets.map((m, i) => ( + {mkt.markets.map((m, i) => (
- $10,000 - +2.44% - $233m + + ${mangoGroup.getPrice(index, mangoCache).toFixed(2)} + + {/* +2.44% + $233m */}
))}