Skip to content

Commit

Permalink
update error type to use Localize
Browse files Browse the repository at this point in the history
  • Loading branch information
pasyukevich committed Dec 5, 2023
1 parent 8bafbbf commit 2bfa28d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/components/FormHelpMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import {StyleProp, View, ViewStyle} from 'react-native';
import * as Localize from '@libs/Localize';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';
import {ErrorsList} from '@src/libs/ErrorUtils';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import Text from './Text';

type FormHelpMessageProps = {
/** Error or hint text. Ignored when children is not empty */
message?: string | [string, ErrorsList];
message?: Localize.MaybePhraseKey;

/** Children to render next to dot indicator */
children?: React.ReactNode;
Expand Down
3 changes: 2 additions & 1 deletion src/components/SingleChoiceQuestion.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, {ForwardedRef, forwardRef} from 'react';
import {Text as RNText} from 'react-native';
import type {MaybePhraseKey} from '@libs/Localize';
import useThemeStyles from '@styles/useThemeStyles';
import FormHelpMessage from './FormHelpMessage';
import RadioButtons, {Choice} from './RadioButtons';
import Text from './Text';

type SingleChoiceQuestionProps = {
prompt: string;
errorText?: string | string[];
errorText?: MaybePhraseKey;
possibleAnswers: Choice[];
currentQuestionIndex: number;
onInputChange: (value: string) => void;
Expand Down
1 change: 0 additions & 1 deletion src/libs/ErrorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,4 @@ function addErrorMessage<TKey extends TranslationPaths>(errors: ErrorsList, inpu
}
}

export type {ErrorsList};
export {getAuthenticateErrorMessage, getMicroSecondOnyxError, getMicroSecondOnyxErrorObject, getLatestErrorMessage, getLatestErrorField, getEarliestErrorField, addErrorMessage};

0 comments on commit 2bfa28d

Please sign in to comment.