From f9e7d1463bcbd044736ac457532c13a09cdaf447 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Thu, 30 Dec 2021 19:42:04 +0530 Subject: [PATCH] chore: disable nextjs ssr --- .../src/pageComponents/Main/index.js | 10 +++------- packages/grafnode-run/src/pages/_app.js | 16 +++++++++++++--- packages/grafnode-run/src/styles/globals.css | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/grafnode-run/src/pageComponents/Main/index.js b/packages/grafnode-run/src/pageComponents/Main/index.js index 740ce0a03..3aeaac731 100644 --- a/packages/grafnode-run/src/pageComponents/Main/index.js +++ b/packages/grafnode-run/src/pageComponents/Main/index.js @@ -33,11 +33,6 @@ import 'codemirror/addon/hint/show-hint.css'; const RequestTabPanel = dynamic(import('@grafnode/components').then(mod => mod.RequestTabPanel), { ssr: false }); export default function Main() { - // disable ssr - if(typeof window === 'undefined') { - return null; - } - const [state, dispatch] = useStore(); const { @@ -72,5 +67,6 @@ export default function Main() { - ) -} \ No newline at end of file + ); +}; + diff --git a/packages/grafnode-run/src/pages/_app.js b/packages/grafnode-run/src/pages/_app.js index 445558e4e..30ee12fd6 100644 --- a/packages/grafnode-run/src/pages/_app.js +++ b/packages/grafnode-run/src/pages/_app.js @@ -6,11 +6,21 @@ import 'react-tabs/style/react-tabs.css'; import 'codemirror/lib/codemirror.css'; import 'graphiql/graphiql.min.css'; +function SafeHydrate({ children }) { + return ( +
+ {typeof window === 'undefined' ? null : children} +
+ ) +} + function MyApp({ Component, pageProps }) { return ( - - - + + + + + ); } diff --git a/packages/grafnode-run/src/styles/globals.css b/packages/grafnode-run/src/styles/globals.css index 78178bcd3..c0d97efbb 100644 --- a/packages/grafnode-run/src/styles/globals.css +++ b/packages/grafnode-run/src/styles/globals.css @@ -2,7 +2,7 @@ html, body { margin: 0; padding: 0; font-size: 1rem; - color: rgb(62 62 62); + color: rgb(48 48 48); font-kerning: none; text-rendering: optimizeSpeed;