diff --git a/package-lock.json b/package-lock.json index a499ca0c5..4456c0785 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "react-hook-form": "^7.53.2", "react-i18next": "^15.1.3", "react-redux": "^8.1.3", - "react-router-dom": "^6.28.0", + "react-router": "^7.0.1", "scrollama": "^3.2.0", "slate-history": "^0.110.3", "slate-hyperscript": "^0.100.0", @@ -6612,15 +6612,6 @@ } } }, - "node_modules/@remix-run/router": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.21.0.tgz", - "integrity": "sha512-xfSkCAchbdG5PnbrKqFWwia4Bi61nH+wm8wLEqfHDyp7Y3dZzgqS2itV8i4gAq9pC2HsTpwyBC6Ds8VHZ96JlA==", - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@repeaterjs/repeater": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@repeaterjs/repeater/-/repeater-3.0.6.tgz", @@ -7719,6 +7710,12 @@ "@types/node": "*" } }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "license": "MIT" + }, "node_modules/@types/eslint": { "version": "8.56.12", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.12.tgz", @@ -25670,35 +25667,36 @@ } }, "node_modules/react-router": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.28.0.tgz", - "integrity": "sha512-HrYdIFqdrnhDw0PqG/AKjAqEqM7AvxCz0DQ4h2W8k6nqmc5uRBYDag0SBxx9iYz5G8gnuNVLzUe13wl9eAsXXg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.0.1.tgz", + "integrity": "sha512-WVAhv9oWCNsja5AkK6KLpXJDSJCQizOIyOd4vvB/+eHGbYx5vkhcmcmwWjQ9yqkRClogi+xjEg9fNEOd5EX/tw==", "license": "MIT", "dependencies": { - "@remix-run/router": "1.21.0" + "@types/cookie": "^0.6.0", + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0", + "turbo-stream": "2.4.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=20.0.0" }, "peerDependencies": { - "react": ">=16.8" + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } } }, - "node_modules/react-router-dom": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.28.0.tgz", - "integrity": "sha512-kQ7Unsl5YdyOltsPGl31zOjLrDv+m2VcIEcIHqYYD3Lp0UppLjrzcfJqDJwXxFw3TH/yvapbnUvPlAj7Kx5nbg==", + "node_modules/react-router/node_modules/cookie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", "license": "MIT", - "dependencies": { - "@remix-run/router": "1.21.0", - "react-router": "6.28.0" - }, "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "react": ">=16.8", - "react-dom": ">=16.8" + "node": ">=18" } }, "node_modules/react-scripts": { @@ -28352,6 +28350,12 @@ "dev": true, "license": "ISC" }, + "node_modules/set-cookie-parser": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", + "license": "MIT" + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -30644,6 +30648,12 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "node_modules/turbo-stream": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz", + "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==", + "license": "ISC" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index acea9264b..6dd944c02 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "react-hook-form": "^7.53.2", "react-i18next": "^15.1.3", "react-redux": "^8.1.3", - "react-router-dom": "^6.28.0", + "react-router": "^7.0.1", "scrollama": "^3.2.0", "slate-history": "^0.110.3", "slate-hyperscript": "^0.100.0", diff --git a/src/account/accountProfileUtils.js b/src/account/accountProfileUtils.js index 1a373d735..975438f41 100644 --- a/src/account/accountProfileUtils.js +++ b/src/account/accountProfileUtils.js @@ -17,7 +17,7 @@ import { useEffect, useState } from 'react'; import { jwtDecode } from 'jwt-decode'; -import { useLocation, useNavigate } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router'; import { getToken } from 'terraso-client-shared/account/auth'; import { useSelector } from 'terrasoApi/store'; diff --git a/src/account/components/AccountLogin.test.js b/src/account/components/AccountLogin.test.js index 708a45056..66bab185f 100644 --- a/src/account/components/AccountLogin.test.js +++ b/src/account/components/AccountLogin.test.js @@ -17,15 +17,15 @@ import { render, screen } from 'tests/utils'; import React from 'react'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useNavigate, useSearchParams } from 'react-router'; import * as accountService from 'terraso-client-shared/account/accountService'; import AccountLogin from 'account/components/AccountLogin'; jest.mock('terraso-client-shared/account/accountService'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useSearchParams: jest.fn(), useNavigate: jest.fn(), })); diff --git a/src/account/components/AccountProfile.js b/src/account/components/AccountProfile.js index 5be9d32d7..155673634 100644 --- a/src/account/components/AccountProfile.js +++ b/src/account/components/AccountProfile.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { fetchProfile, savePreference, diff --git a/src/account/components/AccountProfile.test.js b/src/account/components/AccountProfile.test.js index 104f5f631..4cef18098 100644 --- a/src/account/components/AccountProfile.test.js +++ b/src/account/components/AccountProfile.test.js @@ -19,15 +19,15 @@ import { act, fireEvent, render, screen, within } from 'tests/utils'; import React from 'react'; import { when } from 'jest-when'; import _ from 'lodash/fp'; -import { useNavigate, useParams, useSearchParams } from 'react-router-dom'; +import { useNavigate, useParams, useSearchParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import AccountProfile from 'account/components/AccountProfile'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), useNavigate: jest.fn(), useSearchParams: jest.fn(), diff --git a/src/account/components/OptionalAuth.test.js b/src/account/components/OptionalAuth.test.js index 03ec778cc..db9ff3ab2 100644 --- a/src/account/components/OptionalAuth.test.js +++ b/src/account/components/OptionalAuth.test.js @@ -16,14 +16,14 @@ */ import { render, screen } from 'tests/utils'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; import OptionalAuth from './OptionalAuth'; import OptionalAuthBottomMessage from './OptionalAuthBottomMessage'; import OptionalAuthTopMessage from './OptionalAuthTopMessage'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useLocation: jest.fn(), })); diff --git a/src/account/components/OptionalAuthBottomMessage.js b/src/account/components/OptionalAuthBottomMessage.js index c679ba304..45c99e48b 100644 --- a/src/account/components/OptionalAuthBottomMessage.js +++ b/src/account/components/OptionalAuthBottomMessage.js @@ -19,7 +19,7 @@ import React from 'react'; import _ from 'lodash/fp'; import { Trans, withTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; import { Box, Typography } from '@mui/material'; import RouterLink from 'common/components/RouterLink'; diff --git a/src/account/components/OptionalAuthTopMessage.js b/src/account/components/OptionalAuthTopMessage.js index 74536715d..d0cce0462 100644 --- a/src/account/components/OptionalAuthTopMessage.js +++ b/src/account/components/OptionalAuthTopMessage.js @@ -19,7 +19,7 @@ import React from 'react'; import _ from 'lodash/fp'; import { Trans, withTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; import { Typography } from '@mui/material'; import RouterLink from 'common/components/RouterLink'; diff --git a/src/account/components/RequireAuth.js b/src/account/components/RequireAuth.js index 0e0dba0bd..b629899e9 100644 --- a/src/account/components/RequireAuth.js +++ b/src/account/components/RequireAuth.js @@ -17,7 +17,7 @@ import React, { useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { Navigate, useLocation } from 'react-router-dom'; +import { Navigate, useLocation } from 'react-router'; import { fetchUser } from 'terraso-client-shared/account/accountSlice'; import { useFetchData } from 'terraso-client-shared/store/utils'; diff --git a/src/account/components/RequireAuth.test.js b/src/account/components/RequireAuth.test.js index aef4b1106..f1b245068 100644 --- a/src/account/components/RequireAuth.test.js +++ b/src/account/components/RequireAuth.test.js @@ -23,7 +23,7 @@ import { useNavigate, useParams, useSearchParams, -} from 'react-router-dom'; +} from 'react-router'; import { getToken, getUserEmail } from 'terraso-client-shared/account/auth'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; @@ -38,8 +38,8 @@ jest.mock('terraso-client-shared/account/auth', () => ({ getToken: jest.fn(), })); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), useLocation: jest.fn(), useNavigate: jest.fn(), diff --git a/src/account/components/Unsubscribe.js b/src/account/components/Unsubscribe.js index eaf56bc75..f4a055288 100644 --- a/src/account/components/Unsubscribe.js +++ b/src/account/components/Unsubscribe.js @@ -19,7 +19,7 @@ import { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useNavigate, useSearchParams } from 'react-router'; import { unsubscribeFromNotifications } from 'terraso-client-shared/account/accountSlice'; import { addMessage } from 'terraso-client-shared/notifications/notificationsSlice'; import { useFetchData } from 'terraso-client-shared/store/utils'; diff --git a/src/account/components/Unsubscribe.test.js b/src/account/components/Unsubscribe.test.js index 9aeaadc2a..95727789a 100644 --- a/src/account/components/Unsubscribe.test.js +++ b/src/account/components/Unsubscribe.test.js @@ -17,15 +17,15 @@ import { render, screen, within } from 'tests/utils'; import React from 'react'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useNavigate, useSearchParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import Unsubscribe from 'account/components/Unsubscribe'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useNavigate: jest.fn(), useSearchParams: jest.fn(), })); diff --git a/src/app.test.js b/src/app.test.js index 2e2c3ccba..c846e2349 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -17,10 +17,10 @@ import { render, screen } from 'tests/utils'; import App from 'App'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useLocation: jest.fn(), })); diff --git a/src/common/components/CardActionRouterLink.js b/src/common/components/CardActionRouterLink.js index ae464a119..d2ae6eb2f 100644 --- a/src/common/components/CardActionRouterLink.js +++ b/src/common/components/CardActionRouterLink.js @@ -16,7 +16,7 @@ */ import React from 'react'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; import { Button, CardActions } from '@mui/material'; const CardActionRouterLink = ({ label, to, state }) => { diff --git a/src/common/components/ConditionalLink.js b/src/common/components/ConditionalLink.js index 9ae778714..52b3761d2 100644 --- a/src/common/components/ConditionalLink.js +++ b/src/common/components/ConditionalLink.js @@ -15,7 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; const ConditionalLink = ({ children, to, condition }) => { if (!!condition && to) { diff --git a/src/common/components/RouterButton.js b/src/common/components/RouterButton.js index 45d98418d..ff99a7136 100644 --- a/src/common/components/RouterButton.js +++ b/src/common/components/RouterButton.js @@ -16,7 +16,7 @@ */ import React from 'react'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; import { Button } from '@mui/material'; const RouterButton = React.forwardRef((props, ref) => { diff --git a/src/common/components/RouterLink.js b/src/common/components/RouterLink.js index e2c9eec58..0ac1e497a 100644 --- a/src/common/components/RouterLink.js +++ b/src/common/components/RouterLink.js @@ -16,7 +16,7 @@ */ import React from 'react'; -import { Link as ReactRouterLink } from 'react-router-dom'; +import { Link as ReactRouterLink } from 'react-router'; import { Link } from '@mui/material'; const RouterLink = React.forwardRef((props, ref) => { diff --git a/src/group/components/GroupForm.js b/src/group/components/GroupForm.js index 2e6a86a2f..41b19a461 100644 --- a/src/group/components/GroupForm.js +++ b/src/group/components/GroupForm.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import * as yup from 'yup'; import { diff --git a/src/group/components/GroupForm.test.js b/src/group/components/GroupForm.test.js index 0b8e9f9e8..758b2a6e3 100644 --- a/src/group/components/GroupForm.test.js +++ b/src/group/components/GroupForm.test.js @@ -17,15 +17,15 @@ import { act, fireEvent, render, screen, within } from 'tests/utils'; import React from 'react'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import GroupForm from 'group/components/GroupForm'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), useNavigate: jest.fn(), })); diff --git a/src/group/components/GroupList.js b/src/group/components/GroupList.js index 99d410c05..bbfebdb1b 100644 --- a/src/group/components/GroupList.js +++ b/src/group/components/GroupList.js @@ -19,7 +19,7 @@ import React, { useMemo } from 'react'; import _ from 'lodash/fp'; import { Trans, useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { Link as RouterLink, useSearchParams } from 'react-router-dom'; +import { Link as RouterLink, useSearchParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDispatch } from 'terrasoApi/store'; import { Button, Card, Link, Stack, Typography } from '@mui/material'; diff --git a/src/group/components/GroupList.test.js b/src/group/components/GroupList.test.js index 1e4f20a6f..86005be35 100644 --- a/src/group/components/GroupList.test.js +++ b/src/group/components/GroupList.test.js @@ -17,7 +17,7 @@ import { act, fireEvent, render, screen, within } from 'tests/utils'; import React from 'react'; -import { useSearchParams } from 'react-router-dom'; +import { useSearchParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import useMediaQuery from '@mui/material/useMediaQuery'; @@ -30,8 +30,8 @@ jest.mock('terraso-client-shared/terrasoApi/api'); jest.mock('@mui/material/useMediaQuery'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useSearchParams: jest.fn(), })); diff --git a/src/group/components/GroupSharedDataUpload.js b/src/group/components/GroupSharedDataUpload.js index 6163e3b24..65d86beab 100644 --- a/src/group/components/GroupSharedDataUpload.js +++ b/src/group/components/GroupSharedDataUpload.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import { usePermissionRedirect } from 'permissions'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { CollaborationContextProvider } from 'collaboration/collaborationContext'; import { useDocumentTitle } from 'common/document'; diff --git a/src/group/components/GroupSharedDataUploadFiles.test.js b/src/group/components/GroupSharedDataUploadFiles.test.js index e51901632..656532fed 100644 --- a/src/group/components/GroupSharedDataUploadFiles.test.js +++ b/src/group/components/GroupSharedDataUploadFiles.test.js @@ -18,7 +18,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; import _ from 'lodash/fp'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { GROUP_TYPES_WITH_REDIRECTS } from 'tests/constants'; @@ -28,8 +28,8 @@ import GroupSharedDataUpload from './GroupSharedDataUpload'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), useNavigate: jest.fn(), })); diff --git a/src/group/components/GroupSharedDataVisualization.js b/src/group/components/GroupSharedDataVisualization.js index a45f4efd5..89c7961c7 100644 --- a/src/group/components/GroupSharedDataVisualization.js +++ b/src/group/components/GroupSharedDataVisualization.js @@ -18,7 +18,7 @@ import React, { useEffect, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { CollaborationContextProvider } from 'collaboration/collaborationContext'; import { useDocumentTitle } from 'common/document'; diff --git a/src/group/components/GroupSharedDataVisualizationConfig.js b/src/group/components/GroupSharedDataVisualizationConfig.js index 266f8584a..fccfaa79e 100644 --- a/src/group/components/GroupSharedDataVisualizationConfig.js +++ b/src/group/components/GroupSharedDataVisualizationConfig.js @@ -18,7 +18,7 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { CollaborationContextProvider } from 'collaboration/collaborationContext'; import { useDocumentTitle } from 'common/document'; diff --git a/src/group/components/GroupView.js b/src/group/components/GroupView.js index 53ef1d555..b7c3d2b69 100644 --- a/src/group/components/GroupView.js +++ b/src/group/components/GroupView.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import _ from 'lodash/fp'; import { usePermission } from 'permissions'; import { useTranslation } from 'react-i18next'; -import { Link as RouterLink, useNavigate, useParams } from 'react-router-dom'; +import { Link as RouterLink, useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDispatch, useSelector } from 'terrasoApi/store'; import EmailIcon from '@mui/icons-material/Email'; diff --git a/src/group/components/GroupView.test.js b/src/group/components/GroupView.test.js index 75fee7c91..8fdbde4ae 100644 --- a/src/group/components/GroupView.test.js +++ b/src/group/components/GroupView.test.js @@ -18,15 +18,15 @@ import { act, fireEvent, render, screen, within } from 'tests/utils'; import React from 'react'; import { when } from 'jest-when'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import GroupView from 'group/components/GroupView'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/group/components/GroupsHomeCard.js b/src/group/components/GroupsHomeCard.js index d275097ce..b99496aa8 100644 --- a/src/group/components/GroupsHomeCard.js +++ b/src/group/components/GroupsHomeCard.js @@ -18,7 +18,7 @@ import React from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; -import { Link as RouterLink, useNavigate } from 'react-router-dom'; +import { Link as RouterLink, useNavigate } from 'react-router'; import { ListItem as BaseListItem, Link, diff --git a/src/group/membership/components/GroupMembers.js b/src/group/membership/components/GroupMembers.js index 36d126092..0c24c32fa 100644 --- a/src/group/membership/components/GroupMembers.js +++ b/src/group/membership/components/GroupMembers.js @@ -20,7 +20,7 @@ import _ from 'lodash/fp'; import { usePermission, usePermissionRedirect } from 'permissions'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDispatch } from 'terrasoApi/store'; diff --git a/src/group/membership/components/GroupMembers.test.js b/src/group/membership/components/GroupMembers.test.js index 859a00b2c..7bc309648 100644 --- a/src/group/membership/components/GroupMembers.test.js +++ b/src/group/membership/components/GroupMembers.test.js @@ -18,7 +18,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; import _ from 'lodash/fp'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { GROUP_TYPES_WITH_REDIRECTS } from 'tests/constants'; import useMediaQuery from '@mui/material/useMediaQuery'; @@ -32,8 +32,8 @@ jest.mock('terraso-client-shared/terrasoApi/api'); jest.mock('@mui/material/useMediaQuery'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useNavigate: jest.fn(), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/AffiliationUpdate.js b/src/landscape/components/LandscapeForm/AffiliationUpdate.js index d3b9a5781..590461526 100644 --- a/src/landscape/components/LandscapeForm/AffiliationUpdate.js +++ b/src/landscape/components/LandscapeForm/AffiliationUpdate.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDocumentTitle } from 'common/document'; diff --git a/src/landscape/components/LandscapeForm/AffiliationUpdate.test.js b/src/landscape/components/LandscapeForm/AffiliationUpdate.test.js index f3aa9ee24..69c6d3a00 100644 --- a/src/landscape/components/LandscapeForm/AffiliationUpdate.test.js +++ b/src/landscape/components/LandscapeForm/AffiliationUpdate.test.js @@ -17,15 +17,15 @@ import { act, fireEvent, render, screen, within } from 'tests/utils'; import React from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import AffiliationUpdate from 'landscape/components/LandscapeForm/AffiliationUpdate'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js b/src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js index b063eba4d..a4b14ebf4 100644 --- a/src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js +++ b/src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js @@ -17,7 +17,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import mapboxgl from 'gis/mapbox'; @@ -33,8 +33,8 @@ jest.mock('custom-hooks', () => { jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/BoundaryStepNewDrawPolygon.test.js b/src/landscape/components/LandscapeForm/BoundaryStepNewDrawPolygon.test.js index e8fef7492..3231ab448 100644 --- a/src/landscape/components/LandscapeForm/BoundaryStepNewDrawPolygon.test.js +++ b/src/landscape/components/LandscapeForm/BoundaryStepNewDrawPolygon.test.js @@ -18,7 +18,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; import MapboxDraw from '@mapbox/mapbox-gl-draw'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import mapboxgl from 'gis/mapbox'; @@ -26,8 +26,8 @@ import LandscapeNew from 'landscape/components/LandscapeForm/New'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/BoundaryStepNewFormPin.test.js b/src/landscape/components/LandscapeForm/BoundaryStepNewFormPin.test.js index caa49c1bf..1ee715282 100644 --- a/src/landscape/components/LandscapeForm/BoundaryStepNewFormPin.test.js +++ b/src/landscape/components/LandscapeForm/BoundaryStepNewFormPin.test.js @@ -18,7 +18,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; import MapboxDraw from '@mapbox/mapbox-gl-draw'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import mapboxgl from 'gis/mapbox'; @@ -26,8 +26,8 @@ import LandscapeNew from 'landscape/components/LandscapeForm/New'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/BoundaryStepUpdate.js b/src/landscape/components/LandscapeForm/BoundaryStepUpdate.js index 309c4e95c..963059403 100644 --- a/src/landscape/components/LandscapeForm/BoundaryStepUpdate.js +++ b/src/landscape/components/LandscapeForm/BoundaryStepUpdate.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDocumentTitle } from 'common/document'; diff --git a/src/landscape/components/LandscapeForm/BoundaryStepUpdate.test.js b/src/landscape/components/LandscapeForm/BoundaryStepUpdate.test.js index 58f3afa99..673919f5f 100644 --- a/src/landscape/components/LandscapeForm/BoundaryStepUpdate.test.js +++ b/src/landscape/components/LandscapeForm/BoundaryStepUpdate.test.js @@ -17,7 +17,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import mapboxgl from 'gis/mapbox'; @@ -25,8 +25,8 @@ import LandscapeBoundaries from 'landscape/components/LandscapeForm/BoundaryStep jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), useNavigate: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.js b/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.js index f9434f9fa..7b063397a 100644 --- a/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.js +++ b/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDocumentTitle } from 'common/document'; diff --git a/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.test.js b/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.test.js index 00db4964d..33c665faf 100644 --- a/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.test.js +++ b/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.test.js @@ -17,15 +17,15 @@ import { act, fireEvent, render, screen } from 'tests/utils'; import React from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import DevelopmentStrategyUpdate from 'landscape/components/LandscapeForm/DevelopmentStrategyUpdate'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/KeyInfoNew.test.js b/src/landscape/components/LandscapeForm/KeyInfoNew.test.js index 91caf5f8b..2555b147e 100644 --- a/src/landscape/components/LandscapeForm/KeyInfoNew.test.js +++ b/src/landscape/components/LandscapeForm/KeyInfoNew.test.js @@ -17,7 +17,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { getPlaceInfoByName } from 'gis/gisService'; @@ -27,8 +27,8 @@ jest.mock('terraso-client-shared/terrasoApi/api'); jest.mock('gis/gisService'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/KeyInfoStep.js b/src/landscape/components/LandscapeForm/KeyInfoStep.js index 62d013112..57a5934a7 100644 --- a/src/landscape/components/LandscapeForm/KeyInfoStep.js +++ b/src/landscape/components/LandscapeForm/KeyInfoStep.js @@ -19,7 +19,7 @@ import React, { useMemo, useState } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router'; import * as yup from 'yup'; import { MenuItem, Select, TextareaAutosize, Typography } from '@mui/material'; diff --git a/src/landscape/components/LandscapeForm/KeyInfoUpdate.js b/src/landscape/components/LandscapeForm/KeyInfoUpdate.js index 42ae66084..edc811b29 100644 --- a/src/landscape/components/LandscapeForm/KeyInfoUpdate.js +++ b/src/landscape/components/LandscapeForm/KeyInfoUpdate.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDocumentTitle } from 'common/document'; diff --git a/src/landscape/components/LandscapeForm/KeyInfoUpdate.test.js b/src/landscape/components/LandscapeForm/KeyInfoUpdate.test.js index 626040010..4cb0792eb 100644 --- a/src/landscape/components/LandscapeForm/KeyInfoUpdate.test.js +++ b/src/landscape/components/LandscapeForm/KeyInfoUpdate.test.js @@ -17,15 +17,15 @@ import { act, fireEvent, render, screen, within } from 'tests/utils'; import React from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import KeyInfoUpdate from 'landscape/components/LandscapeForm/KeyInfoUpdate'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/New.js b/src/landscape/components/LandscapeForm/New.js index bfb6496ed..abca9bc1c 100644 --- a/src/landscape/components/LandscapeForm/New.js +++ b/src/landscape/components/LandscapeForm/New.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { Typography } from '@mui/material'; import { visuallyHidden } from '@mui/utils'; diff --git a/src/landscape/components/LandscapeForm/ProfileImageStep.js b/src/landscape/components/LandscapeForm/ProfileImageStep.js index a460f057e..a2adcb4e8 100644 --- a/src/landscape/components/LandscapeForm/ProfileImageStep.js +++ b/src/landscape/components/LandscapeForm/ProfileImageStep.js @@ -21,7 +21,7 @@ import { dataURItoBlob, openFile } from 'media/fileUtils'; import { openImageUrl } from 'media/imageUtils'; import AvatarEditor from 'react-avatar-editor'; import { useTranslation } from 'react-i18next'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router'; import * as yup from 'yup'; import AddIcon from '@mui/icons-material/Add'; import RemoveIcon from '@mui/icons-material/Remove'; diff --git a/src/landscape/components/LandscapeForm/ProfileImageUpdate.js b/src/landscape/components/LandscapeForm/ProfileImageUpdate.js index ee1f20edf..e87720361 100644 --- a/src/landscape/components/LandscapeForm/ProfileImageUpdate.js +++ b/src/landscape/components/LandscapeForm/ProfileImageUpdate.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDocumentTitle } from 'common/document'; diff --git a/src/landscape/components/LandscapeForm/ProfileImageUpdate.test.js b/src/landscape/components/LandscapeForm/ProfileImageUpdate.test.js index 54d5a5b91..5312a4c84 100644 --- a/src/landscape/components/LandscapeForm/ProfileImageUpdate.test.js +++ b/src/landscape/components/LandscapeForm/ProfileImageUpdate.test.js @@ -18,15 +18,15 @@ import { act, fireEvent, render, screen, waitFor } from 'tests/utils'; import React from 'react'; import AvatarEditor from 'react-avatar-editor'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import ProfileImageUpdate from 'landscape/components/LandscapeForm/ProfileImageUpdate'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeForm/ProfileUpdate.js b/src/landscape/components/LandscapeForm/ProfileUpdate.js index dedfa3896..4d3fc3d96 100644 --- a/src/landscape/components/LandscapeForm/ProfileUpdate.js +++ b/src/landscape/components/LandscapeForm/ProfileUpdate.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDocumentTitle } from 'common/document'; diff --git a/src/landscape/components/LandscapeForm/ProfileUpdate.test.js b/src/landscape/components/LandscapeForm/ProfileUpdate.test.js index becc7eb2e..3a98ab4f5 100644 --- a/src/landscape/components/LandscapeForm/ProfileUpdate.test.js +++ b/src/landscape/components/LandscapeForm/ProfileUpdate.test.js @@ -17,7 +17,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { iso639en, iso639es } from 'localization/iso639'; @@ -25,8 +25,8 @@ import ProfileUpdate from 'landscape/components/LandscapeForm/ProfileUpdate'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeList.js b/src/landscape/components/LandscapeList.js index d9e821f04..d2085770f 100644 --- a/src/landscape/components/LandscapeList.js +++ b/src/landscape/components/LandscapeList.js @@ -19,7 +19,7 @@ import React from 'react'; import _ from 'lodash/fp'; import { Trans, useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { Link as RouterLink, useSearchParams } from 'react-router-dom'; +import { Link as RouterLink, useSearchParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDispatch } from 'terrasoApi/store'; import { Button, Card, Link, Stack, Typography } from '@mui/material'; diff --git a/src/landscape/components/LandscapeList.test.js b/src/landscape/components/LandscapeList.test.js index 7b6ee93d8..6a9711aa7 100644 --- a/src/landscape/components/LandscapeList.test.js +++ b/src/landscape/components/LandscapeList.test.js @@ -17,7 +17,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; -import { useSearchParams } from 'react-router-dom'; +import { useSearchParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { mockTerrasoAPIrequestGraphQL } from 'tests/apiUtils'; import useMediaQuery from '@mui/material/useMediaQuery'; @@ -34,8 +34,8 @@ jest.mock('gis/mapbox', () => ({})); jest.mock('@mui/material/useMediaQuery'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useSearchParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeProfile/index.js b/src/landscape/components/LandscapeProfile/index.js index f224ad773..636e54713 100644 --- a/src/landscape/components/LandscapeProfile/index.js +++ b/src/landscape/components/LandscapeProfile/index.js @@ -20,7 +20,7 @@ import _ from 'lodash/fp'; import { usePermission } from 'permissions'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { Grid, Stack } from '@mui/material'; diff --git a/src/landscape/components/LandscapeSharedDataUpload.js b/src/landscape/components/LandscapeSharedDataUpload.js index 0eeb07b16..2469d026f 100644 --- a/src/landscape/components/LandscapeSharedDataUpload.js +++ b/src/landscape/components/LandscapeSharedDataUpload.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import { usePermissionRedirect } from 'permissions'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { CollaborationContextProvider } from 'collaboration/collaborationContext'; import { useDocumentTitle } from 'common/document'; diff --git a/src/landscape/components/LandscapeSharedDataUploadLinks.test.js b/src/landscape/components/LandscapeSharedDataUploadLinks.test.js index 0cbaaad5d..d8744ca62 100644 --- a/src/landscape/components/LandscapeSharedDataUploadLinks.test.js +++ b/src/landscape/components/LandscapeSharedDataUploadLinks.test.js @@ -18,7 +18,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; import _ from 'lodash/fp'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { LANDSCAPE_TYPES_WITH_REDIRECTS } from 'tests/constants'; @@ -26,8 +26,8 @@ import LandscapeSharedDataUpload from './LandscapeSharedDataUpload'; jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), useNavigate: jest.fn(), })); diff --git a/src/landscape/components/LandscapeSharedDataVisualization.js b/src/landscape/components/LandscapeSharedDataVisualization.js index b16a2f4b0..f86f5e8e8 100644 --- a/src/landscape/components/LandscapeSharedDataVisualization.js +++ b/src/landscape/components/LandscapeSharedDataVisualization.js @@ -18,7 +18,7 @@ import React, { useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { CollaborationContextProvider } from 'collaboration/collaborationContext'; diff --git a/src/landscape/components/LandscapeSharedDataVisualization.test.js b/src/landscape/components/LandscapeSharedDataVisualization.test.js index 85ecf9fd7..61d39fa61 100644 --- a/src/landscape/components/LandscapeSharedDataVisualization.test.js +++ b/src/landscape/components/LandscapeSharedDataVisualization.test.js @@ -16,7 +16,7 @@ */ import { act, render, screen, waitFor } from 'tests/utils'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import mapboxgl from 'gis/mapbox'; @@ -30,8 +30,8 @@ jest.mock('terraso-client-shared/terrasoApi/api'); jest.mock('sharedData/visualization/visualizationMarkers'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/components/LandscapeSharedDataVisualizationConfig.js b/src/landscape/components/LandscapeSharedDataVisualizationConfig.js index 407edc6dd..23afd41e8 100644 --- a/src/landscape/components/LandscapeSharedDataVisualizationConfig.js +++ b/src/landscape/components/LandscapeSharedDataVisualizationConfig.js @@ -18,7 +18,7 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { CollaborationContextProvider } from 'collaboration/collaborationContext'; import { useDocumentTitle } from 'common/document'; diff --git a/src/landscape/components/LandscapeView.js b/src/landscape/components/LandscapeView.js index a359e85a0..5172be25a 100644 --- a/src/landscape/components/LandscapeView.js +++ b/src/landscape/components/LandscapeView.js @@ -20,7 +20,7 @@ import _ from 'lodash/fp'; import { usePermission } from 'permissions'; import { Trans, useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import EmailIcon from '@mui/icons-material/Email'; import LaunchIcon from '@mui/icons-material/Launch'; diff --git a/src/landscape/components/LandscapeView.test.js b/src/landscape/components/LandscapeView.test.js index b28e958e3..c201a26b2 100644 --- a/src/landscape/components/LandscapeView.test.js +++ b/src/landscape/components/LandscapeView.test.js @@ -19,7 +19,7 @@ import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; import { when } from 'jest-when'; import _ from 'lodash/fp'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import mapboxgl from 'gis/mapbox'; @@ -30,8 +30,8 @@ const GEOJSON = jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); diff --git a/src/landscape/membership/components/LandscapeMembers.js b/src/landscape/membership/components/LandscapeMembers.js index f6b5ac76f..23c212ac1 100644 --- a/src/landscape/membership/components/LandscapeMembers.js +++ b/src/landscape/membership/components/LandscapeMembers.js @@ -20,7 +20,7 @@ import _ from 'lodash/fp'; import { usePermission } from 'permissions'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDispatch } from 'terrasoApi/store'; diff --git a/src/layout/AppBar.js b/src/layout/AppBar.js index 0ea4719eb..9e8cedb2b 100644 --- a/src/layout/AppBar.js +++ b/src/layout/AppBar.js @@ -18,7 +18,7 @@ import React, { useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { Link, useLocation, useNavigate } from 'react-router-dom'; +import { Link, useLocation, useNavigate } from 'react-router'; import { signOut } from 'terraso-client-shared/account/accountSlice'; import { AppBar, Box, Button, Divider, Toolbar } from '@mui/material'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/src/layout/AppBar.test.js b/src/layout/AppBar.test.js index 431e3ef73..10db1ea77 100644 --- a/src/layout/AppBar.test.js +++ b/src/layout/AppBar.test.js @@ -18,7 +18,7 @@ import { act, fireEvent, render, screen } from 'tests/utils'; import React from 'react'; import Cookies from 'js-cookie'; -import { useLocation, useNavigate } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router'; import useMediaQuery from '@mui/material/useMediaQuery'; import AppBar from 'layout/AppBar'; @@ -27,8 +27,8 @@ import { useOptionalAuth } from 'navigation/components/Routes'; jest.mock('@mui/material/useMediaQuery'); jest.mock('js-cookie'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useNavigate: jest.fn(), useLocation: jest.fn(), })); diff --git a/src/layout/AppWrappers.js b/src/layout/AppWrappers.js index df4cd1f1e..aa3352a9f 100644 --- a/src/layout/AppWrappers.js +++ b/src/layout/AppWrappers.js @@ -20,7 +20,7 @@ import { PermissionsProvider } from 'permissions'; import { Helmet, HelmetProvider } from 'react-helmet-async'; import { useTranslation } from 'react-i18next'; import { Provider } from 'react-redux'; -import { BrowserRouter } from 'react-router-dom'; +import { BrowserRouter } from 'react-router'; import { ThemeProvider } from '@mui/material'; import ErrorMonitoringProvider from 'monitoring/error'; diff --git a/src/navigation/components/Breadcrumbs.test.js b/src/navigation/components/Breadcrumbs.test.js index 0dbed5379..3c67ad19d 100644 --- a/src/navigation/components/Breadcrumbs.test.js +++ b/src/navigation/components/Breadcrumbs.test.js @@ -17,13 +17,13 @@ import { render, screen } from 'tests/utils'; import React, { useMemo } from 'react'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; import { useBreadcrumbsParams } from '../breadcrumbsContext'; import Breadcrumbs from './Breadcrumbs'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useLocation: jest.fn(), })); diff --git a/src/navigation/components/Navigation.js b/src/navigation/components/Navigation.js index c66e3108d..7bd39795e 100644 --- a/src/navigation/components/Navigation.js +++ b/src/navigation/components/Navigation.js @@ -19,7 +19,7 @@ import React from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { Link as RouterLink, useLocation } from 'react-router-dom'; +import { Link as RouterLink, useLocation } from 'react-router'; import { Box, Button, List, ListItem, Typography } from '@mui/material'; import { styled } from '@mui/material/styles'; import { visuallyHidden } from '@mui/utils'; diff --git a/src/navigation/components/Navigation.test.js b/src/navigation/components/Navigation.test.js index a12bc7d4c..cc42f81fb 100644 --- a/src/navigation/components/Navigation.test.js +++ b/src/navigation/components/Navigation.test.js @@ -17,12 +17,12 @@ import { act, fireEvent, render, screen } from 'tests/utils'; import React from 'react'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; import Navigation from 'navigation/components/Navigation'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useLocation: jest.fn(), })); diff --git a/src/navigation/components/Routes.js b/src/navigation/components/Routes.js index 8306cccc2..9d4eba91f 100644 --- a/src/navigation/components/Routes.js +++ b/src/navigation/components/Routes.js @@ -16,7 +16,7 @@ */ import React, { useMemo } from 'react'; -import { matchPath, Route, Routes, useLocation } from 'react-router-dom'; +import { matchPath, Route, Routes, useLocation } from 'react-router'; import { withProps } from 'react-hoc'; diff --git a/src/navigation/components/SkipLinks.js b/src/navigation/components/SkipLinks.js index f0ccad1a7..df20bbf76 100644 --- a/src/navigation/components/SkipLinks.js +++ b/src/navigation/components/SkipLinks.js @@ -18,7 +18,7 @@ import React, { useEffect, useRef } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; import { Link } from '@mui/material'; import './SkipLinks.css'; diff --git a/src/navigation/components/SkipLinks.test.js b/src/navigation/components/SkipLinks.test.js index 594363a7c..01ad26d56 100644 --- a/src/navigation/components/SkipLinks.test.js +++ b/src/navigation/components/SkipLinks.test.js @@ -18,14 +18,14 @@ import { render, screen } from 'tests/utils'; import React, { useRef } from 'react'; import { useSelector } from 'react-redux'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; import PageHeader from 'layout/PageHeader'; import Navigation from 'navigation/components/Navigation'; import SkipLinks from 'navigation/components/SkipLinks'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useLocation: jest.fn(), })); diff --git a/src/navigation/navigationContext.js b/src/navigation/navigationContext.js index 5583d5dbd..009a9e437 100644 --- a/src/navigation/navigationContext.js +++ b/src/navigation/navigationContext.js @@ -19,7 +19,7 @@ import { useCallback, useContext, useEffect, useState } from 'react'; import { UNSAFE_NavigationContext as NavigationContext, useNavigate, -} from 'react-router-dom'; +} from 'react-router'; let originalPush; diff --git a/src/navigation/navigationContext.test.js b/src/navigation/navigationContext.test.js index 11f728471..ca8272070 100644 --- a/src/navigation/navigationContext.test.js +++ b/src/navigation/navigationContext.test.js @@ -19,8 +19,8 @@ import { render } from 'tests/utils'; import { useNavigationBlocker } from './navigationContext'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), useNavigate: jest.fn(), useLocation: jest.fn(), diff --git a/src/navigation/navigationUtils.js b/src/navigation/navigationUtils.js index e29b77ea8..1888d3153 100644 --- a/src/navigation/navigationUtils.js +++ b/src/navigation/navigationUtils.js @@ -18,7 +18,7 @@ import { useCallback, useMemo } from 'react'; import _ from 'lodash/fp'; import queryString from 'query-string'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useNavigate, useSearchParams } from 'react-router'; export const generateReferrerPath = location => { const path = _.getOr('', 'pathname', location); diff --git a/src/navigation/scrollTo.js b/src/navigation/scrollTo.js index 7f8cfae98..85b5539d6 100644 --- a/src/navigation/scrollTo.js +++ b/src/navigation/scrollTo.js @@ -16,7 +16,7 @@ */ import { useEffect } from 'react'; -import { useSearchParams } from 'react-router-dom'; +import { useSearchParams } from 'react-router'; export const scrollToNavBar = () => { document diff --git a/src/permissions/index.js b/src/permissions/index.js index 0ea1896f6..61c62f349 100644 --- a/src/permissions/index.js +++ b/src/permissions/index.js @@ -18,7 +18,7 @@ import React, { useContext, useEffect, useRef, useState } from 'react'; import _ from 'lodash/fp'; import { useSelector } from 'react-redux'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router'; const defaultBehaviour = { isAllowedTo: () => Promise.resolve(false), diff --git a/src/setupTests.js b/src/setupTests.js index c2be90746..7d8427b1a 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -19,3 +19,19 @@ // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom'; + +// TODO: 2024-12-02 +// Work around https://github.com/remix-run/react-router/issues/12363 +// Remove this once https://github.com/jsdom/jsdom/pull/3791 is fixed + +/* eslint-disable no-undef */ + +globalThis.IS_REACT_ACT_ENVIRONMENT = true; + +if (!globalThis.TextEncoder || !globalThis.TextDecoder) { + const { TextDecoder, TextEncoder } = require('node:util'); + globalThis.TextEncoder = TextEncoder; + globalThis.TextDecoder = TextDecoder; +} + +/* eslint-enable no-undef */ diff --git a/src/sharedData/components/SharedResourceDownload.js b/src/sharedData/components/SharedResourceDownload.js index eb341fea5..6f33a959f 100644 --- a/src/sharedData/components/SharedResourceDownload.js +++ b/src/sharedData/components/SharedResourceDownload.js @@ -18,7 +18,7 @@ import React, { useCallback, useEffect } from 'react'; import queryString from 'query-string'; import { useTranslation } from 'react-i18next'; -import { useLocation, useNavigate, useParams } from 'react-router-dom'; +import { useLocation, useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useSelector } from 'terrasoApi/store'; import { Button, Paper, Stack, Typography } from '@mui/material'; diff --git a/src/sharedData/components/SharedResourceDownload.test.js b/src/sharedData/components/SharedResourceDownload.test.js index 1da0c7ac0..5f193d808 100644 --- a/src/sharedData/components/SharedResourceDownload.test.js +++ b/src/sharedData/components/SharedResourceDownload.test.js @@ -17,7 +17,7 @@ import { act, fireEvent, render, screen } from 'tests/utils'; import { when } from 'jest-when'; -import { useLocation, useNavigate, useParams } from 'react-router-dom'; +import { useLocation, useNavigate, useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { useDownloadEvent } from 'monitoring/events'; @@ -30,8 +30,8 @@ jest.mock('monitoring/events', () => ({ useDownloadEvent: jest.fn(), })); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), useNavigate: jest.fn(), useLocation: jest.fn(), diff --git a/src/sharedData/visualization/components/VisualizationConfigForm.test.js b/src/sharedData/visualization/components/VisualizationConfigForm.test.js index 35c8f9aa5..be2af4239 100644 --- a/src/sharedData/visualization/components/VisualizationConfigForm.test.js +++ b/src/sharedData/visualization/components/VisualizationConfigForm.test.js @@ -17,7 +17,7 @@ import * as util from 'util'; import { act, fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { mockTerrasoAPIrequestGraphQL } from 'tests/apiUtils'; @@ -40,8 +40,8 @@ Object.defineProperty(window, 'TextDecoder', { jest.mock('terraso-client-shared/terrasoApi/api'); jest.mock('sharedData/visualization/visualizationMarkers'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useParams: jest.fn(), })); jest.mock('gis/mapbox', () => ({})); diff --git a/src/storyMap/components/StoryMapForm/ShareDialog.js b/src/storyMap/components/StoryMapForm/ShareDialog.js index dcc261977..dd7c30aa0 100644 --- a/src/storyMap/components/StoryMapForm/ShareDialog.js +++ b/src/storyMap/components/StoryMapForm/ShareDialog.js @@ -18,7 +18,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import _ from 'lodash/fp'; import { Trans, useTranslation } from 'react-i18next'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router'; import { useDispatch, useSelector } from 'terrasoApi/store'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { LoadingButton } from '@mui/lab'; diff --git a/src/storyMap/components/StoryMapInvite.js b/src/storyMap/components/StoryMapInvite.js index 97fab3019..26ccf53bc 100644 --- a/src/storyMap/components/StoryMapInvite.js +++ b/src/storyMap/components/StoryMapInvite.js @@ -19,7 +19,7 @@ import { useCallback, useEffect, useMemo } from 'react'; import { jwtDecode } from 'jwt-decode'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useNavigate, useSearchParams } from 'react-router'; import { addMessage } from 'terraso-client-shared/notifications/notificationsSlice'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { Alert } from '@mui/material'; diff --git a/src/storyMap/components/StoryMapInvite.test.js b/src/storyMap/components/StoryMapInvite.test.js index 3728c2c8b..37e694280 100644 --- a/src/storyMap/components/StoryMapInvite.test.js +++ b/src/storyMap/components/StoryMapInvite.test.js @@ -16,7 +16,7 @@ */ import { render, screen, waitFor, within } from 'tests/utils'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useNavigate, useSearchParams } from 'react-router'; import { mockTerrasoAPIrequestGraphQL } from 'tests/apiUtils'; import { useAnalytics } from 'monitoring/analytics'; @@ -35,8 +35,8 @@ const TOKEN = jest.mock('terraso-client-shared/terrasoApi/api'); -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), useNavigate: jest.fn(), useSearchParams: jest.fn(), })); diff --git a/src/storyMap/components/StoryMapNew.js b/src/storyMap/components/StoryMapNew.js index c1b6ef028..319193189 100644 --- a/src/storyMap/components/StoryMapNew.js +++ b/src/storyMap/components/StoryMapNew.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useLocation, useNavigate } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router'; import { Paper, useMediaQuery } from '@mui/material'; import { useDocumentTitle } from 'common/document'; diff --git a/src/storyMap/components/StoryMapUpdate.js b/src/storyMap/components/StoryMapUpdate.js index bda46a815..881ce8d06 100644 --- a/src/storyMap/components/StoryMapUpdate.js +++ b/src/storyMap/components/StoryMapUpdate.js @@ -20,7 +20,7 @@ import _ from 'lodash/fp'; import { usePermission } from 'permissions'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { useDocumentTitle } from 'common/document'; diff --git a/src/storyMap/components/StoryMapsCard.js b/src/storyMap/components/StoryMapsCard.js index 9fa338c23..c64bc5453 100644 --- a/src/storyMap/components/StoryMapsCard.js +++ b/src/storyMap/components/StoryMapsCard.js @@ -18,7 +18,7 @@ import React, { useCallback, useMemo } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router'; import { useDispatch, useSelector } from 'terrasoApi/store'; import DeleteIcon from '@mui/icons-material/Delete'; import PeopleIcon from '@mui/icons-material/People'; diff --git a/src/storyMap/components/StoryMapsToolHome.js b/src/storyMap/components/StoryMapsToolHome.js index 1ee8718d9..213d497a4 100644 --- a/src/storyMap/components/StoryMapsToolHome.js +++ b/src/storyMap/components/StoryMapsToolHome.js @@ -19,7 +19,7 @@ import React, { useMemo } from 'react'; import _ from 'lodash/fp'; import { Trans, useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { Button, diff --git a/src/storyMap/components/UserStoryMap.js b/src/storyMap/components/UserStoryMap.js index f651050cc..4dfeabdc6 100644 --- a/src/storyMap/components/UserStoryMap.js +++ b/src/storyMap/components/UserStoryMap.js @@ -19,7 +19,7 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { serialize } from 'common/components/RichTextEditor/utils'; diff --git a/src/storyMap/components/UserStoryMapEmbed.js b/src/storyMap/components/UserStoryMapEmbed.js index 053fa2c98..d44f319b2 100644 --- a/src/storyMap/components/UserStoryMapEmbed.js +++ b/src/storyMap/components/UserStoryMapEmbed.js @@ -19,7 +19,7 @@ import React, { useCallback, useMemo } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { useFetchData } from 'terraso-client-shared/store/utils'; import { Box, Link, Stack } from '@mui/material';