fix credit intro displaying '0'

This commit is contained in:
seanyesmunt 2018-05-31 22:51:07 -04:00 committed by Sean Yesmunt
parent 7339727e29
commit 53b9e5344b
2 changed files with 12 additions and 6 deletions

View file

@ -37,6 +37,7 @@
"jsx-a11y/label-has-for": 0, "jsx-a11y/label-has-for": 0,
"import/prefer-default-export": 0, "import/prefer-default-export": 0,
"no-return-assign": 0, "no-return-assign": 0,
"react/require-default-props": 0 "react/require-default-props": 0,
"react/jsx-closing-tag-location": 0
} }
} }

View file

@ -1,12 +1,18 @@
// I'll come back to this // @flow
/* esline-disable */
import React from 'react'; import React from 'react';
import { Modal } from 'modal/modal'; import { Modal } from 'modal/modal';
import CurrencySymbol from 'component/common/lbc-symbol'; import CurrencySymbol from 'component/common/lbc-symbol';
import CreditAmount from 'component/common/credit-amount'; import CreditAmount from 'component/common/credit-amount';
import Button from 'component/button'; import Button from 'component/button';
const ModalCreditIntro = props => { type Props = {
totalRewardValue: number,
currentBalance: number,
closeModal: () => void,
addBalance: () => void,
};
const ModalCreditIntro = (props: Props) => {
const { closeModal, totalRewardValue, currentBalance, addBalance } = props; const { closeModal, totalRewardValue, currentBalance, addBalance } = props;
const totalRewardRounded = Math.round(totalRewardValue / 10) * 10; const totalRewardRounded = Math.round(totalRewardValue / 10) * 10;
@ -25,7 +31,7 @@ const ModalCreditIntro = props => {
can take are limited. can take are limited.
</p> </p>
)} )}
{totalRewardValue && ( {Boolean(totalRewardValue) && (
<p> <p>
There are a variety of ways to get credits, including more than{' '} There are a variety of ways to get credits, including more than{' '}
<CreditAmount noStyle amount={totalRewardRounded} />{' '} <CreditAmount noStyle amount={totalRewardRounded} />{' '}
@ -46,4 +52,3 @@ const ModalCreditIntro = props => {
}; };
export default ModalCreditIntro; export default ModalCreditIntro;
/* esline-enable */