Skip to content

Commit 7cb95e0

Browse files
committed
rename startFrom to startStepIndex
1 parent a714b4d commit 7cb95e0

7 files changed

Lines changed: 32 additions & 32 deletions

File tree

src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ type AssigneeStepProps = {
2929
policy: OnyxEntry<OnyxTypes.Policy>;
3030

3131
/** Array of step names */
32-
stepNames?: readonly string[];
32+
stepNames: readonly string[];
3333

3434
/** Start from step index */
35-
startFrom?: number;
35+
startStepIndex: number;
3636
};
3737

38-
function AssigneeStep({policy, stepNames, startFrom}: AssigneeStepProps) {
38+
function AssigneeStep({policy, stepNames, startStepIndex}: AssigneeStepProps) {
3939
const {translate, formatPhoneNumber, localeCompare} = useLocalize();
4040
const styles = useThemeStyles();
4141
const {isOffline} = useNetwork();
@@ -145,7 +145,7 @@ function AssigneeStep({policy, stepNames, startFrom}: AssigneeStepProps) {
145145
shouldEnableMaxHeight
146146
headerTitle={translate('workspace.card.issueCard')}
147147
handleBackButtonPress={handleBackButtonPress}
148-
startStepIndex={startFrom}
148+
startStepIndex={startStepIndex}
149149
stepNames={stepNames}
150150
enableEdgeToEdgeBottomSafeAreaPadding
151151
>

src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ type CardNameStepProps = {
2323
policyID: string | undefined;
2424

2525
/** Array of step names */
26-
stepNames?: readonly string[];
26+
stepNames: readonly string[];
2727

2828
/** Start from step index */
29-
startFrom?: number;
29+
startStepIndex: number;
3030
};
3131

32-
function CardNameStep({policyID, stepNames, startFrom}: CardNameStepProps) {
32+
function CardNameStep({policyID, stepNames, startStepIndex}: CardNameStepProps) {
3333
const {translate} = useLocalize();
3434
const styles = useThemeStyles();
3535
const {inputCallbackRef} = useAutoFocusInput();
@@ -79,7 +79,7 @@ function CardNameStep({policyID, stepNames, startFrom}: CardNameStepProps) {
7979
shouldEnableMaxHeight
8080
headerTitle={translate('workspace.card.issueCard')}
8181
handleBackButtonPress={handleBackButtonPress}
82-
startStepIndex={startFrom}
82+
startStepIndex={startStepIndex}
8383
stepNames={stepNames}
8484
enableEdgeToEdgeBottomSafeAreaPadding
8585
>

src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ type CardTypeStepProps = {
1919
policyID: string | undefined;
2020

2121
/** Array of step names */
22-
stepNames?: readonly string[];
22+
stepNames: readonly string[];
2323

2424
/** Start from step index */
25-
startFrom?: number;
25+
startStepIndex: number;
2626
};
2727

28-
function CardTypeStep({policyID, stepNames, startFrom}: CardTypeStepProps) {
28+
function CardTypeStep({policyID, stepNames, startStepIndex}: CardTypeStepProps) {
2929
const {translate} = useLocalize();
3030
const styles = useThemeStyles();
3131
const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {canBeMissing: true});
@@ -64,7 +64,7 @@ function CardTypeStep({policyID, stepNames, startFrom}: CardTypeStepProps) {
6464
offlineIndicatorStyle={styles.mtAuto}
6565
headerTitle={translate('workspace.card.issueCard')}
6666
handleBackButtonPress={handleBackButtonPress}
67-
startStepIndex={startFrom}
67+
startStepIndex={startStepIndex}
6868
stepNames={stepNames}
6969
enableEdgeToEdgeBottomSafeAreaPadding
7070
>

src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ type ConfirmationStepProps = {
3333
backTo?: Route;
3434

3535
/** Array of step names */
36-
stepNames?: readonly string[];
36+
stepNames: readonly string[];
3737

3838
/** Start from step index */
39-
startFrom?: number;
39+
startStepIndex: number;
4040
};
4141

42-
function ConfirmationStep({policyID, backTo, stepNames, startFrom}: ConfirmationStepProps) {
42+
function ConfirmationStep({policyID, backTo, stepNames, startStepIndex}: ConfirmationStepProps) {
4343
const {translate} = useLocalize();
4444
const styles = useThemeStyles();
4545
const {isOffline} = useNetwork();
@@ -96,7 +96,7 @@ function ConfirmationStep({policyID, backTo, stepNames, startFrom}: Confirmation
9696
shouldEnableMaxHeight
9797
headerTitle={translate('workspace.card.issueCard')}
9898
handleBackButtonPress={handleBackButtonPress}
99-
startStepIndex={startFrom}
99+
startStepIndex={startStepIndex}
100100
stepNames={stepNames}
101101
enableEdgeToEdgeBottomSafeAreaPadding
102102
>

src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function IssueNewCardPage({policy, route}: IssueNewCardPageProps) {
5151
const shouldUseBackToParam = !firstAssigneeEmail || firstAssigneeEmail === issueNewCard?.data?.assigneeEmail;
5252
const [isActingAsDelegate] = useOnyx(ONYXKEYS.ACCOUNT, {selector: (account) => !!account?.delegatedAccess?.delegate, canBeMissing: true});
5353
const stepNames = issueNewCard?.isChangeAssigneeDisabled ? CONST.EXPENSIFY_CARD.ASSIGNEE_EXCLUDED_STEP_NAMES : CONST.EXPENSIFY_CARD.STEP_NAMES;
54-
const startFrom = useMemo(() => getStartStepIndex(issueNewCard), [issueNewCard]);
54+
const startStepIndex = useMemo(() => getStartStepIndex(issueNewCard), [issueNewCard]);
5555

5656
useEffect(() => {
5757
startIssueNewCardFlow(policyID);
@@ -64,39 +64,39 @@ function IssueNewCardPage({policy, route}: IssueNewCardPageProps) {
6464
<AssigneeStep
6565
policy={policy}
6666
stepNames={stepNames}
67-
startFrom={startFrom}
67+
startStepIndex={startStepIndex}
6868
/>
6969
);
7070
case CONST.EXPENSIFY_CARD.STEP.CARD_TYPE:
7171
return (
7272
<CardTypeStep
7373
policyID={policyID}
7474
stepNames={stepNames}
75-
startFrom={startFrom}
75+
startStepIndex={startStepIndex}
7676
/>
7777
);
7878
case CONST.EXPENSIFY_CARD.STEP.LIMIT_TYPE:
7979
return (
8080
<LimitTypeStep
8181
policy={policy}
8282
stepNames={stepNames}
83-
startFrom={startFrom}
83+
startStepIndex={startStepIndex}
8484
/>
8585
);
8686
case CONST.EXPENSIFY_CARD.STEP.LIMIT:
8787
return (
8888
<LimitStep
8989
policyID={policyID}
9090
stepNames={stepNames}
91-
startFrom={startFrom}
91+
startStepIndex={startStepIndex}
9292
/>
9393
);
9494
case CONST.EXPENSIFY_CARD.STEP.CARD_NAME:
9595
return (
9696
<CardNameStep
9797
policyID={policyID}
9898
stepNames={stepNames}
99-
startFrom={startFrom}
99+
startStepIndex={startStepIndex}
100100
/>
101101
);
102102
case CONST.EXPENSIFY_CARD.STEP.CONFIRMATION:
@@ -105,15 +105,15 @@ function IssueNewCardPage({policy, route}: IssueNewCardPageProps) {
105105
policyID={policyID}
106106
backTo={shouldUseBackToParam ? backTo : undefined}
107107
stepNames={stepNames}
108-
startFrom={startFrom}
108+
startStepIndex={startStepIndex}
109109
/>
110110
);
111111
default:
112112
return (
113113
<AssigneeStep
114114
policy={policy}
115115
stepNames={stepNames}
116-
startFrom={startFrom}
116+
startStepIndex={startStepIndex}
117117
/>
118118
);
119119
}

src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ type LimitStepProps = {
2121
policyID: string | undefined;
2222

2323
/** Array of step names */
24-
stepNames?: readonly string[];
24+
stepNames: readonly string[];
2525

2626
/** Start from step index */
27-
startFrom?: number;
27+
startStepIndex: number;
2828
};
2929

30-
function LimitStep({policyID, stepNames, startFrom}: LimitStepProps) {
30+
function LimitStep({policyID, stepNames, startStepIndex}: LimitStepProps) {
3131
const {translate} = useLocalize();
3232
const {inputCallbackRef} = useAutoFocusInput();
3333
const styles = useThemeStyles();
@@ -81,7 +81,7 @@ function LimitStep({policyID, stepNames, startFrom}: LimitStepProps) {
8181
shouldEnableMaxHeight
8282
headerTitle={translate('workspace.card.issueCard')}
8383
handleBackButtonPress={handleBackButtonPress}
84-
startStepIndex={startFrom}
84+
startStepIndex={startStepIndex}
8585
stepNames={stepNames}
8686
enableEdgeToEdgeBottomSafeAreaPadding
8787
>

src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ type LimitTypeStepProps = {
1919
policy: OnyxEntry<OnyxTypes.Policy>;
2020

2121
/** Start from step index */
22-
startFrom?: number;
22+
startStepIndex: number;
2323

2424
/** Array of step names */
25-
stepNames?: readonly string[];
25+
stepNames: readonly string[];
2626
};
2727

28-
function LimitTypeStep({policy, stepNames, startFrom}: LimitTypeStepProps) {
28+
function LimitTypeStep({policy, stepNames, startStepIndex}: LimitTypeStepProps) {
2929
const {translate} = useLocalize();
3030
const styles = useThemeStyles();
3131
const policyID = policy?.id;
@@ -95,7 +95,7 @@ function LimitTypeStep({policy, stepNames, startFrom}: LimitTypeStepProps) {
9595
shouldEnableMaxHeight
9696
headerTitle={translate('workspace.card.issueCard')}
9797
handleBackButtonPress={handleBackButtonPress}
98-
startStepIndex={startFrom}
98+
startStepIndex={startStepIndex}
9999
stepNames={stepNames}
100100
enableEdgeToEdgeBottomSafeAreaPadding
101101
>

0 commit comments

Comments
 (0)