Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5647,6 +5647,7 @@ const CONST = {
ACCESSIBILITY_LABELS: {
COLLAPSE: 'Collapse',
EXPAND: 'Expand',
ERROR: 'Error',
},

/**
Expand Down
9 changes: 7 additions & 2 deletions src/components/DotIndicatorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import {isReceiptError, isTranslationKeyError} from '@libs/ErrorUtils';
import fileDownload from '@libs/fileDownload';
import handleRetryPress from '@libs/ReceiptUploadRetryHandler';
import CONST from '@src/CONST';
import type {TranslationKeyError} from '@src/types/onyx/OnyxCommon';
import type {ReceiptError} from '@src/types/onyx/Transaction';
import ConfirmModal from './ConfirmModal';
Expand Down Expand Up @@ -65,7 +66,6 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr

const isErrorMessage = type === 'error';
const receiptError = uniqueMessages.find(isReceiptError);

const handleLinkPress = (href: string) => {
if (!receiptError) {
return;
Expand Down Expand Up @@ -118,7 +118,12 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr

return (
<View style={[styles.dotIndicatorMessage, style]}>
<View style={styles.offlineFeedbackErrorDot}>
<View
style={styles.offlineFeedbackErrorDot}
accessible={isErrorMessage}
role={isErrorMessage ? CONST.ROLE.IMG : undefined}
accessibilityLabel={isErrorMessage ? (CONST.ACCESSIBILITY_LABELS.ERROR as string) : undefined}
>
<Icon
src={expensifyIcons.DotIndicator}
fill={isErrorMessage ? theme.danger : theme.success}
Expand Down
17 changes: 13 additions & 4 deletions src/components/FormHelpMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import Parser from '@libs/Parser';
import CONST from '@src/CONST';
import Icon from './Icon';
import RenderHTML from './RenderHTML';
import Text from './Text';
Expand Down Expand Up @@ -52,17 +53,25 @@ function FormHelpMessage({message = '', children, isError = true, style, shouldS
return `<muted-text-label>${replacedText}</muted-text-label>`;
}, [isError, message, shouldRenderMessageAsHTML]);

const errorIconLabel = isError && shouldShowRedDotIndicator ? CONST.ACCESSIBILITY_LABELS.ERROR : undefined;

if (isEmpty(message) && isEmpty(children)) {
return null;
}

return (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mt2, styles.mb1, style]}>
{isError && shouldShowRedDotIndicator && (
<Icon
src={icons.DotIndicator}
fill={theme.danger}
/>
<View
accessible
role={CONST.ROLE.IMG}
accessibilityLabel={errorIconLabel}
>
<Icon
src={icons.DotIndicator}
fill={theme.danger}
/>
</View>
)}
{isInfo && (
<Icon
Expand Down
Loading