Skip to content

Commit

Permalink
Merge pull request #291 from stone-lyl/feat-add-node
Browse files Browse the repository at this point in the history
fix: set fixed width and height for `ReactFlow` to resolve warning
  • Loading branch information
stone-lyl authored Sep 13, 2024
2 parents 7e371fc + e3c14ba commit 4ca323a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/docs/components/demos/TinkerDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { DataStory } from '@data-story/ui'
import { core, str, } from '@data-story/core';
import { MockJSClient } from '../splash/MockJSClient';
import { useRequestApp } from '../hooks/useRequestApp';
import { useMemo } from 'react';
import useRequest from 'ahooks/lib/useRequest';

// This component is just a place to sketch
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/components/demos/Tree/CustomActivityBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default () => {
client={client}
hideControls={true}
hideSidebar={true}
hideActivityBar={['settings', 'explorer']}
hideActivityBar={['settings']}
/>
</div>
);
Expand Down
6 changes: 4 additions & 2 deletions packages/ui/src/components/DataStory/DataStory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const DataStoryComponent = (
activeKey={sidebarKey}
onClose={setIsSidebarClose}/>
</Allotment.Pane>
<Allotment.Pane visible={!isSidebarClose} snap maxSize={500}>
<Allotment.Pane visible={!isSidebarClose} snap maxSize={500} preferredSize={300}>
<Sidebar
tree={tree}
handleClickExplorerNode={handleClickExplorerNode}
Expand All @@ -142,7 +142,9 @@ export const DataStoryComponent = (
setSidebarKey={setSidebarKey} node={selectedNode}
onUpdateNodeData={setUpdateSelectedNodeData} onClose={setIsSidebarClose}/>
</Allotment.Pane>
<Allotment.Pane minSize={300}>
{/*The Allotment.Pane will recalculate the width and height of the child components.*/}
{/*The className is used to address the ReactFlow warning.*/}
<Allotment.Pane minSize={300} className="h-full w-96">
<DataStoryCanvas
{...props}
onSave={saveTree}
Expand Down

0 comments on commit 4ca323a

Please sign in to comment.