Skip to content

Commit 77b305b

Browse files
tribelahiyuki2578
authored andcommitted
Bring back crossed eye icon on gallery (mastodon#10715)
1 parent 536e927 commit 77b305b

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

app/javascript/mastodon/features/account_gallery/components/media_item.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import ImmutablePropTypes from 'react-immutable-proptypes';
44
import ImmutablePureComponent from 'react-immutable-pure-component';
5+
import Icon from 'mastodon/components/icon';
56
import { autoPlayGif, displayMedia } from 'mastodon/initial_state';
67
import classNames from 'classnames';
78
import { decode } from 'blurhash';
@@ -91,6 +92,7 @@ export default class MediaItem extends ImmutablePureComponent {
9192
const title = status.get('spoiler_text') || attachment.get('description');
9293

9394
let thumbnail = '';
95+
let icon;
9496

9597
if (attachment.get('type') === 'unknown') {
9698
// Skip
@@ -132,11 +134,20 @@ export default class MediaItem extends ImmutablePureComponent {
132134
);
133135
}
134136

137+
if (!visible) {
138+
icon = (
139+
<span className='account-gallery__item__icons'>
140+
<Icon id='eye-slash' />
141+
</span>
142+
);
143+
}
144+
135145
return (
136146
<div className='account-gallery__item' style={{ width, height }}>
137147
<a className='media-gallery__item-thumbnail' href={status.get('url')} target='_blank' onClick={this.handleClick} title={title}>
138148
<canvas width={32} height={32} ref={this.setCanvasRef} className={classNames('media-gallery__preview', { 'media-gallery__preview--hidden': visible && loaded })} />
139149
{visible && thumbnail}
150+
{!visible && icon}
140151
</a>
141152
</div>
142153
);

app/javascript/styles/mastodon/components.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4829,6 +4829,14 @@ a.status-card.compact:hover {
48294829
border-radius: 4px;
48304830
overflow: hidden;
48314831
margin: 2px;
4832+
4833+
&__icons {
4834+
position: absolute;
4835+
top: 50%;
4836+
left: 50%;
4837+
transform: translate(-50%, -50%);
4838+
font-size: 24px;
4839+
}
48324840
}
48334841

48344842
.notification__filter-bar,

0 commit comments

Comments
 (0)