Skip to content

Commit

Permalink
Bring back crossed eye icon on gallery (#10715)
Browse files Browse the repository at this point in the history
  • Loading branch information
tribela authored and Gargron committed May 8, 2019
1 parent 5c82d66 commit 09eea46
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import Icon from 'mastodon/components/icon';
import { autoPlayGif, displayMedia } from 'mastodon/initial_state';
import classNames from 'classnames';
import { decode } from 'blurhash';
Expand Down Expand Up @@ -91,6 +92,7 @@ export default class MediaItem extends ImmutablePureComponent {
const title = status.get('spoiler_text') || attachment.get('description');

let thumbnail = '';
let icon;

if (attachment.get('type') === 'unknown') {
// Skip
Expand Down Expand Up @@ -132,11 +134,20 @@ export default class MediaItem extends ImmutablePureComponent {
);
}

if (!visible) {
icon = (
<span className='account-gallery__item__icons'>
<Icon id='eye-slash' />
</span>
);
}

return (
<div className='account-gallery__item' style={{ width, height }}>
<a className='media-gallery__item-thumbnail' href={status.get('url')} target='_blank' onClick={this.handleClick} title={title}>
<canvas width={32} height={32} ref={this.setCanvasRef} className={classNames('media-gallery__preview', { 'media-gallery__preview--hidden': visible && loaded })} />
{visible && thumbnail}
{!visible && icon}
</a>
</div>
);
Expand Down
8 changes: 8 additions & 0 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4829,6 +4829,14 @@ a.status-card.compact:hover {
border-radius: 4px;
overflow: hidden;
margin: 2px;

&__icons {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24px;
}
}

.notification__filter-bar,
Expand Down

0 comments on commit 09eea46

Please sign in to comment.