diff --git a/package.json b/package.json index ec6fe2a8..5b0b9d64 100644 --- a/package.json +++ b/package.json @@ -41,30 +41,30 @@ "dependencies": { "@emotion/react": "11.11.3", "@emotion/styled": "11.11.0", - "@graasp/sdk": "3.6.0", - "@mui/icons-material": "5.15.5", - "@mui/material": "5.15.5", + "@graasp/sdk": "3.8.3", + "@mui/icons-material": "5.15.10", + "@mui/material": "5.15.10", "axios": "0.27.2", - "dexie": "3.2.4", + "dexie": "3.2.6", "http-status-codes": "2.3.0", "miragejs": "0.1.48", "msw": "1.3.2", "uuid": "9.0.1" }, "devDependencies": { - "@commitlint/cli": "18.4.4", - "@commitlint/config-conventional": "18.4.4", + "@commitlint/cli": "18.6.1", + "@commitlint/config-conventional": "18.6.2", "@tanstack/react-query": "4.36.1", "@tanstack/react-query-devtools": "4.36.1", - "@testing-library/react": "14.1.2", + "@testing-library/react": "14.2.1", "@trivago/prettier-plugin-sort-imports": "4.3.0", - "@types/jest": "29.5.11", - "@types/node": "20.11.5", - "@types/react": "18.2.48", - "@types/react-dom": "18.2.18", - "@types/uuid": "9.0.7", - "@typescript-eslint/eslint-plugin": "6.20.0", - "@typescript-eslint/parser": "6.20.0", + "@types/jest": "29.5.12", + "@types/node": "20.11.19", + "@types/react": "18.2.57", + "@types/react-dom": "18.2.19", + "@types/uuid": "9.0.8", + "@typescript-eslint/eslint-plugin": "7.0.2", + "@typescript-eslint/parser": "7.0.2", "@vitejs/plugin-react": "4.2.1", "date-fns": "3.3.1", "eslint": "8.56.0", @@ -77,21 +77,21 @@ "eslint-plugin-prettier": "5.1.3", "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", - "husky": "8.0.3", + "husky": "9.0.11", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", - "nock": "13.5.0", - "prettier": "3.2.4", + "nock": "13.5.3", + "prettier": "3.2.5", "react": "18.2.0", "react-dom": "18.2.0", "react-test-renderer": "18.2.0", "ts-jest": "29.1.2", "ts-node": "10.9.2", "typescript": "5.3.3", - "vite": "5.0.12", - "vite-plugin-checker": "0.6.2", - "vite-plugin-dts": "3.7.1", - "vitest": "1.2.1" + "vite": "5.1.3", + "vite-plugin-checker": "0.6.4", + "vite-plugin-dts": "3.7.2", + "vitest": "1.3.0" }, "peerDependencies": { "@mui/icons-material": "^5.15.5", diff --git a/src/components/withContext.tsx b/src/components/withContext.tsx index 1355fbac..bbe24856 100644 --- a/src/components/withContext.tsx +++ b/src/components/withContext.tsx @@ -1,13 +1,14 @@ import React, { ReactElement, createContext, useContext } from 'react'; +import { Refresh } from '@mui/icons-material'; +import { Button, Stack, Typography } from '@mui/material'; + import { Context, PermissionLevel } from '@graasp/sdk'; import { UseQueryResult } from '@tanstack/react-query'; import { LocalContext } from '../types'; import { AutoResizer } from './AutoResizer'; -import { Button, Stack, Typography } from '@mui/material'; -import { Refresh } from '@mui/icons-material'; export const defaultContextValue: LocalContext = { apiHost: '', @@ -45,14 +46,8 @@ const WithLocalContext = ({ useAutoResize, children, }: WithLocalContextProps): JSX.Element => { - const itemId = - new URL(window.location.toString()).searchParams.get('itemId') || ''; - const { - data: context, - isLoading, - isError, - error, - } = useGetLocalContext(itemId, defaultValue); + const itemId = new URL(window.location.toString()).searchParams.get('itemId') || ''; + const { data: context, isLoading, isError, error } = useGetLocalContext(itemId, defaultValue); if (context) { return ( @@ -81,9 +76,8 @@ const WithLocalContext = ({ return ( - Could not get `LocalContext`. Check if you have mocking enabled, or if - you are running in an iframe, that the parent window replies to your - messages. + Could not get `LocalContext`. Check if you have mocking enabled, or if you are running in an + iframe, that the parent window replies to your messages.