diff --git a/package-lock.json b/package-lock.json index 363149e71572..92723d366795 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "date-fns-tz": "^2.0.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", - "expensify-common": "2.0.72", + "expensify-common": "2.0.76", "expo": "^50.0.3", "expo-av": "~13.10.4", "expo-image": "1.11.0", @@ -26136,9 +26136,9 @@ } }, "node_modules/expensify-common": { - "version": "2.0.72", - "resolved": "https://registry.npmjs.org/expensify-common/-/expensify-common-2.0.72.tgz", - "integrity": "sha512-/mrlSic8y3D7pbbGMe3ZtDhHOS+WmrqgBEy3P/o9qW6CFpczs9cqjp9DfF8L53qvGtiD7cm5au4tapj01Yas/g==", + "version": "2.0.76", + "resolved": "https://registry.npmjs.org/expensify-common/-/expensify-common-2.0.76.tgz", + "integrity": "sha512-nCM6laaj25kurdiD9rhAXmQKhi8eciIFlshN8P4A7gsjFIScXnRG8fwXM5tX+8ET0vqAOA2SACeNVTT3vGUUsQ==", "dependencies": { "awesome-phonenumber": "^5.4.0", "classnames": "2.5.0", diff --git a/package.json b/package.json index 23e47a1fc887..549a5fb85e75 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "date-fns-tz": "^2.0.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", - "expensify-common": "2.0.72", + "expensify-common": "2.0.76", "expo": "^50.0.3", "expo-av": "~13.10.4", "expo-image": "1.11.0", diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx index 1e73cce1630f..12e2f11d943a 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx @@ -57,6 +57,7 @@ function ImageRenderer({tnode}: ImageRendererProps) { const previewSource = tryResolveUrlFromApiRoot(htmlAttribs.src); const source = tryResolveUrlFromApiRoot(isAttachmentOrReceipt ? attachmentSourceAttribute : htmlAttribs.src); + const alt = htmlAttribs.alt; const imageWidth = (htmlAttribs['data-expensify-width'] && parseInt(htmlAttribs['data-expensify-width'], 10)) || undefined; const imageHeight = (htmlAttribs['data-expensify-height'] && parseInt(htmlAttribs['data-expensify-height'], 10)) || undefined; const imagePreviewModalDisabled = htmlAttribs['data-expensify-preview-modal-disabled'] === 'true'; @@ -71,6 +72,7 @@ function ImageRenderer({tnode}: ImageRendererProps) { fallbackIcon={fallbackIcon} imageWidth={imageWidth} imageHeight={imageHeight} + altText={alt} /> ); diff --git a/src/components/ImageWithSizeCalculation.tsx b/src/components/ImageWithSizeCalculation.tsx index 3d940103715d..ebea1a90efca 100644 --- a/src/components/ImageWithSizeCalculation.tsx +++ b/src/components/ImageWithSizeCalculation.tsx @@ -25,6 +25,9 @@ type ImageWithSizeCalculationProps = { /** Url for image to display */ url: string | ImageSourcePropType; + /** alt text for the image */ + altText?: string; + /** Any additional styles to apply */ style?: StyleProp; @@ -46,7 +49,7 @@ type ImageWithSizeCalculationProps = { * performing some calculation on a network image after fetching dimensions so * it can be appropriately resized. */ -function ImageWithSizeCalculation({url, style, onMeasure, onLoadFailure, isAuthTokenRequired, objectPosition = CONST.IMAGE_OBJECT_POSITION.INITIAL}: ImageWithSizeCalculationProps) { +function ImageWithSizeCalculation({url, altText, style, onMeasure, onLoadFailure, isAuthTokenRequired, objectPosition = CONST.IMAGE_OBJECT_POSITION.INITIAL}: ImageWithSizeCalculationProps) { const styles = useThemeStyles(); const isLoadedRef = useRef(null); const [isImageCached, setIsImageCached] = useState(true); @@ -97,6 +100,7 @@ function ImageWithSizeCalculation({url, style, onMeasure, onLoadFailure, isAuthT { diff --git a/src/components/ThumbnailImage.tsx b/src/components/ThumbnailImage.tsx index 04d0200ea228..cea528e4537c 100644 --- a/src/components/ThumbnailImage.tsx +++ b/src/components/ThumbnailImage.tsx @@ -23,6 +23,9 @@ type ThumbnailImageProps = { /** Source URL for the preview image */ previewSourceURL: string | ImageSourcePropType; + /** alt text for the image */ + altText?: string; + /** Any additional styles to apply */ style?: StyleProp; @@ -61,6 +64,7 @@ type UpdateImageSizeParams = { function ThumbnailImage({ previewSourceURL, + altText, style, isAuthTokenRequired, imageWidth = 200, @@ -132,6 +136,7 @@ function ThumbnailImage({ setFailedToLoad(true)} isAuthTokenRequired={isAuthTokenRequired}