Browse Source

fix loading

AykutSarac 3 years ago
parent
commit
2f75500843
4 changed files with 5 additions and 8 deletions
  1. 1 1
      next.config.js
  2. 0 0
      public/sw.js.map
  3. 1 6
      src/containers/Editor/index.tsx
  4. 3 1
      src/containers/JsonEditor/index.tsx

+ 1 - 1
next.config.js

@@ -16,7 +16,7 @@ const nextConfig = {
   pwa: {
     dest: "public",
     register: true,
-    skipWaiting: true,
+    scope: '/editor'
   },
 };
 

File diff suppressed because it is too large
+ 0 - 0
public/sw.js.map


+ 1 - 6
src/containers/Editor/index.tsx

@@ -1,17 +1,12 @@
 import React from "react";
-import dynamic from "next/dynamic";
 import { Sidebar } from "src/components/Sidebar";
 import { LiveEditor } from "src/containers/LiveEditor";
-import { Loading } from "src/components/Loading";
+import { JsonEditor } from "src/containers/JsonEditor";
 import { Incompatible } from "src/containers/Incompatible";
 import * as Styles from "src/containers/Editor/styles";
 import { useConfig } from "src/hocs/config";
 import { Allotment } from "allotment";
 
-const JsonEditor = dynamic(() => import("src/containers/JsonEditor"), {
-  loading: () => <Loading message="Loading Editor..." />,
-});
-
 const Editor: React.FC = () => {
   const {
     states: { settings },

+ 3 - 1
src/containers/JsonEditor/index.tsx

@@ -104,4 +104,6 @@ const JsonEditor: React.FC = () => {
   );
 };
 
-export default React.memo(JsonEditor);
+const memoizedJsonEditor = React.memo(JsonEditor)
+
+export { memoizedJsonEditor as JsonEditor } ;

Some files were not shown because too many files changed in this diff