Profile: Bigger swipe interactive area (#1326)

This commit is contained in:
Alexander Zinchuk 2021-07-26 17:35:53 +03:00
parent 1a8df50987
commit c9d430a5cd

View File

@ -102,15 +102,12 @@ const PrivateChatInfo: FC<OwnProps & StateProps & DispatchProps> = ({
// Support for swipe gestures and closing on click // Support for swipe gestures and closing on click
useEffect(() => { useEffect(() => {
const element = document.querySelector<HTMLDivElement>( const element = document.querySelector<HTMLDivElement>('.photo-wrapper');
'.profile-slide-container > .active, .profile-slide-container > .to',
);
if (!element) { if (!element) {
return undefined; return undefined;
} }
return captureEvents(element, { return captureEvents(element, {
excludedClosestSelector: '.navigation',
onSwipe: IS_TOUCH_ENV ? (e, direction) => { onSwipe: IS_TOUCH_ENV ? (e, direction) => {
if (direction === SwipeDirection.Right) { if (direction === SwipeDirection.Right) {
selectPreviousMedia(); selectPreviousMedia();