Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controls: Hide date/animation sections for divOnly trees #1834

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like divOnly should be a member of a global Enum somewhere, but I'll leave that for another day...

<>
<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
Loading