Change media modals look in web UI (#15217)
- Change overlay background to match color of viewed image - Add interactive reply/boost/favourite buttons to footer of modal - Change ugly "View context" link to button among the action bar
This commit is contained in:
		@@ -3,9 +3,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
 | 
			
		||||
import PropTypes from 'prop-types';
 | 
			
		||||
import Video from 'mastodon/features/video';
 | 
			
		||||
import ImmutablePureComponent from 'react-immutable-pure-component';
 | 
			
		||||
import { FormattedMessage } from 'react-intl';
 | 
			
		||||
import classNames from 'classnames';
 | 
			
		||||
import Icon from 'mastodon/components/icon';
 | 
			
		||||
 | 
			
		||||
export const previewState = 'previewVideoModal';
 | 
			
		||||
 | 
			
		||||
@@ -13,7 +10,7 @@ export default class VideoModal extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
  static propTypes = {
 | 
			
		||||
    media: ImmutablePropTypes.map.isRequired,
 | 
			
		||||
    status: ImmutablePropTypes.map,
 | 
			
		||||
    statusId: PropTypes.string,
 | 
			
		||||
    options: PropTypes.shape({
 | 
			
		||||
      startTime: PropTypes.number,
 | 
			
		||||
      autoPlay: PropTypes.bool,
 | 
			
		||||
@@ -48,15 +45,8 @@ export default class VideoModal extends ImmutablePureComponent {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleStatusClick = e => {
 | 
			
		||||
    if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
 | 
			
		||||
      e.preventDefault();
 | 
			
		||||
      this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { media, status, onClose } = this.props;
 | 
			
		||||
    const { media, onClose } = this.props;
 | 
			
		||||
    const options = this.props.options || {};
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
@@ -75,12 +65,6 @@ export default class VideoModal extends ImmutablePureComponent {
 | 
			
		||||
            alt={media.get('description')}
 | 
			
		||||
          />
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        {status && (
 | 
			
		||||
          <div className={classNames('media-modal__meta')}>
 | 
			
		||||
            <a href={status.get('url')} onClick={this.handleStatusClick}><Icon id='comments' /> <FormattedMessage id='lightbox.view_context' defaultMessage='View context' /></a>
 | 
			
		||||
          </div>
 | 
			
		||||
        )}
 | 
			
		||||
      </div>
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user