chore: add check for meta key
This commit is contained in:
@@ -6,8 +6,12 @@ import { Links, Routes } from '../../pages/client-router';
|
||||
export const Markets = () => {
|
||||
const navigate = useNavigate();
|
||||
const handleOnSelect = useCallback(
|
||||
(marketId: string) => {
|
||||
navigate(Links[Routes.MARKET](marketId));
|
||||
(marketId: string, isMetaPressed: boolean) => {
|
||||
if (isMetaPressed) {
|
||||
window.open(`/#/markets/${marketId}`, '_blank');
|
||||
} else {
|
||||
navigate(Links[Routes.MARKET](marketId));
|
||||
}
|
||||
},
|
||||
[navigate]
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { RowClickedEvent } from 'ag-grid-community';
|
||||
import { marketsWithDataProvider as dataProvider } from '../../markets-provider';
|
||||
import type { MarketMaybeWithData } from '../../markets-provider';
|
||||
interface MarketsContainerProps {
|
||||
onSelect: (marketId: string) => void;
|
||||
onSelect: (marketId: string, isMetaPressed: boolean) => void;
|
||||
}
|
||||
|
||||
export const MarketsContainer = ({ onSelect }: MarketsContainerProps) => {
|
||||
@@ -29,7 +29,7 @@ export const MarketsContainer = ({ onSelect }: MarketsContainerProps) => {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
onSelect((data as MarketMaybeWithData).id);
|
||||
onSelect((data as MarketMaybeWithData).id, event.metaKey);
|
||||
}}
|
||||
/>
|
||||
<div className="pointer-events-none absolute inset-0">
|
||||
|
||||
Reference in New Issue
Block a user