Forum Panel: Support swipe-to-close for RTL languages (#2250)
This commit is contained in:
parent
930f82eb65
commit
89a5647fd4
@ -154,7 +154,9 @@ const ForumPanel: FC<OwnProps & StateProps> = ({
|
|||||||
return captureEvents(ref.current!, {
|
return captureEvents(ref.current!, {
|
||||||
selectorToPreventScroll: '.chat-list',
|
selectorToPreventScroll: '.chat-list',
|
||||||
onSwipe: ((e, direction) => {
|
onSwipe: ((e, direction) => {
|
||||||
if (direction === SwipeDirection.Right) {
|
const closeDirection = lang.isRtl ? SwipeDirection.Left : SwipeDirection.Right;
|
||||||
|
|
||||||
|
if (direction === closeDirection) {
|
||||||
closeForumPanel();
|
closeForumPanel();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -162,7 +164,7 @@ const ForumPanel: FC<OwnProps & StateProps> = ({
|
|||||||
return false;
|
return false;
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}, [closeForumPanel]);
|
}, [closeForumPanel, lang.isRtl]);
|
||||||
|
|
||||||
function renderTopics() {
|
function renderTopics() {
|
||||||
const viewportOffset = orderedIds!.indexOf(viewportIds![0]);
|
const viewportOffset = orderedIds!.indexOf(viewportIds![0]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user