diff --git a/frontend/src/pages/_app.tsx b/frontend/src/pages/_app.tsx index adf86132..266fcbca 100644 --- a/frontend/src/pages/_app.tsx +++ b/frontend/src/pages/_app.tsx @@ -9,8 +9,6 @@ import { useColorScheme } from "@mantine/hooks"; import { ModalsProvider } from "@mantine/modals"; import { NotificationsProvider } from "@mantine/notifications"; import { setCookies } from "cookies-next"; -import { GetServerSidePropsContext } from "next"; -import cookies from "next-cookies"; import type { AppProps } from "next/app"; import { useEffect, useState } from "react"; import Footer from "../components/Footer"; @@ -23,14 +21,10 @@ import globalStyle from "../styles/mantine.style"; import { CurrentUser } from "../types/user.type"; import { GlobalLoadingContext } from "../utils/loading.util"; -function App(props: AppProps & { colorScheme: ColorScheme }) { - const { Component, pageProps } = props; - +function App({ Component, pageProps }: AppProps) { const systemTheme = useColorScheme(); - const [colorScheme, setColorScheme] = useState( - props.colorScheme - ); + const [colorScheme, setColorScheme] = useState(); const [isLoading, setIsLoading] = useState(true); const [user, setUser] = useState(null); @@ -87,9 +81,3 @@ function App(props: AppProps & { colorScheme: ColorScheme }) { } export default App; - -App.getInitialProps = ({ ctx }: { ctx: GetServerSidePropsContext }) => { - return { - colorScheme: cookies(ctx)["color-schema"] || "light", - }; -};