From 53b9e5344b844781699cc42ff6b4f269e063f3de Mon Sep 17 00:00:00 2001 From: seanyesmunt Date: Thu, 31 May 2018 22:51:07 -0400 Subject: [PATCH] fix credit intro displaying '0' --- .eslintrc.json | 3 ++- src/renderer/modal/modalCreditIntro/view.jsx | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index d3bcd1f7b..abeff7ac8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -37,6 +37,7 @@ "jsx-a11y/label-has-for": 0, "import/prefer-default-export": 0, "no-return-assign": 0, - "react/require-default-props": 0 + "react/require-default-props": 0, + "react/jsx-closing-tag-location": 0 } } diff --git a/src/renderer/modal/modalCreditIntro/view.jsx b/src/renderer/modal/modalCreditIntro/view.jsx index bacd4ce3f..c410aed1c 100644 --- a/src/renderer/modal/modalCreditIntro/view.jsx +++ b/src/renderer/modal/modalCreditIntro/view.jsx @@ -1,12 +1,18 @@ -// I'll come back to this -/* esline-disable */ +// @flow import React from 'react'; import { Modal } from 'modal/modal'; import CurrencySymbol from 'component/common/lbc-symbol'; import CreditAmount from 'component/common/credit-amount'; 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 totalRewardRounded = Math.round(totalRewardValue / 10) * 10; @@ -25,7 +31,7 @@ const ModalCreditIntro = props => { can take are limited.

)} - {totalRewardValue && ( + {Boolean(totalRewardValue) && (

There are a variety of ways to get credits, including more than{' '} {' '} @@ -46,4 +52,3 @@ const ModalCreditIntro = props => { }; export default ModalCreditIntro; -/* esline-enable */