From 949ff526bbc62bc46748f03ffc396d6d3c21d128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 14 Jun 2024 18:21:40 +0200 Subject: [PATCH 1/3] Fix switcher --- .../src/app/_components/playground/token-form.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/twenty-website/src/app/_components/playground/token-form.tsx b/packages/twenty-website/src/app/_components/playground/token-form.tsx index 398fbad7a525..1a0051c62edd 100644 --- a/packages/twenty-website/src/app/_components/playground/token-form.tsx +++ b/packages/twenty-website/src/app/_components/playground/token-form.tsx @@ -195,7 +195,9 @@ const TokenForm = ({ className="select" onChange={(event) => router.replace( - '/' + pathname.split('/').at(-2) + '/' + event.target.value, + pathname.split('/').slice(0, -1).join('/') + + '/' + + event.target.value, ) } value={pathname.split('/').at(-1)} From 0e59ec70f9b9f1369f103481df3e4f44d4b2a660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 14 Jun 2024 18:58:44 +0200 Subject: [PATCH 2/3] Fix playground --- .../src/app/_components/playground/graphql-playground.tsx | 2 ++ .../src/app/developers/graphql/core/page.tsx | 7 ++++++- .../src/app/developers/graphql/metadata/page.tsx | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/twenty-website/src/app/_components/playground/graphql-playground.tsx b/packages/twenty-website/src/app/_components/playground/graphql-playground.tsx index 3f2a3e12eb37..fbeb3642e5ca 100644 --- a/packages/twenty-website/src/app/_components/playground/graphql-playground.tsx +++ b/packages/twenty-website/src/app/_components/playground/graphql-playground.tsx @@ -12,6 +12,8 @@ import Playground from './playground'; import 'graphiql/graphiql.css'; import '@graphiql/plugin-explorer/dist/style.css'; +export const dynamic = 'force-dynamic'; + const StyledContainer = styled.div` height: 100%; `; diff --git a/packages/twenty-website/src/app/developers/graphql/core/page.tsx b/packages/twenty-website/src/app/developers/graphql/core/page.tsx index e6a0bc9481ed..f2c9e18ff56c 100644 --- a/packages/twenty-website/src/app/developers/graphql/core/page.tsx +++ b/packages/twenty-website/src/app/developers/graphql/core/page.tsx @@ -1,6 +1,11 @@ +'use client'; import React from 'react'; +import dynamic from 'next/dynamic'; -import GraphQlPlayground from '../../../_components/playground/graphql-playground'; +const GraphQlPlayground = dynamic( + () => import('../../../_components/playground/graphql-playground'), + { ssr: false }, +); const CoreGraphql = () => { return ; diff --git a/packages/twenty-website/src/app/developers/graphql/metadata/page.tsx b/packages/twenty-website/src/app/developers/graphql/metadata/page.tsx index b215e2344458..ebc4490ae132 100644 --- a/packages/twenty-website/src/app/developers/graphql/metadata/page.tsx +++ b/packages/twenty-website/src/app/developers/graphql/metadata/page.tsx @@ -1,6 +1,11 @@ +'use client'; import React from 'react'; +import dynamic from 'next/dynamic'; -import GraphQlPlayground from '../../../_components/playground/graphql-playground'; +const GraphQlPlayground = dynamic( + () => import('../../../_components/playground/graphql-playground'), + { ssr: false }, +); const CoreGraphql = () => { return ; From d80f7155cbc835bd7e356685060658463df133e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 14 Jun 2024 19:05:31 +0200 Subject: [PATCH 3/3] remove force dynamic --- .../src/app/_components/playground/graphql-playground.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/twenty-website/src/app/_components/playground/graphql-playground.tsx b/packages/twenty-website/src/app/_components/playground/graphql-playground.tsx index fbeb3642e5ca..3f2a3e12eb37 100644 --- a/packages/twenty-website/src/app/_components/playground/graphql-playground.tsx +++ b/packages/twenty-website/src/app/_components/playground/graphql-playground.tsx @@ -12,8 +12,6 @@ import Playground from './playground'; import 'graphiql/graphiql.css'; import '@graphiql/plugin-explorer/dist/style.css'; -export const dynamic = 'force-dynamic'; - const StyledContainer = styled.div` height: 100%; `;