Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
refactor: update query-client and map
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Mar 11, 2024
1 parent 6b350b9 commit 81c9725
Show file tree
Hide file tree
Showing 4 changed files with 335 additions and 21 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
"@emotion/react": "11.11.4",
"@emotion/styled": "11.11.0",
"@graasp/chatbox": "3.1.0",
"@graasp/query-client": "2.8.0",
"@graasp/map": "1.4.0",
"@graasp/query-client": "2.9.0",
"@graasp/sdk": "4.1.0",
"@graasp/translations": "1.25.2",
"@graasp/ui": "4.9.0",
"@graasp/ui": "4.9.1",
"@mui/icons-material": "5.15.11",
"@mui/lab": "5.0.0-alpha.166",
"@mui/material": "5.15.11",
Expand Down
13 changes: 8 additions & 5 deletions src/components/item/MapView.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Typography } from '@mui/material';

import { Map } from '@graasp/map';
import { DiscriminatedItem } from '@graasp/sdk';
import { type DiscriminatedItem, redirect } from '@graasp/sdk';

import { buildGraaspPlayerView } from '@/config/externalPaths';
import { hooks, mutations } from '@/config/queryClient';
import { buildPlayerTabName } from '@/config/selectors';

type Props = {
parentId?: DiscriminatedItem['id'];
Expand All @@ -26,10 +28,11 @@ const MapView = ({ parentId, title }: Props): JSX.Element => {
useAddressFromGeolocation={hooks.useAddressFromGeolocation}
useSuggestionsForAddress={hooks.useSuggestionsForAddress}
useItemsInMap={hooks.useItemsInMap}
useItemGeolocation={hooks.useItemGeolocation}
viewItem={() => {
// eslint-disable-next-line no-console
console.log('view item');
viewItem={(item) => {
redirect(window, buildGraaspPlayerView(item.id), {
name: buildPlayerTabName(item.id),
openInNewTab: true,
});
}}
currentMember={currentMember}
itemId={parentId}
Expand Down
2 changes: 1 addition & 1 deletion src/enums/itemLayoutMode.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enum ItemLayoutMode {
Grid = 'grid',
List = 'list',
Grid = 'grid',
Map = 'map',
}

Expand Down
Loading

0 comments on commit 81c9725

Please sign in to comment.