Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

fix: react minified error dynamic loading

AykutSaracbe0ff402d839
diff --git a/src/containers/Landing/HeroPreview.tsx b/src/containers/Landing/HeroPreview.tsx
index 86c68314..6ff54826 100644
--- a/src/containers/Landing/HeroPreview.tsx
+++ b/src/containers/Landing/HeroPreview.tsx
@@ -6,6 +6,7 @@ export const HeroPreview = () => {
<Container component="section" id="preview" fluid mx="lg">
<Image
src="./assets/preview/free.webp"
+ loading="eager"
maw={1036}
mx="auto"
alt="JSON Crack editor preview"
diff --git a/src/layout/Loading.tsx b/src/layout/Loading.tsx
deleted file mode 100644
index 8f251fac..00000000
--- a/src/layout/Loading.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React from "react";
-import { useRouter } from "next/router";
-import { LoadingOverlay } from "@mantine/core";
-
-export const Loading = () => {
- const router = useRouter();
- const [loading, setLoading] = React.useState(false);
-
- React.useEffect(() => {
- const handleStart = (url: string) => {
- return url !== router.asPath && (url === "/editor" || url === "/widget") && setLoading(true);
- };
-
- const handleComplete = (url: string) => url === router.asPath && setLoading(false);
-
- router.events.on("routeChangeStart", handleStart);
- router.events.on("routeChangeComplete", handleComplete);
- router.events.on("routeChangeError", handleComplete);
-
- return () => {
- router.events.off("routeChangeStart", handleStart);
- router.events.off("routeChangeComplete", handleComplete);
- router.events.off("routeChangeError", handleComplete);
- };
- });
-
- if (loading) {
- return <LoadingOverlay visible loaderProps={{ color: "#7AB1FF", size: 70 }} />;
- }
-
- return null;
-};
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index f83564aa..b3819619 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,23 +1,18 @@
import React from "react";
import type { AppProps } from "next/app";
-import dynamic from "next/dynamic";
import Head from "next/head";
import { useRouter } from "next/router";
-import { createTheme } from "@mantine/core";
+import { MantineProvider, createTheme } from "@mantine/core";
import "@mantine/core/styles.css";
import "@mantine/code-highlight/styles.css";
import { ThemeProvider } from "styled-components";
import ReactGA from "react-ga4";
+import { Toaster } from "react-hot-toast";
import GlobalStyle from "src/constants/globalStyle";
import { lightTheme } from "src/constants/theme";
-import { Loading } from "src/layout/Loading";
import { supabase } from "src/lib/api/supabase";
import useUser from "src/store/useUser";
-const MantineProvider = dynamic(() => import("@mantine/core").then(c => c.MantineProvider), {
- ssr: false,
-});
-
const theme = createTheme({
autoContrast: true,
fontSmoothing: false,
@@ -50,8 +45,6 @@ const theme = createTheme({
},
});
-const Toaster = dynamic(() => import("react-hot-toast").then(c => c.Toaster));
-
const isDevelopment = process.env.NODE_ENV === "development";
const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GA_ID as string;
@@ -84,28 +77,27 @@ function JsonCrack({ Component, pageProps }: AppProps) {
<Head>
<title>JSON Crack | Transform your data into interactive graphs</title>
</Head>
- <ThemeProvider theme={lightTheme}>
- <Toaster
- position="bottom-right"
- containerStyle={{
- bottom: 34,
- right: 8,
- fontSize: 14,
- }}
- toastOptions={{
- style: {
- background: "#4D4D4D",
- color: "#B9BBBE",
- borderRadius: 4,
- },
- }}
- />
- <GlobalStyle />
- <MantineProvider defaultColorScheme="light" theme={theme}>
- <Loading />
+ <MantineProvider defaultColorScheme="light" theme={theme}>
+ <ThemeProvider theme={lightTheme}>
+ <Toaster
+ position="bottom-right"
+ containerStyle={{
+ bottom: 34,
+ right: 8,
+ fontSize: 14,
+ }}
+ toastOptions={{
+ style: {
+ background: "#4D4D4D",
+ color: "#B9BBBE",
+ borderRadius: 4,
+ },
+ }}
+ />
+ <GlobalStyle />
<Component {...pageProps} />
- </MantineProvider>
- </ThemeProvider>
+ </ThemeProvider>
+ </MantineProvider>
</>
);
}