From 89a5647fd4ed35cbf3e50d99747bf5ff24aa4801 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sun, 8 Jan 2023 02:43:57 +0100 Subject: [PATCH] Forum Panel: Support swipe-to-close for RTL languages (#2250) --- src/components/left/main/ForumPanel.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/left/main/ForumPanel.tsx b/src/components/left/main/ForumPanel.tsx index 5a61a0a9e..a29058043 100644 --- a/src/components/left/main/ForumPanel.tsx +++ b/src/components/left/main/ForumPanel.tsx @@ -154,7 +154,9 @@ const ForumPanel: FC = ({ return captureEvents(ref.current!, { selectorToPreventScroll: '.chat-list', onSwipe: ((e, direction) => { - if (direction === SwipeDirection.Right) { + const closeDirection = lang.isRtl ? SwipeDirection.Left : SwipeDirection.Right; + + if (direction === closeDirection) { closeForumPanel(); return true; } @@ -162,7 +164,7 @@ const ForumPanel: FC = ({ return false; }), }); - }, [closeForumPanel]); + }, [closeForumPanel, lang.isRtl]); function renderTopics() { const viewportOffset = orderedIds!.indexOf(viewportIds![0]);