diff --git a/src/components/controls/controls.tsx b/src/components/controls/controls.tsx index ef32a6f73..2abcfa565 100644 --- a/src/components/controls/controls.tsx +++ b/src/components/controls/controls.tsx @@ -16,6 +16,7 @@ import GeoResolution from "./geo-resolution"; import TransmissionLines from './transmission-lines'; import NormalizeFrequencies from "./frequency-normalization"; import AnimationOptions from "./animation-options"; +import Toggle from "./toggle"; import PanelToggle from "./panel-toggle"; import ToggleTangle from "./toggle-tangle"; import Language from "./language"; @@ -59,6 +60,8 @@ type Props = { function Controls({ treeOn, mapOn, frequenciesOn, measurementsOn, mobileDisplay }: Props) { const { t } = useTranslation(); + const [showAnimationOptions, setShowAnimationOptions] = React.useState(false); + const panelsAvailable = useSelector((state: RootState) => state.controls.panelsAvailable); const showTreeToo = useSelector((state: RootState) => state.controls.showTreeToo); const canTogglePanelLayout = useSelector((state: RootState) => state.controls.canTogglePanelLayout); @@ -69,7 +72,28 @@ function Controls({ treeOn, mapOn, frequenciesOn, measurementsOn, mobileDisplay - + + {/* FIXME: update translations */} + {/* FIXME: combine this custom Toggle and PanelToggle? */} + setShowAnimationOptions(!showAnimationOptions)} + label={""} + style={{ display: "inline" }} + />} + title={t("sidebar:Animate")} + tooltip={AnimationOptionsInfo} + mobile={mobileDisplay} + /> + {showAnimationOptions && + <> + {/* FIXME: combine the two components below? */} + + + + } @@ -152,11 +176,6 @@ function Controls({ treeOn, mapOn, frequenciesOn, measurementsOn, mobileDisplay } - - - - - );