From 13d700ff0ef0de6f08f381424589ba9192c740eb Mon Sep 17 00:00:00 2001 From: Ruben van Leeuwen Date: Fri, 24 May 2024 12:20:53 +0200 Subject: [PATCH] Remove routelistener (#35) * Remove routelistener * Update orchestrator-component-library version --------- Co-authored-by: Ruben van Leeuwen --- package-lock.json | 6 +++--- pages/_app.tsx | 44 +++++++++++++++++++++----------------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb1bd96..366ca94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2945,9 +2945,9 @@ } }, "node_modules/@orchestrator-ui/orchestrator-ui-components": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/@orchestrator-ui/orchestrator-ui-components/-/orchestrator-ui-components-1.21.0.tgz", - "integrity": "sha512-8cNWX8miqs+ASD2oRrNvnxK88WnKPFRdh35b3eU9ACXlWFNsjePvOYks3QVBRwnoEQ8XKhHVlGmvSvXr7Pc40g==", + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@orchestrator-ui/orchestrator-ui-components/-/orchestrator-ui-components-1.23.0.tgz", + "integrity": "sha512-abjXsEA0q/JmeB75S0E1XsmRxZIzu4rwHK9wC3lenhPntFsThKzdnrc6BSvbiqmfP7DBnrvKcW5DhzgQzivVsA==", "dependencies": { "@emotion/css": "^11.11.2", "@emotion/react": "^11.11.1", diff --git a/pages/_app.tsx b/pages/_app.tsx index fe4b14e..95479fe 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,17 +1,17 @@ -import React, { useEffect, useState } from 'react'; -import NoSSR from 'react-no-ssr'; -import { QueryClient, QueryClientProvider } from 'react-query'; -import { ReactQueryDevtools } from 'react-query/devtools'; -import { QueryClientConfig } from 'react-query/types/core/types'; +import React, { useEffect, useState } from "react"; +import NoSSR from "react-no-ssr"; +import { QueryClient, QueryClientProvider } from "react-query"; +import { ReactQueryDevtools } from "react-query/devtools"; +import { QueryClientConfig } from "react-query/types/core/types"; -import { SessionProvider } from 'next-auth/react'; -import { NextAdapter } from 'next-query-params'; -import App, { AppContext, AppInitialProps, AppProps } from 'next/app'; -import Head from 'next/head'; -import { QueryParamProvider } from 'use-query-params'; +import { SessionProvider } from "next-auth/react"; +import { NextAdapter } from "next-query-params"; +import App, { AppContext, AppInitialProps, AppProps } from "next/app"; +import Head from "next/head"; +import { QueryParamProvider } from "use-query-params"; -import { EuiProvider, EuiThemeColorMode } from '@elastic/eui'; -import '@elastic/eui/dist/eui_theme_light.min.css'; +import { EuiProvider, EuiThemeColorMode } from "@elastic/eui"; +import "@elastic/eui/dist/eui_theme_light.min.css"; import { ColorModes, ConfirmationDialogContextWrapper, @@ -21,16 +21,15 @@ import { WfoAuth, WfoErrorBoundary, WfoPageTemplate, - WfoRouteChangeListener, WfoToastsList, defaultOrchestratorTheme, -} from '@orchestrator-ui/orchestrator-ui-components'; +} from "@orchestrator-ui/orchestrator-ui-components"; -import { getAppLogo } from '@/components/AppLogo/AppLogo'; -import { getInitialOrchestratorConfig } from '@/configuration'; -import { TranslationsProvider } from '@/translations/translationsProvider'; +import { getAppLogo } from "@/components/AppLogo/AppLogo"; +import { getInitialOrchestratorConfig } from "@/configuration"; +import { TranslationsProvider } from "@/translations/translationsProvider"; -import '../font/inter.css'; +import "../font/inter.css"; type AppOwnProps = { orchestratorConfig: OrchestratorConfig }; @@ -51,17 +50,17 @@ function CustomApp({ const [queryClient] = useState(() => new QueryClient(queryClientConfig)); const [themeMode, setThemeMode] = useState( - ColorModes.LIGHT, + ColorModes.LIGHT ); const handleThemeSwitch = (newThemeMode: EuiThemeColorMode) => { setThemeMode(newThemeMode); - localStorage.setItem('themeMode', newThemeMode); + localStorage.setItem("themeMode", newThemeMode); }; useEffect(() => { // Initialize theme mode from localStorage or set it to 'light' if not present - const storedTheme = localStorage.getItem('themeMode'); + const storedTheme = localStorage.getItem("themeMode"); if ( !storedTheme || (storedTheme !== ColorModes.LIGHT && @@ -77,7 +76,6 @@ function CustomApp({ initialOrchestratorConfig={orchestratorConfig} > - @@ -143,7 +141,7 @@ function CustomApp({ } CustomApp.getInitialProps = async ( - context: AppContext, + context: AppContext ): Promise => { const ctx = await App.getInitialProps(context);