Skip to content

Commit

Permalink
feat(api): add flag to disable playground (#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Feb 21, 2025
1 parent fe5a8e3 commit 18f50a6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions fern/apis/fdr/definition/navigation/latest/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ types:

PlaygroundSettings:
properties:
disabled:
type: optional<boolean>
docs: Whether the playground is disabled. Defaults to false.
environments:
type: optional<list<commons.EnvironmentId>>
docs: |
Expand Down
3 changes: 3 additions & 0 deletions fern/apis/fdr/definition/navigation/v1/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ types:

PlaygroundSettings:
properties:
disabled:
type: optional<boolean>
docs: Whether the playground is disabled. Defaults to false.
environments:
type: optional<list<commons.EnvironmentId>>
docs: |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/fern-docs/ui/src/playground/PlaygroundButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const PlaygroundButton: FC<{
}> = ({ state }) => {
const openPlayground = useOpenPlayground();
const isPlaygroundEnabled = useAtomValue(IS_PLAYGROUND_ENABLED_ATOM);
const settings = usePlaygroundSettings(state.id);
const settings = usePlaygroundSettings(state.id ?? state);

if (!isPlaygroundEnabled) {
if (!isPlaygroundEnabled || settings?.disabled) {
return null;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18f50a6

Please sign in to comment.