Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pressing the text link causes the validation error to show up #52405

Merged
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
58 changes: 26 additions & 32 deletions src/pages/workspace/companyCards/addNew/DetailsStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import Text from '@components/Text';
import TextInput from '@components/TextInput';
import TextLink from '@components/TextLink';
Expand Down Expand Up @@ -172,40 +171,35 @@ function DetailsStep({policyID}: DetailsStepProps) {
title={translate('workspace.companyCards.addCardFeed')}
onBackButtonPress={handleBackButtonPress}
/>
<ScrollView
style={styles.pt0}
contentContainerStyle={styles.flexGrow1}
<FormProvider
formID={ONYXKEYS.FORMS.ADD_NEW_CARD_FEED_FORM}
submitButtonText={translate('common.submit')}
onSubmit={submit}
validate={validate}
style={[styles.mh5, styles.flexGrow1]}
enabledWhenOffline
>
<Text style={[styles.textHeadlineLineHeightXXL, styles.ph5, styles.mv3]}>
<Text style={[styles.textHeadlineLineHeightXXL, styles.mv3]}>
{!!feedProvider && !isStripeFeedProvider ? translate(`workspace.companyCards.addNewCard.feedDetails.${feedProvider}.title`) : ''}
</Text>
<FormProvider
formID={ONYXKEYS.FORMS.ADD_NEW_CARD_FEED_FORM}
submitButtonText={translate('common.submit')}
onSubmit={submit}
validate={validate}
style={[styles.mh5, styles.flexGrow1]}
enabledWhenOffline
>
{renderInputs()}
{!!feedProvider && !isStripeFeedProvider && (
<View style={[styles.flexRow, styles.alignItemsCenter]}>
<Icon
src={Expensicons.QuestionMark}
width={variables.iconSizeExtraSmall}
height={variables.iconSizeExtraSmall}
fill={theme.icon}
/>
<TextLink
style={[styles.label, styles.textLineHeightNormal, styles.ml2]}
href={CONST.COMPANY_CARDS_HELP}
>
{translate(`workspace.companyCards.addNewCard.feedDetails.${feedProvider}.helpLabel`)}
</TextLink>
</View>
)}
</FormProvider>
</ScrollView>
{renderInputs()}
{!!feedProvider && !isStripeFeedProvider && (
<View style={[styles.flexRow, styles.alignItemsCenter]}>
<Icon
src={Expensicons.QuestionMark}
width={variables.iconSizeExtraSmall}
height={variables.iconSizeExtraSmall}
fill={theme.icon}
/>
<TextLink
style={[styles.label, styles.textLineHeightNormal, styles.ml2]}
href={CONST.COMPANY_CARDS_HELP}
>
{translate(`workspace.companyCards.addNewCard.feedDetails.${feedProvider}.helpLabel`)}
</TextLink>
</View>
)}
</FormProvider>
</ScreenWrapper>
);
}
Expand Down
Loading