Skip to content

Commit 332fc64

Browse files
committed
docs: remove CodeSandbox example for Transition
Since it's a base component that's rarely used on the web, there is no need to add a CodeSandbox demo. Docs for Transition should serve mostly as a reference for CSSTransition and a general intro to react-transition-group.
1 parent c297641 commit 332fc64

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

www/gatsby-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
{
1010
path: '/transition',
1111
displayName: 'Transition',
12-
codeSandboxId: '741op4mmj0',
12+
codeSandboxId: null,
1313
},
1414
{
1515
path: '/css-transition',

www/src/templates/component.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class ComponentTemplate extends React.Component {
5050
const { data, location } = this.props;
5151
const { metadata } = data;
5252
const { componentPages } = data.site.siteMetadata;
53+
const { codeSandboxId } = componentPages.find(
54+
page => page.displayName === metadata.displayName
55+
);
5356
return (
5457
<Layout data={data} location={location}>
5558
<div>
@@ -60,14 +63,14 @@ class ComponentTemplate extends React.Component {
6063
/>
6164
</Container>
6265

63-
<Example
64-
codeSandbox={{
65-
title: `${metadata.displayName} Component`,
66-
id: componentPages.find(
67-
page => page.displayName === metadata.displayName
68-
).codeSandboxId,
69-
}}
70-
/>
66+
{codeSandboxId != null && (
67+
<Example
68+
codeSandbox={{
69+
title: `${metadata.displayName} Component`,
70+
id: codeSandboxId,
71+
}}
72+
/>
73+
)}
7174

7275
<Container>
7376
<h2>

0 commit comments

Comments
 (0)