diff --git a/src/components/FeedbackSurvey.tsx b/src/components/FeedbackSurvey.tsx index a17cca5efae4..3c677a7b0f6d 100644 --- a/src/components/FeedbackSurvey.tsx +++ b/src/components/FeedbackSurvey.tsx @@ -43,9 +43,12 @@ type FeedbackSurveyProps = { /** Indicates whether a loading indicator should be shown */ isLoading?: boolean; + + /** Should the submit button be enabled when offline */ + enabledWhenOffline?: boolean; }; -function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerText, isNoteRequired, isLoading, formID}: FeedbackSurveyProps) { +function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerText, isNoteRequired, isLoading, formID, enabledWhenOffline = true}: FeedbackSurveyProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); const [draft, draftResults] = useOnyx(`${formID}Draft`); @@ -103,7 +106,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe onSubmit={handleSubmit} submitButtonText={translate('common.submit')} isSubmitButtonVisible={false} - enabledWhenOffline + enabledWhenOffline={enabledWhenOffline} > {title} @@ -138,7 +141,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe onSubmit={handleSubmit} message={translate('common.error.pleaseCompleteForm')} buttonText={translate('common.submit')} - enabledWhenOffline + enabledWhenOffline={enabledWhenOffline} containerStyles={styles.mt3} isLoading={isLoading} /> diff --git a/src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx b/src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx index ab148f8d8edc..d74e126ff94e 100644 --- a/src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx +++ b/src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx @@ -107,6 +107,7 @@ function RequestEarlyCancellationPage() { footerText={{acknowledgementText}} isNoteRequired isLoading={isLoading} + enabledWhenOffline={false} /> ), [acknowledgementText, isLoading, styles.flex1, styles.mb2, styles.mt4, translate],