52e1757d33
* 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
19 lines
566 B
TypeScript
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} />;
|
|
};
|