chore: all markets in market selector - small fixes
This commit is contained in:
@@ -39,7 +39,7 @@ export const MarketSelector = ({
|
||||
}) => {
|
||||
const [filter, setFilter] = useState<Filter>({
|
||||
searchTerm: '',
|
||||
product: 'All',
|
||||
product: Product.All,
|
||||
sort: Sort.None,
|
||||
assets: [],
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ export type ProductType = keyof typeof Product;
|
||||
const ProductTypeMapping: {
|
||||
[key in ProductType]: string;
|
||||
} = {
|
||||
All: 'All',
|
||||
[Product.All]: 'All',
|
||||
[Product.Future]: 'Futures',
|
||||
[Product.Spot]: 'Spot',
|
||||
[Product.Perpetual]: 'Perpetuals',
|
||||
@@ -56,6 +56,7 @@ export const ProductSelector = ({
|
||||
className="flex items-center gap-2 ml-auto"
|
||||
title={t('See all markets')}
|
||||
>
|
||||
<span className="underline underline-offset-4">{t('Browse')}</span>
|
||||
<VegaIcon name={VegaIconNames.ARROW_RIGHT} />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -122,7 +122,7 @@ describe('useMarketSelectorList', () => {
|
||||
expect(result.current.markets).toEqual([markets[2]]);
|
||||
rerender({
|
||||
searchTerm: '',
|
||||
product: 'All',
|
||||
product: Product.All,
|
||||
sort: Sort.None,
|
||||
assets: [],
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ import { calcCandleVolume, useMarketList } from '@vegaprotocol/markets';
|
||||
import { priceChangePercentage } from '@vegaprotocol/utils';
|
||||
import type { Filter } from '../../components/market-selector/market-selector';
|
||||
import { Sort } from './sort-dropdown';
|
||||
import { Product } from './product-selector';
|
||||
|
||||
// Used for sort order and filter
|
||||
const MARKET_TEMPLATE = [
|
||||
@@ -29,7 +30,7 @@ export const useMarketSelectorList = ({
|
||||
// only selected product type
|
||||
.filter((m) => {
|
||||
if (
|
||||
product === 'All' ||
|
||||
product === Product.All ||
|
||||
m.tradableInstrument.instrument.product.__typename === product
|
||||
) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user