vega-frontend-monorepo/apps/trading/client-pages/markets/markets.tsx
macqbat 52e1757d33
feat(577): view new market proposals (#2078)
* feat: market proposal selector

* feat: market proposal selector

* feat: market proposal selector

* feat: market proposal selector

* feat: market proposal selector - fix linters

* feat: market proposal selector - add some int tests

* feat: market proposal selector - add some unit tests

* feat: market proposal selector - improve union type extracting

* feat: market proposal selector - fix failing on develop e2e tests

* feat: market proposal selector - fix failing on develop e2e tests

* feat: market proposal selector - fix failing on develop e2e tests

* feat: market proposal selector - fix failing on develop e2e tests

* feat: market proposal selector - fix failing on develop e2e tests
2022-11-16 15:36:03 +01:00

19 lines
566 B
TypeScript

import { useCallback } from 'react';
import { MarketsContainer } from '@vegaprotocol/market-list';
import { useGlobalStore } from '../../stores';
import { useNavigate } from 'react-router-dom';
export const Markets = () => {
const navigate = useNavigate();
const { update } = useGlobalStore((store) => ({ update: store.update }));
const handleOnSelect = useCallback(
(marketId: string) => {
update({ marketId });
navigate(`/markets/${marketId}`);
},
[update, navigate]
);
return <MarketsContainer onSelect={handleOnSelect} />;
};