|
@@ -1,5 +1,6 @@
|
|
|
import React from "react";
|
|
|
import type { AppProps } from "next/app";
|
|
|
+import localFont from "next/font/local";
|
|
|
import { MantineProvider } from "@mantine/core";
|
|
|
import { init } from "@sentry/nextjs";
|
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
@@ -9,7 +10,7 @@ import GlobalStyle from "src/constants/globalStyle";
|
|
|
import { darkTheme, lightTheme } from "src/constants/theme";
|
|
|
import { ModalController } from "src/containers/ModalController";
|
|
|
import useStored from "src/store/useStored";
|
|
|
-import { ThemeProvider, useTheme } from "styled-components";
|
|
|
+import { ThemeProvider } from "styled-components";
|
|
|
|
|
|
if (process.env.NODE_ENV !== "development") {
|
|
|
init({
|
|
@@ -28,8 +29,14 @@ const queryClient = new QueryClient({
|
|
|
},
|
|
|
});
|
|
|
|
|
|
+const monaSans = localFont({
|
|
|
+ src: "../pages/Mona-Sans.woff2",
|
|
|
+ variable: "--mona-sans",
|
|
|
+ display: "swap",
|
|
|
+ fallback: ["Arial, Helvetica, sans-serif", "Tahoma, Verdana, sans-serif"],
|
|
|
+});
|
|
|
+
|
|
|
function JsonCrack({ Component, pageProps }: AppProps) {
|
|
|
- const theme = useTheme();
|
|
|
const [isReady, setReady] = React.useState(false);
|
|
|
const lightmode = useStored(state => state.lightmode);
|
|
|
|
|
@@ -41,35 +48,46 @@ function JsonCrack({ Component, pageProps }: AppProps) {
|
|
|
return (
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
<GoogleAnalytics />
|
|
|
- <MantineProvider
|
|
|
- theme={{
|
|
|
- colorScheme: lightmode ? "light" : "dark",
|
|
|
- components: {
|
|
|
- Divider: {
|
|
|
- styles: () => ({
|
|
|
- root: {
|
|
|
- borderTopColor: "#4D4D4D !important",
|
|
|
- },
|
|
|
- }),
|
|
|
- },
|
|
|
- Modal: {
|
|
|
- styles: theme => ({
|
|
|
- title: {
|
|
|
- fontWeight: 700,
|
|
|
- },
|
|
|
- header: {
|
|
|
- backgroundColor: theme.colorScheme === "dark" ? "#36393E" : "#FFFFFF",
|
|
|
- },
|
|
|
- body: {
|
|
|
- backgroundColor: theme.colorScheme === "dark" ? "#36393E" : "#FFFFFF",
|
|
|
- },
|
|
|
- }),
|
|
|
+ <ThemeProvider theme={lightmode ? lightTheme : darkTheme}>
|
|
|
+ <GlobalStyle />
|
|
|
+ <MantineProvider
|
|
|
+ withGlobalStyles
|
|
|
+ withNormalizeCSS
|
|
|
+ withCSSVariables
|
|
|
+ theme={{
|
|
|
+ colorScheme: lightmode ? "light" : "dark",
|
|
|
+ fontFamily: monaSans.style.fontFamily,
|
|
|
+ components: {
|
|
|
+ Divider: {
|
|
|
+ styles: () => ({
|
|
|
+ root: {
|
|
|
+ borderTopColor: "#4D4D4D !important",
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ },
|
|
|
+ Modal: {
|
|
|
+ styles: theme => ({
|
|
|
+ title: {
|
|
|
+ fontWeight: 700,
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+ backgroundColor: theme.colorScheme === "dark" ? "#36393E" : "#FFFFFF",
|
|
|
+ },
|
|
|
+ body: {
|
|
|
+ backgroundColor: theme.colorScheme === "dark" ? "#36393E" : "#FFFFFF",
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ },
|
|
|
+ Button: {
|
|
|
+ styles: theme => ({
|
|
|
+ inner: {
|
|
|
+ fontWeight: 700,
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- }}
|
|
|
- >
|
|
|
- <ThemeProvider theme={lightmode ? lightTheme : darkTheme}>
|
|
|
- <GlobalStyle />
|
|
|
+ }}
|
|
|
+ >
|
|
|
<Component {...pageProps} />
|
|
|
<ModalController />
|
|
|
<Toaster
|
|
@@ -86,8 +104,8 @@ function JsonCrack({ Component, pageProps }: AppProps) {
|
|
|
},
|
|
|
}}
|
|
|
/>
|
|
|
- </ThemeProvider>
|
|
|
- </MantineProvider>
|
|
|
+ </MantineProvider>
|
|
|
+ </ThemeProvider>
|
|
|
</QueryClientProvider>
|
|
|
);
|
|
|
}
|