Follow-up

This commit is contained in:
Alexander Zinchuk 2021-06-14 22:11:21 +03:00
parent 72c0bcd38b
commit 70af1ed7f6
3 changed files with 5 additions and 4 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "telegram-t",
"version": "1.0.0",
"version": "1.0.0-0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -139,7 +139,7 @@ const LeftMainHeader: FC<OwnProps & StateProps & DispatchProps> = ({
openChat({ id: currentUserId });
}, [currentUserId, openChat]);
const handleDarkModeToggle = useCallback((e: React.SyntheticEvent<HTMLDivElement>) => {
const handleDarkModeToggle = useCallback((e: React.SyntheticEvent<HTMLElement>) => {
e.stopPropagation();
const newTheme = theme === 'light' ? 'dark' : 'light';
@ -147,7 +147,7 @@ const LeftMainHeader: FC<OwnProps & StateProps & DispatchProps> = ({
switchTheme(newTheme, animationLevel > 0);
}, [animationLevel, setSettingOption, theme]);
const handleAnimationLevelChange = useCallback((e: React.SyntheticEvent<HTMLDivElement>) => {
const handleAnimationLevelChange = useCallback((e: React.SyntheticEvent<HTMLElement>) => {
e.stopPropagation();
const newLevel = animationLevel === 0 ? 2 : 0;

View File

@ -5,7 +5,7 @@ import useLang from '../../hooks/useLang';
import './MenuItem.scss';
type OnClickHandler = (e: React.SyntheticEvent<HTMLDivElement>) => void;
type OnClickHandler = (e: React.SyntheticEvent<HTMLDivElement | HTMLAnchorElement>) => void;
type OwnProps = {
icon?: string;
@ -87,6 +87,7 @@ const MenuItem: FC<OwnProps> = (props) => {
target={href.startsWith(window.location.origin) ? '_self' : '_blank'}
rel="noopener noreferrer"
dir={lang.isRtl ? 'rtl' : undefined}
onClick={onClick}
>
{content}
</a>