Skip to content

Commit 8fb0af5

Browse files
authored
Remove playground from examples page (#322)
1 parent b4d3b51 commit 8fb0af5

File tree

2 files changed

+28
-32
lines changed

2 files changed

+28
-32
lines changed

apps/typegpu-docs/src/components/ExampleList.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import {
2-
PLAYGROUND_KEY,
3-
examplesByCategory,
4-
} from '../utils/examples/exampleContent';
1+
import { examplesByCategory } from '../utils/examples/exampleContent';
52
import { exampleCategories } from '../utils/examples/types';
63
import { ExampleLink } from './ExampleLink';
74

85
function ExampleList() {
96
return (
107
<>
118
<nav className="flex flex-col flex-1 gap-7 py-4 overflow-y-auto min-w-64">
12-
<ExampleLink key={PLAYGROUND_KEY} exampleKey={PLAYGROUND_KEY}>
9+
{/* <ExampleLink key={PLAYGROUND_KEY} exampleKey={PLAYGROUND_KEY}>
1310
Playground
1411
</ExampleLink>
15-
<hr />
12+
<hr /> */}
1613
{exampleCategories.map((category) =>
1714
(examplesByCategory[category.key] ?? []).map((example) => (
1815
<ExampleLink key={example.key} exampleKey={example.key}>

apps/typegpu-docs/src/components/ExamplePage.tsx

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { useAtom, useSetAtom } from 'jotai';
2-
import { decompressFromEncodedURIComponent } from 'lz-string';
32
import { Suspense, useEffect, useRef } from 'react';
43
import { currentExampleAtom } from '../utils/examples/currentExampleAtom';
5-
import { PLAYGROUND_KEY, examples } from '../utils/examples/exampleContent';
4+
import { examples } from '../utils/examples/exampleContent';
65
import { ExampleNotFound } from './ExampleNotFound';
76
import { ExampleView } from './ExampleView';
87

@@ -41,31 +40,31 @@ function ExamplePage() {
4140
return <RedirectToFlagship />;
4241
}
4342

44-
if (currentExample === PLAYGROUND_KEY) {
45-
setCurrentExample(
46-
`${PLAYGROUND_KEY}${localStorage.getItem(PLAYGROUND_KEY) ?? ''}`,
47-
);
48-
}
43+
// if (currentExample === PLAYGROUND_KEY) {
44+
// setCurrentExample(
45+
// `${PLAYGROUND_KEY}${localStorage.getItem(PLAYGROUND_KEY) ?? ''}`,
46+
// );
47+
// }
4948

50-
if (currentExample.startsWith(PLAYGROUND_KEY)) {
51-
return (
52-
<ExampleView
53-
key={PLAYGROUND_KEY}
54-
example={{
55-
key: PLAYGROUND_KEY,
56-
code:
57-
decompressFromEncodedURIComponent(
58-
currentExample.slice(PLAYGROUND_KEY.length),
59-
) ?? '',
60-
metadata: {
61-
title: 'Playground',
62-
category: '',
63-
},
64-
}}
65-
isPlayground={true}
66-
/>
67-
);
68-
}
49+
// if (currentExample.startsWith(PLAYGROUND_KEY)) {
50+
// return (
51+
// <ExampleView
52+
// key={PLAYGROUND_KEY}
53+
// example={{
54+
// key: PLAYGROUND_KEY,
55+
// code:
56+
// decompressFromEncodedURIComponent(
57+
// currentExample.slice(PLAYGROUND_KEY.length),
58+
// ) ?? '',
59+
// metadata: {
60+
// title: 'Playground',
61+
// category: '',
62+
// },
63+
// }}
64+
// isPlayground={true}
65+
// />
66+
// );
67+
// }
6968

7069
if (currentExample in examples) {
7170
return (

0 commit comments

Comments
 (0)