From c79a969504ebcb419eb499c4276f6e88303a244a Mon Sep 17 00:00:00 2001 From: Thebora Kompanioni Date: Thu, 29 Sep 2022 16:04:52 +0200 Subject: [PATCH] deps: update `react-router-dom` from v6.3.0 to v6.4.1 (#519) * deps: update react-router-dom from v6.3.0 to v6.4.1 * test(react-router-dom): fix tests after react-router-dom update --- package-lock.json | 48 ++++++------ package.json | 2 +- src/components/App.tsx | 106 +++++++++++++++------------ src/components/CreateWallet.test.jsx | 8 +- src/components/MainWalletView.jsx | 8 +- src/components/Receive.jsx | 5 +- src/components/Settings.test.jsx | 9 ++- src/components/Wallet.test.jsx | 20 ++--- src/components/Wallets.test.jsx | 8 +- src/index.tsx | 25 +++---- src/testUtils.tsx | 25 +++---- 11 files changed, 142 insertions(+), 122 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e02bf828..70870ced9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "react-dom": "^17.0.2", "react-i18next": "^11.18.6", "react-router-bootstrap": "^0.26.2", - "react-router-dom": "^6.3.0", + "react-router-dom": "^6.4.1", "react-scripts": "^5.0.1", "typescript": "^4.7.2" }, @@ -3833,9 +3833,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.0.tgz", - "integrity": "sha512-SCR1cxRSMNKjaVYptCzBApPDqGwa3FGdjVHc+rOToocNPHQdIYLZBfv/3f+KvYuXDkUGVIW9IAzmPNZDRL1I4A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.1.tgz", + "integrity": "sha512-eBV5rvW4dRFOU1eajN7FmYxjAIVz/mRHgUE9En9mBn6m3mulK3WTR5C3iQhL9MZ14rWAq+xOlEaCkDiW0/heOg==", "dev": true, "engines": { "node": ">=14" @@ -18613,12 +18613,12 @@ } }, "node_modules/react-router": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.0.tgz", - "integrity": "sha512-B+5bEXFlgR1XUdHYR6P94g299SjrfCBMmEDJNcFbpAyRH1j1748yt9NdDhW3++nw1lk3zQJ6aOO66zUx3KlTZg==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.1.tgz", + "integrity": "sha512-OJASKp5AykDWFewgWUim1vlLr7yfD4vO/h+bSgcP/ix8Md+LMHuAjovA74MQfsfhQJGGN1nHRhwS5qQQbbBt3A==", "dev": true, "dependencies": { - "@remix-run/router": "1.0.0" + "@remix-run/router": "1.0.1" }, "engines": { "node": ">=14" @@ -18641,12 +18641,13 @@ } }, "node_modules/react-router-dom": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.0.tgz", - "integrity": "sha512-4Aw1xmXKeleYYQ3x0Lcl2undHR6yMjXZjd9DKZd53SGOYqirrUThyUb0wwAX5VZAyvSuzjNJmZlJ3rR9+/vzqg==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.1.tgz", + "integrity": "sha512-MY7NJCrGNVJtGp8ODMOBHu20UaIkmwD2V3YsAOUQoCXFk7Ppdwf55RdcGyrSj+ycSL9Uiwrb3gTLYSnzcRoXww==", "dev": true, "dependencies": { - "react-router": "6.4.0" + "@remix-run/router": "1.0.1", + "react-router": "6.4.1" }, "engines": { "node": ">=14" @@ -25477,9 +25478,9 @@ } }, "@remix-run/router": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.0.tgz", - "integrity": "sha512-SCR1cxRSMNKjaVYptCzBApPDqGwa3FGdjVHc+rOToocNPHQdIYLZBfv/3f+KvYuXDkUGVIW9IAzmPNZDRL1I4A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.1.tgz", + "integrity": "sha512-eBV5rvW4dRFOU1eajN7FmYxjAIVz/mRHgUE9En9mBn6m3mulK3WTR5C3iQhL9MZ14rWAq+xOlEaCkDiW0/heOg==", "dev": true }, "@restart/hooks": { @@ -36340,12 +36341,12 @@ "dev": true }, "react-router": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.0.tgz", - "integrity": "sha512-B+5bEXFlgR1XUdHYR6P94g299SjrfCBMmEDJNcFbpAyRH1j1748yt9NdDhW3++nw1lk3zQJ6aOO66zUx3KlTZg==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.1.tgz", + "integrity": "sha512-OJASKp5AykDWFewgWUim1vlLr7yfD4vO/h+bSgcP/ix8Md+LMHuAjovA74MQfsfhQJGGN1nHRhwS5qQQbbBt3A==", "dev": true, "requires": { - "@remix-run/router": "1.0.0" + "@remix-run/router": "1.0.1" } }, "react-router-bootstrap": { @@ -36358,12 +36359,13 @@ } }, "react-router-dom": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.0.tgz", - "integrity": "sha512-4Aw1xmXKeleYYQ3x0Lcl2undHR6yMjXZjd9DKZd53SGOYqirrUThyUb0wwAX5VZAyvSuzjNJmZlJ3rR9+/vzqg==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.1.tgz", + "integrity": "sha512-MY7NJCrGNVJtGp8ODMOBHu20UaIkmwD2V3YsAOUQoCXFk7Ppdwf55RdcGyrSj+ycSL9Uiwrb3gTLYSnzcRoXww==", "dev": true, "requires": { - "react-router": "6.4.0" + "@remix-run/router": "1.0.1", + "react-router": "6.4.1" } }, "react-scripts": { diff --git a/package.json b/package.json index d72efbec4..e76c4f729 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "react-dom": "^17.0.2", "react-i18next": "^11.18.6", "react-router-bootstrap": "^0.26.2", - "react-router-dom": "^6.3.0", + "react-router-dom": "^6.4.1", "react-scripts": "^5.0.1", "typescript": "^4.7.2" }, diff --git a/src/components/App.tsx b/src/components/App.tsx index 7ea0c053c..d3d98e52c 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' import * as rb from 'react-bootstrap' import { useTranslation } from 'react-i18next' -import { Navigate, Route, Routes } from 'react-router-dom' +import { createBrowserRouter, createRoutesFromElements, Navigate, Route, RouterProvider } from 'react-router-dom' import { routes } from '../constants/routes' import { useSessionConnectionError } from '../context/ServiceInfoContext' import { useSettings } from '../context/SettingsContext' @@ -40,6 +40,62 @@ export default function App() { setCurrentWallet(null) }, [setCurrentWallet]) + const router = createBrowserRouter( + createRoutesFromElements( + + + + {sessionConnectionError && ( + + {t('app.alert_no_connection', { connectionError: sessionConnectionError.message })}. + + )} + + + +