2914 graphql api documentation (#3065)
* Remove dead code * Create playground component * Remove useless call to action * Fix graphiql theme * Fix style * Split components * Move headers to headers form * Fix nodes in open-api components * Remove useless check * Clean code * Fix css differences * Keep carret when fetching schema
This commit is contained in:
27
packages/twenty-docs/src/components/playground.tsx
Normal file
27
packages/twenty-docs/src/components/playground.tsx
Normal file
@ -0,0 +1,27 @@
|
||||
import React, { useState } from 'react';
|
||||
import TokenForm, { TokenFormProps } from '../components/token-form';
|
||||
|
||||
const Playground = (
|
||||
{
|
||||
children,
|
||||
setOpenApiJson,
|
||||
setToken
|
||||
}: Partial<React.PropsWithChildren | TokenFormProps>
|
||||
) => {
|
||||
const [isTokenValid, setIsTokenValid] = useState(false)
|
||||
return (
|
||||
<>
|
||||
<TokenForm
|
||||
setOpenApiJson={setOpenApiJson}
|
||||
setToken={setToken}
|
||||
isTokenValid={isTokenValid}
|
||||
setIsTokenValid={setIsTokenValid}
|
||||
/>
|
||||
{
|
||||
isTokenValid && children
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Playground;
|
||||
Reference in New Issue
Block a user