Skip to content

Commit

Permalink
clean up after review
Browse files Browse the repository at this point in the history
  • Loading branch information
narefyev91 committed Nov 20, 2024
1 parent a3c9a68 commit d82f7a4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/pages/workspace/companyCards/addNew/CardInstructionsStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ import * as Card from '@userActions/Card';
import * as CompanyCards from '@userActions/CompanyCards';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {CardFeedProvider} from '@src/types/onyx/CardFeeds';

type CardInstructionsStepProps = {
policyID?: string;
};

function getCardInstructionHeader(isVisaFeedProvider: boolean, isMastedCardFeedProvider: boolean) {
if (isVisaFeedProvider) {
function getCardInstructionHeader(feedProvider: CardFeedProvider) {
if (feedProvider === CONST.COMPANY_CARD.FEED_BANK_NAME.VISA) {
return 'workspace.companyCards.addNewCard.enableFeed.visa';
}
if (isMastedCardFeedProvider) {
if (feedProvider === CONST.COMPANY_CARD.FEED_BANK_NAME.MASTER_CARD) {
return 'workspace.companyCards.addNewCard.enableFeed.mastercard';
}

Expand All @@ -46,9 +47,7 @@ function CardInstructionsStep({policyID}: CardInstructionsStepProps) {
const isStripeFeedProvider = feedProvider === CONST.COMPANY_CARD.FEED_BANK_NAME.STRIPE;
const isAmexFeedProvider = feedProvider === CONST.COMPANY_CARD.FEED_BANK_NAME.AMEX;
const isOtherBankSelected = bank === CONST.COMPANY_CARDS.BANKS.OTHER;
const isVisaFeedProvider = feedProvider === CONST.COMPANY_CARD.FEED_BANK_NAME.VISA;
const isMastedCardFeedProvider = feedProvider === CONST.COMPANY_CARD.FEED_BANK_NAME.MASTER_CARD;
const translationKey = getCardInstructionHeader(isVisaFeedProvider, isMastedCardFeedProvider);
const translationKey = getCardInstructionHeader(feedProvider);

const buttonTranslation = isStripeFeedProvider ? translate('common.submit') : translate('common.next');

Expand Down

0 comments on commit d82f7a4

Please sign in to comment.