From e86234b1e90975de6e507a86549f0eb4600c723b Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 21 Nov 2019 11:39:07 +0100 Subject: [PATCH] Change media description label to be context-sensitive (#12270) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “Describe for the visually impaired” makes no sense when the uploaded media is an audio file. --- .../features/ui/components/focal_point_modal.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/ui/components/focal_point_modal.js b/app/javascript/mastodon/features/ui/components/focal_point_modal.js index bbd463fca..ddbe3961d 100644 --- a/app/javascript/mastodon/features/ui/components/focal_point_modal.js +++ b/app/javascript/mastodon/features/ui/components/focal_point_modal.js @@ -244,6 +244,16 @@ class FocalPointModal extends ImmutablePureComponent { const previewWidth = 200; const previewHeight = previewWidth / previewRatio; + let descriptionLabel = null; + + if (media.get('type') === 'audio') { + descriptionLabel = ; + } else if (media.get('type') === 'video') { + descriptionLabel = ; + } else { + descriptionLabel = ; + } + return (
@@ -255,7 +265,9 @@ class FocalPointModal extends ImmutablePureComponent {
{focals &&

} - +