Skip to content

Commit

Permalink
Merge pull request #52405 from bernhardoj/fix/52144-validation-error-…
Browse files Browse the repository at this point in the history
…shown-when-pressing-link

Fix pressing the text link causes the validation error to show up
  • Loading branch information
mountiny authored Nov 14, 2024
2 parents 79e4f33 + 4a6b0a2 commit e2feb5f
Showing 1 changed file with 26 additions and 32 deletions.
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

0 comments on commit e2feb5f

Please sign in to comment.