Skip to content

Commit

Permalink
Applies Prettier rules to project
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardovdheijden committed Jun 3, 2024
1 parent f0bedfe commit 0b06b8d
Showing 1 changed file with 32 additions and 33 deletions.
65 changes: 32 additions & 33 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
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 { useRouter } from "next/router";
import { QueryParamProvider } from "use-query-params";

import type { EuiSideNavItemType } from "@elastic/eui";
import { EuiProvider, EuiThemeColorMode } from "@elastic/eui";
import "@elastic/eui/dist/eui_theme_light.min.css";

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 { useRouter } from 'next/router';
import { QueryParamProvider } from 'use-query-params';

import type { EuiSideNavItemType } from '@elastic/eui';
import { EuiProvider, EuiThemeColorMode } from '@elastic/eui';
import '@elastic/eui/dist/eui_theme_light.min.css';
import {
ColorModes,
ConfirmationDialogContextWrapper,
Expand All @@ -27,13 +26,13 @@ import {
WfoPageTemplate,
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 @@ -55,17 +54,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 @@ -76,19 +75,19 @@ function CustomApp({
}, []);

const addMenuItems = (
defaultMenuItems: EuiSideNavItemType<object>[]
defaultMenuItems: EuiSideNavItemType<object>[],
): EuiSideNavItemType<object>[] => [
...defaultMenuItems,
{
name: "Example form",
id: "10",
isSelected: router.pathname === "/example-form",
href: "/example-form",
name: 'Example form',
id: '10',
isSelected: router.pathname === '/example-form',
href: '/example-form',
renderItem: () => (
<WfoMenuItemLink
path={"/example-form"}
path={'/example-form'}
translationString="Example form"
isSelected={router.pathname === "/example-form"}
isSelected={router.pathname === '/example-form'}
/>
),
},
Expand Down Expand Up @@ -168,7 +167,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 0b06b8d

Please sign in to comment.