Skip to content

Commit

Permalink
Remove routelistener (#35)
Browse files Browse the repository at this point in the history
* Remove routelistener

* Update orchestrator-component-library version

---------

Co-authored-by: Ruben van Leeuwen <[email protected]>
  • Loading branch information
DutchBen and Ruben van Leeuwen authored May 24, 2024
1 parent 3f7a550 commit 13d700f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 21 additions & 23 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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 };

Expand All @@ -51,17 +50,17 @@ function CustomApp({
const [queryClient] = useState(() => new QueryClient(queryClientConfig));

const [themeMode, setThemeMode] = useState<EuiThemeColorMode>(
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 &&
Expand All @@ -77,7 +76,6 @@ function CustomApp({
initialOrchestratorConfig={orchestratorConfig}
>
<StoreProvider initialOrchestratorConfig={orchestratorConfig}>
<WfoRouteChangeListener />
<SessionProvider session={pageProps.session}>
<NoSSR>
<WfoAuth>
Expand Down Expand Up @@ -143,7 +141,7 @@ function CustomApp({
}

CustomApp.getInitialProps = async (
context: AppContext,
context: AppContext
): Promise<AppOwnProps & AppInitialProps> => {
const ctx = await App.getInitialProps(context);

Expand Down

0 comments on commit 13d700f

Please sign in to comment.