6c84153cdb
* chore: redirect to last visited market instead first from the list * chore: redirect to last visited market instead first from the list - add int tests * feat: redirect to last visited market instead first from the list - refactor solution * feat: redirect to last visited market instead first from the list - fix failing int test * feat: redirect to last visited market instead first from the list - fix failing int test * feat: redirect to last visited market instead first from the list - fix failing int test * feat: redirect to last visited market instead first from the list - use immer in globalStore * chore: redirect to last visited market - improve use of zustand
17 lines
474 B
TypeScript
17 lines
474 B
TypeScript
import { useCallback } from 'react';
|
|
import { MarketsContainer } from '@vegaprotocol/market-list';
|
|
import { useNavigate } from 'react-router-dom';
|
|
import { Links, Routes } from '../../pages/client-router';
|
|
|
|
export const Markets = () => {
|
|
const navigate = useNavigate();
|
|
const handleOnSelect = useCallback(
|
|
(marketId: string) => {
|
|
navigate(Links[Routes.MARKET](marketId));
|
|
},
|
|
[navigate]
|
|
);
|
|
|
|
return <MarketsContainer onSelect={handleOnSelect} />;
|
|
};
|