vega-frontend-monorepo/apps/trading/client-pages/markets/markets.tsx
macqbat c14e57cfd5
feat(2146): adjust and refactor welcome dialogs (#2384)
* feat: adjust and refactor welcome dialogs

* feat: adjust and refactor welcome dialogs - add int tests

* feat: adjust and refactor welcome dialogs - small fixes and imprvments

* feat: adjust and refactor welcome dialogs - fix a typo

* feat: adjust and refactor welcome dialogs - fix a property name

* feat: adjust and refactor welcome dialogs - fix an unit test
2022-12-13 14:31:28 +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} />;
};