diff --git a/src/CONST.ts b/src/CONST.ts index a81987bd0c47..ccf7ed1405d0 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -4882,9 +4882,10 @@ type Country = keyof typeof CONST.ALL_COUNTRIES; type IOUType = ValueOf; type IOUAction = ValueOf; type IOURequestType = ValueOf; +type FeedbackSurveyOptionID = ValueOf, 'ID'>>; type SubscriptionType = ValueOf; -export type {Country, IOUAction, IOUType, RateAndUnit, OnboardingPurposeType, IOURequestType, SubscriptionType}; +export type {Country, IOUAction, IOUType, RateAndUnit, OnboardingPurposeType, IOURequestType, SubscriptionType, FeedbackSurveyOptionID}; export default CONST; diff --git a/src/components/FeedbackSurvey.tsx b/src/components/FeedbackSurvey.tsx index 3b7d6475262b..925448046076 100644 --- a/src/components/FeedbackSurvey.tsx +++ b/src/components/FeedbackSurvey.tsx @@ -5,11 +5,13 @@ import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; +import type {FeedbackSurveyOptionID} from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; import FixedFooter from './FixedFooter'; import FormAlertWithSubmitButton from './FormAlertWithSubmitButton'; import SingleOptionSelector from './SingleOptionSelector'; import Text from './Text'; +import TextInput from './TextInput'; type FeedbackSurveyProps = { /** Title of the survey */ @@ -19,14 +21,14 @@ type FeedbackSurveyProps = { description: string; /** Callback to be called when the survey is submitted */ - onSubmit: (reason: Option) => void; + onSubmit: (reason: FeedbackSurveyOptionID, note?: string) => void; /** Styles for the option row element */ optionRowStyles?: StyleProp; }; type Option = { - key: string; + key: FeedbackSurveyOptionID; label: TranslationPaths; }; @@ -44,6 +46,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles}: Feedbac const selectCircleStyles: StyleProp = {borderColor: theme.border}; const [reason, setReason] = useState