Created
March 7, 2018 15:37
-
-
Save ayoola-solomon/e3111373760ce18404d89bcc88363a8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const monthlyRateColumn = ({ showDuration, monthlyRate, duration }) => ({ | |
text: columnText('currency', monthlyRate), | |
subText: showDuration && ( | |
<span> | |
{bankItemContent.rate.monthly}{' '} | |
<Text fontWeight={fontWeight.BOLD}> | |
{contentWithParams(bankItemContent.rate.duration, { duration })} | |
</Text> | |
</span> | |
), | |
}); | |
const effectiveInterestColumn = ({ | |
minEffectiveInterest, | |
maxEffectiveInterest, | |
eitherOrEffectiveInterest, | |
specialOfferType, | |
}) => ({ | |
text: columnText('percentage', minEffectiveInterest), | |
subText: | |
isValidRate(maxEffectiveInterest) && | |
(eitherOrEffectiveInterest | |
? contentWithParams(bankItemContent.rate.either, { | |
rate: maxEffectiveInterest, | |
}) | |
: contentWithParams(bankItemContent.rate.effective, { | |
rate: maxEffectiveInterest, | |
})), | |
highlighted: Boolean(specialOfferType), | |
}); | |
const debitInterestColumn = ({ | |
minDebtInterestRate, | |
maxDebtInterestRate, | |
eitherOrEffectiveInterest, | |
}) => ({ | |
text: columnText('percentage', minDebtInterestRate), | |
subText: | |
isValidRate(maxDebtInterestRate) && | |
(eitherOrEffectiveInterest | |
? contentWithParams(bankItemContent.rate.either, { | |
rate: maxDebtInterestRate, | |
}) | |
: contentWithParams(bankItemContent.rate.effective, { | |
rate: maxDebtInterestRate, | |
})), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would rather combine only the last two methods :)