Skip to content

Commit

Permalink
Merge pull request #56226 from shubham1206agra/fix-transaction-date-m…
Browse files Browse the repository at this point in the history
…odal-cc

Fixed save button layout in Company card transaction start date page
  • Loading branch information
mountiny authored Feb 6, 2025
2 parents 4425c81 + 2eabae8 commit 41fe261
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Modal from '@components/Modal';
import ScreenWrapper from '@components/ScreenWrapper';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import * as ValidationUtils from '@libs/ValidationUtils';
import {getFieldRequiredErrors} from '@libs/ValidationUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import INPUT_IDS from '@src/types/form/AssignCardForm';
Expand All @@ -32,7 +32,7 @@ function TransactionStartDateSelectorModal({isVisible, date, handleSelectDate, o
const {translate} = useLocalize();

const validate = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.ASSIGN_CARD_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.ASSIGN_CARD_FORM> =>
ValidationUtils.getFieldRequiredErrors(values, [INPUT_IDS.START_DATE]);
getFieldRequiredErrors(values, [INPUT_IDS.START_DATE]);

const submit = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.ASSIGN_CARD_FORM>) => {
handleSelectDate(values[INPUT_IDS.START_DATE]);
Expand All @@ -51,7 +51,6 @@ function TransactionStartDateSelectorModal({isVisible, date, handleSelectDate, o
<ScreenWrapper
style={styles.pb0}
includePaddingTop={false}
includeSafeAreaPaddingBottom={false}
testID={TransactionStartDateSelectorModal.displayName}
>
<HeaderWithBackButton
Expand All @@ -63,10 +62,9 @@ function TransactionStartDateSelectorModal({isVisible, date, handleSelectDate, o
formID={ONYXKEYS.FORMS.ASSIGN_CARD_FORM}
submitButtonText={translate('common.save')}
onSubmit={submit}
style={[styles.flex1, styles.mh5]}
style={[styles.flexGrow1, styles.ph5]}
enabledWhenOffline
validate={validate}
submitButtonStyles={[styles.mb0, styles.pb0, styles.mh0]}
>
<InputWrapper
InputComponent={DatePicker}
Expand Down

0 comments on commit 41fe261

Please sign in to comment.