Skip to content

Commit

Permalink
refactor: remove unnecessary controls prop from DataStory component…
Browse files Browse the repository at this point in the history
…s when `controls` is empty
  • Loading branch information
stone-lyl committed Feb 18, 2025
1 parent d567273 commit cab36ea
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 11 deletions.
2 changes: 0 additions & 2 deletions packages/docs/components/demos/DocsFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default () => {
const { app, loading: appLoading } = useRequestApp();

const { data: diagram, loading: diagramLoading } = useRequest(async() => {
console.log('Dhe fuck?')
await core.boot();
const diagram = core.getDiagramBuilder()
.add('Signal', { label: 'Read',period: 20, count: 100000 })
Expand Down Expand Up @@ -56,7 +55,6 @@ export default () => {
options.run()
})
}}
controls={[]}
hideActivityBar={true}
/>
</div>
Expand Down
1 change: 0 additions & 1 deletion packages/docs/components/demos/HeroFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default () => {
client={client}
initDiagram={diagram}
onInitialize={(options) => options.run()}
controls={[]}
/>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion packages/docs/components/demos/NodeDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default ({ nodeName }: { nodeName: string }) => {
<DataStory
client={client}
initDiagram={diagram}
controls={[]}
/>
</div>
</div>
Expand Down
5 changes: 1 addition & 4 deletions packages/docs/components/demos/Tree/CustomActivityBar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
'use client'

import { DataStory } from '@data-story/ui';
import { core, nodes } from '@data-story/core';
import { core } from '@data-story/core';
import { CustomizeJSClient } from '../../splash/CustomizeJSClient';
import { useRequestApp } from '../../hooks/useRequestApp';

export default () => {
const { Signal, Comment, Ignore } = nodes;

const diagram = core.getDiagramBuilder()
.add('Signal', { label: 'DataSource', period: 200, count: 100 })
.add('Ignore', { label: 'Storage' })
Expand All @@ -22,7 +20,6 @@ export default () => {
<div className="w-full h-80 border-gray-400 border-4">
<DataStory
client={client}
controls={[]}
hideSidebar={true}
hideActivityBar={['settings']}
/>
Expand Down
1 change: 0 additions & 1 deletion packages/docs/components/demos/Tree/Empty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default () => {
<DataStory
client={client}
onInitialize={(options) => options.run()}
controls={[]}
/>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion packages/docs/components/demos/Tree/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default () => {
<DataStory
client={client}
onInitialize={(options) => options.run()}
controls={[]}
/>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion packages/docs/components/demos/Tree/SingleDiagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default () => {
<div className="w-full h-80 border-gray-400 border-4">
<DataStory
client={client}
controls={[]}
hideSidebar={true}
hideActivityBar={true}
/>
Expand Down

0 comments on commit cab36ea

Please sign in to comment.