Skip to content

Commit

Permalink
feat: force SplitPanel re-render when hidePanelOnLoad value change
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Jun 10, 2022
1 parent 6b2792c commit 9f01e7f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/component/SplitPaneWrapper.tsx
Expand Up @@ -4,13 +4,15 @@ import { usePreferences } from './context/PreferencesContext';

export function SplitPaneWrapper({ children }) {
const { current } = usePreferences();
const general = current?.display?.general || {};
const { hidePanelOnLoad = false, initialPanelWidth = '560px' } =
current?.display?.general || {};
return (
<SplitPane
initialSeparation={general?.initialPanelWidth || '560px'}
key={hidePanelOnLoad ? 'true' : 'false'}
initialSeparation={initialPanelWidth}
orientation="horizontal"
sideSeparation="end"
initialClosed={general?.hidePanelOnLoad || false}
initialClosed={hidePanelOnLoad || false}
minimumSize={600}
>
{children}
Expand Down

0 comments on commit 9f01e7f

Please sign in to comment.