Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Add cal per body-lb (minor)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Cuadra committed Sep 21, 2018
1 parent d284bc7 commit ad1bb88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/calculator/Calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,20 @@ class Calculator extends React.Component {
Rest Day
</Typography>
<ListDivider />
<Preview {...computeMacros(values)} />
<Preview
{...computeMacros(values)}
bodyWeightLbs={values.bodyWeight}
/>
</GridCell>
<GridCell span="6">
<Typography use="overline" tag="div">
Workout Day
</Typography>
<ListDivider />
<Preview {...computeMacros(values, true)} />
<Preview
{...computeMacros(values, true)}
bodyWeightLbs={values.bodyWeight}
/>
</GridCell>
</Grid>

Expand Down
5 changes: 4 additions & 1 deletion src/calculator/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ function formatNumber(number, format) {
class Preview extends Component {
state = {};
render() {
const { calories, carbs, fat, protein } = this.props;
const { bodyWeightLbs, calories, carbs, fat, protein } = this.props;
return (
<List>
<SimpleListItem graphic="trip_origin">
{formatNumber(calories / bodyWeightLbs, '0,0')} cal / body-lb
</SimpleListItem>
<SimpleListItem graphic="trip_origin">
{formatNumber(calories, '0,0')} cal
</SimpleListItem>
Expand Down

0 comments on commit ad1bb88

Please sign in to comment.