From 38a3d12e584d6bab44640d81f28d2124f2691bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 17 May 2024 23:33:33 +0200 Subject: [PATCH] Fix ImageComponent style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../compose/editor/nodes/image-component.tsx | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/features/compose/editor/nodes/image-component.tsx b/src/features/compose/editor/nodes/image-component.tsx index f27a97a5f1..b8a706e899 100644 --- a/src/features/compose/editor/nodes/image-component.tsx +++ b/src/features/compose/editor/nodes/image-component.tsx @@ -25,11 +25,11 @@ import { } from 'lexical'; import * as React from 'react'; import { Suspense, useCallback, useEffect, useRef, useState } from 'react'; -import { defineMessages, useIntl } from 'react-intl'; +import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import { openModal } from 'soapbox/actions/modals'; -import { HStack, IconButton } from 'soapbox/components/ui'; -import { useAppDispatch } from 'soapbox/hooks'; +import { HStack, Icon, IconButton } from 'soapbox/components/ui'; +import { useAppDispatch, useSettings } from 'soapbox/hooks'; import { normalizeAttachment } from 'soapbox/normalizers'; import { $isImageNode } from './image-node'; @@ -42,6 +42,7 @@ import type { const messages = defineMessages({ description: { id: 'upload_form.description', defaultMessage: 'Describe for the visually impaired' }, + descriptionMissingTitle: { id: 'upload_form.description_missing.title', defaultMessage: 'This attachment doesn\'t have a description' }, }); const imageCache = new Set(); @@ -93,6 +94,7 @@ const ImageComponent = ({ }): JSX.Element => { const intl = useIntl(); const dispatch = useAppDispatch(); + const { missingDescriptionModal } = useSettings(); const imageRef = useRef(null); const buttonRef = useRef(null); @@ -322,11 +324,16 @@ const ImageComponent = ({ /> -
+