diff --git a/src/components/left/main/LeftMainHeader.tsx b/src/components/left/main/LeftMainHeader.tsx index 95d6ff4d8..6221d53bb 100644 --- a/src/components/left/main/LeftMainHeader.tsx +++ b/src/components/left/main/LeftMainHeader.tsx @@ -72,6 +72,7 @@ type StateProps = } & Pick; +const ANIMATION_LEVEL_OPTIONS = [0, 1, 2]; const LEGACY_VERSION_URL = 'https://web.telegram.org/?legacy=1'; const WEBK_VERSION_URL = 'https://web.telegram.org/k/'; @@ -202,6 +203,17 @@ const LeftMainHeader: FC = ({ switchTheme(newTheme, animationLevel === ANIMATION_LEVEL_MAX); }, [animationLevel, setSettingOption, theme]); + const handleAnimationLevelChange = useCallback((e: React.SyntheticEvent) => { + e.stopPropagation(); + + const newLevel = animationLevel === 0 ? 2 : 0; + ANIMATION_LEVEL_OPTIONS.forEach((_, i) => { + document.body.classList.toggle(`animation-level-${i}`, newLevel === i); + }); + + setSettingOption({ animationLevel: newLevel }); + }, [animationLevel, setSettingOption]); + const handleChangelogClick = useCallback(() => { window.open(BETA_CHANGELOG_URL, '_blank', 'noopener'); }, []); @@ -284,6 +296,17 @@ const LeftMainHeader: FC = ({ noAnimation /> + + {lang('Appearance.Animations').toLowerCase()} + 0} + /> +