From d82c495c0fcfe259f0b52386349a01a89c3e13cb Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 2 Oct 2018 15:54:25 +0200 Subject: [PATCH] Add media description (or status spoiler) in account media gallery --- .../features/account_gallery/components/media_item.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js index 2e48ab7995..3740b614f4 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js +++ b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js @@ -24,7 +24,7 @@ export default class MediaItem extends ImmutablePureComponent { const y = ((focusY / -2) + .5) * 100; const style = {}; - let label, icon; + let label, icon, title; if (media.get('type') === 'gifv') { label = GIF; @@ -33,17 +33,24 @@ export default class MediaItem extends ImmutablePureComponent { if (visible) { style.backgroundImage = `url(${media.get('preview_url')})`; style.backgroundPosition = `${x}% ${y}%`; + title = media.get('description'); } else { icon = ( ); + title = status.get('spoiler_text') || media.get('description'); } return (
- + {icon} {label}