From 19c753fa60a5c4d5ecaca546df49bbe2e4142601 Mon Sep 17 00:00:00 2001 From: Thomas Hintz Date: Fri, 3 Apr 2020 12:53:03 -0700 Subject: [PATCH] Money styling improvements. --- src/components/farm/Board.jsx | 64 +++++++++++++++++++++++++++-------- src/style.scss | 14 ++++++++ 2 files changed, 64 insertions(+), 14 deletions(-) diff --git a/src/components/farm/Board.jsx b/src/components/farm/Board.jsx index feee7b1..9d64baa 100644 --- a/src/components/farm/Board.jsx +++ b/src/components/farm/Board.jsx @@ -293,8 +293,23 @@ function formatMoney(n) { class MoneySummary extends React.Component { render () { + const { max } = this.props; return ( - {this.props.title}: ${formatMoney(this.props.value)} + + + + {this.props.title}: + + + ${formatMoney(this.props.value)} + {max ? ( + <> + {' '}/ ${formatMoney(max)} + + ) : (<>)} + + + ); } } @@ -305,12 +320,23 @@ class PlayerSummary extends React.Component { return (
{player.name} )}> - {' '} - {' '} -

- {' '} - -

+ + + + + + + + + + + + + + + + +

- {' '} - - /${formatMoney(this.props.game.settings.maxDebt)} -
- {this.props.game.settings.loanInterest > 0 ? '(' + (this.props.game.settings.loanInterest * 100) + '% interest added to each loan)' : ''} -
+ + + + + + + + + {this.props.game.settings.loanInterest > 0 ? ( + <> + {'('}{this.props.game.settings.loanInterest * 100} % interest added to each loan{')'} +
+ + ) : ''} {this.props.player.debt >= this.props.game.settings.maxDebt ? ( - <> $1,000 at 100% interest + + $1,000 at 100% interest + ) : (<>)}
diff --git a/src/style.scss b/src/style.scss index 535886d..2d444e3 100644 --- a/src/style.scss +++ b/src/style.scss @@ -911,3 +911,17 @@ $intro-time: 6s; font-size: 1.2rem; color: red; font-weight: bold } + + +.small-text { + @include breakpoint(small only) { + font-size: 0.9rem; } + @include breakpoint(medium) { + font-size: 1.2rem; } +} + +.align-right { + text-align: right; } + +.pad-right { + padding-right: 0.3rem; }