Skip to content

Commit

Permalink
fix(daypicker): change the argument to show the prefooter disclaimer (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Minaparnian committed Aug 15, 2019
1 parent ffdb941 commit 639fcdb
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/components/DayPicker/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ const Footer = ({
endDateData.price &&
endDateData.price.value;

const setPreFooterDisclaimer =
preFooterDisclaimer &&
priceInPoints &&
(!endDateData ||
(endDateData && endDateData.price && endDateData.price.isClassic));

return (
<Transition in={showBottomFooter} timeout={300}>
{wrapperTransition => (
Expand Down Expand Up @@ -207,9 +213,7 @@ const Footer = ({
}}
>
<span css={preFooterTextStyle}>{preFooterInfo}</span>
{preFooterDisclaimer &&
priceInPoints &&
endDateData.price.isClassic ? (
{setPreFooterDisclaimer ? (
<span css={topDisclaimerStyle()}>
{preFooterDisclaimer}
</span>
Expand All @@ -236,16 +240,21 @@ const Footer = ({
css={{
color:
(!priceInPoints &&
endDateData &&
endDateData.price &&
endDateData.price.isLowestPrice) ||
(priceInPoints && endDateData.price.isLowestPoints)
(priceInPoints &&
endDateData &&
endDateData.price &&
endDateData.price.isLowestPoints)
? '#009400'
: colours.darkerGrey,
fontWeight: fontWeight.bold,
margin: '0 5px'
}}
>
<span>
{endDateData && priceInPoints
{endDateData && endDateData.price && priceInPoints
? numberWithCommas(endDateData.price.points)
: endDateData.currencySymbol +
numberWithCommas(
Expand Down

0 comments on commit 639fcdb

Please sign in to comment.