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 = ({ /> -
+