Skip to content

Commit

Permalink
controls: Hide date/animation sections for divOnly trees
Browse files Browse the repository at this point in the history
Previously, the date/animation control components were hidden, but the
headers were still shown in the side panel. This commit hides the entire
section including the headers to reduce confusion.

Resolves #1833
  • Loading branch information
joverlee521 committed Aug 27, 2024
1 parent 883f55b commit d0a1b05
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/components/controls/controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ function Controls() {
const panelsToDisplay = useSelector((state: RootState) => state.controls.panelsToDisplay);
const showTreeToo = useSelector((state: RootState) => state.controls.showTreeToo);
const canTogglePanelLayout = useSelector((state: RootState) => state.controls.canTogglePanelLayout);
const branchLengthsToDisplay = useSelector((state: RootState) => state.controls.branchLengthsToDisplay);

return (
<ControlsContainer>
<ChooseDataset />

<ControlHeader title={t("sidebar:Date Range")} tooltip={DateRangeInfo}/>
<DateRangeInputs />
<AnimationControls />
{branchLengthsToDisplay !== 'divOnly' &&
<>
<ControlHeader title={t("sidebar:Date Range")} tooltip={DateRangeInfo}/>
<DateRangeInputs />
<AnimationControls />
</>
}

<ControlHeader title={t("sidebar:Color By")} tooltip={ColorByInfo}/>
<ColorBy />
Expand Down Expand Up @@ -110,10 +115,12 @@ function Controls() {
/>
}

<span style={{ marginTop: "10px" }}>
<ControlHeader title={t("sidebar:Animation Options")} tooltip={AnimationOptionsInfo}/>
<AnimationOptions />
</span>
{branchLengthsToDisplay !== "divOnly" &&
<span style={{ marginTop: "10px" }}>
<ControlHeader title={t("sidebar:Animation Options")} tooltip={AnimationOptionsInfo}/>
<AnimationOptions />
</span>
}

{canTogglePanelLayout &&
<>
Expand Down

0 comments on commit d0a1b05

Please sign in to comment.