Compare commits

...
Author SHA1 Message Date
Matthew Russell cc69a4ceb8 chore: add check for meta key 2023-03-27 10:25:44 -07:00
2 changed files with 8 additions and 4 deletions
@@ -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">