Browse Source

feat: Swipeable media

pull/4/head
Sorin Davidoi 4 years ago
parent
commit
bc6e958229
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      app/javascript/mastodon/features/ui/components/media_modal.js

+ 4
- 1
app/javascript/mastodon/features/ui/components/media_modal.js View File

@ -1,4 +1,5 @@
import React from 'react';
import ReactSwipeable from 'react-swipeable';
import LoadingIndicator from '../../../components/loading_indicator';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
@ -84,7 +85,9 @@ class MediaModal extends ImmutablePureComponent {
<div className='media-modal__content'>
<IconButton className='media-modal__close' title={intl.formatMessage(messages.close)} icon='times' onClick={onClose} size={16} />
{content}
<ReactSwipeable onSwipedRight={this.handlePrevClick} onSwipedLeft={this.handleNextClick}>
{content}
</ReactSwipeable>
</div>
{rightNav}

Loading…
Cancel
Save