Skip to content

Commit

Permalink
feat: customize the initial width of the side panel
Browse files Browse the repository at this point in the history
close #1558
  • Loading branch information
hamed-musallam committed May 19, 2022
1 parent b1f8ae1 commit 9a2be39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/component/NMRium.tsx
Expand Up @@ -2,6 +2,7 @@

import { css } from '@emotion/react';
import { RootLayout } from 'analysis-ui-components';
import { InitialSeparation } from 'analysis-ui-components/lib-esm/layout/SplitPane';
import { CorrelationData } from 'nmr-correlation';
import {
useEffect,
Expand Down Expand Up @@ -136,6 +137,7 @@ export type NMRiumPreferences = Partial<{
hideGeneralSettings: boolean;
experimentalFeatures: PanelPreferencesType;
hidePanelOnLoad: boolean;
initialPanelWidth?: InitialSeparation;
}>;
panels: Partial<{
spectraPanel: PanelPreferencesType;
Expand Down
6 changes: 3 additions & 3 deletions src/component/SplitPaneWrapper.tsx
Expand Up @@ -4,13 +4,13 @@ import { usePreferences } from './context/PreferencesContext';

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

0 comments on commit 9a2be39

Please sign in to comment.