diff --git a/site/docs/playground.mdx b/site/docs/playground.mdx index e9ec5f95d..510389638 100644 --- a/site/docs/playground.mdx +++ b/site/docs/playground.mdx @@ -6,9 +6,16 @@ sidebar_position: 3 [@wirekang](https://github.com/wirekang) has created a [playground for Kysely](https://kyse.link). You can use it to quickly test stuff out and for creating code examples for your issues, PRs and Discord messages. -import { Playground, exampleFilterById } from '../src/components/Playground' +import { Playground } from '../src/components/Playground' - + ## Codesandbox diff --git a/site/src/components/Playground.module.css b/site/src/components/Playground.module.css new file mode 100644 index 000000000..0f2888d8a --- /dev/null +++ b/site/src/components/Playground.module.css @@ -0,0 +1,6 @@ +.playground { + border: 1px solid var(--gray3); + border-radius: 7px; + min-height: 600px; + width: 100%; +} diff --git a/site/src/components/Playground.tsx b/site/src/components/Playground.tsx index 18d0857f2..17c664000 100644 --- a/site/src/components/Playground.tsx +++ b/site/src/components/Playground.tsx @@ -1,44 +1,56 @@ import { useColorMode } from '@docusaurus/theme-common' +import { useEffect, useState } from 'react' +import styles from './Playground.module.css' -export function Playground({ - code, - setupCode = exampleSetup, - kyselyVersion, - dialect = 'postgres', - disableIframeMode = false, -}: PlaygroundProps) { - const { isDarkTheme } = useColorMode() +export function Playground(props: PlaygroundProps) { + const src = useSrc(props) + + return ( +