mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-27 15:22:56 +08:00
update folder structure
This commit is contained in:
parent
3feb5983a4
commit
a8167f53d6
@ -10,12 +10,6 @@ const withPWA = require("next-pwa")({
|
|||||||
*/
|
*/
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
exportPathMap: async () => ({
|
|
||||||
"/": { page: "/" },
|
|
||||||
"/editor": { page: "/Editor" },
|
|
||||||
"/widget": { page: "/Widget" },
|
|
||||||
"/embed": { page: "/Embed" },
|
|
||||||
}),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = withPWA(nextConfig);
|
module.exports = withPWA(nextConfig);
|
||||||
|
@ -3,11 +3,11 @@ import dynamic from "next/dynamic";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { baseURL } from "src/constants/data";
|
import { baseURL } from "src/constants/data";
|
||||||
|
import { darkTheme, lightTheme } from "src/constants/theme";
|
||||||
import { NodeModal } from "src/containers/Modals/NodeModal";
|
import { NodeModal } from "src/containers/Modals/NodeModal";
|
||||||
import useGraph from "src/store/useGraph";
|
import useGraph from "src/store/useGraph";
|
||||||
import { parser } from "src/utils/jsonParser";
|
import { parser } from "src/utils/jsonParser";
|
||||||
import styled, { ThemeProvider } from "styled-components";
|
import styled, { ThemeProvider } from "styled-components";
|
||||||
import { darkTheme, lightTheme } from "src/constants/theme";
|
|
||||||
|
|
||||||
const Graph = dynamic<any>(() => import("src/components/Graph").then(c => c.Graph), {
|
const Graph = dynamic<any>(() => import("src/components/Graph").then(c => c.Graph), {
|
||||||
ssr: false,
|
ssr: false,
|
||||||
@ -90,7 +90,6 @@ const WidgetPage = () => {
|
|||||||
if (!inIframe()) push("/");
|
if (!inIframe()) push("/");
|
||||||
}, [collapsedNodes, collapsedEdges, loading, push]);
|
}, [collapsedNodes, collapsedEdges, loading, push]);
|
||||||
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const handler = (event: EmbedMessage) => {
|
const handler = (event: EmbedMessage) => {
|
||||||
try {
|
try {
|
||||||
@ -100,11 +99,13 @@ const WidgetPage = () => {
|
|||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
direction: "RIGHT",
|
direction: "RIGHT",
|
||||||
...event.data.options
|
theme,
|
||||||
|
...event.data.options,
|
||||||
};
|
};
|
||||||
|
|
||||||
setGraphValue("direction", options.direction);
|
setGraphValue("direction", options.direction);
|
||||||
if (options.theme === "light" || options.theme === "dark") setTheme(options.theme);
|
if (options.theme === "light" || options.theme === "dark")
|
||||||
|
setTheme(options.theme);
|
||||||
|
|
||||||
setGraphValue("nodes", nodes);
|
setGraphValue("nodes", nodes);
|
||||||
setGraphValue("edges", edges);
|
setGraphValue("edges", edges);
|
||||||
@ -116,7 +117,7 @@ const WidgetPage = () => {
|
|||||||
|
|
||||||
window.addEventListener("message", handler);
|
window.addEventListener("message", handler);
|
||||||
return () => window.removeEventListener("message", handler);
|
return () => window.removeEventListener("message", handler);
|
||||||
}, [setGraphValue]);
|
}, [setGraphValue, theme]);
|
||||||
|
|
||||||
if (query.json)
|
if (query.json)
|
||||||
return (
|
return (
|
Loading…
x
Reference in New Issue
Block a user