Skip to content

Fixed save button layout in Company card transaction start date page #56226

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

Merged
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
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