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

Commit

Permalink
Format macro name (patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Cuadra committed Sep 2, 2018
1 parent c9d835f commit 4e841ee
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/plan/Macro.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Component } from 'react';
import numeral from 'numeral';
import upperFirst from 'lodash/upperFirst';

import { Fab } from 'rmwc/Fab';
import { Typography } from 'rmwc';

// import colors from './colors';
import MacroRing from './MacroRing';

class Macro extends Component {
Expand All @@ -13,10 +13,10 @@ class Macro extends Component {
const { increment, onAction, name, target, total } = this.props;
const percent = numeral(total / target).format('0 %');
return (
<div className="flex items-center">
<div className="macro pr-4">
<MacroRing name={name} total={total} target={target} />
<div>
<Typography use="subtitle1">{name}</Typography>{' '}
<Typography use="subtitle1">{upperFirst(name)}</Typography>{' '}
<Typography use="caption">{percent}</Typography>
<Typography use="body1" tag="div">
{total} / {target} g
Expand All @@ -29,6 +29,13 @@ class Macro extends Component {
label={`${increment}g`}
icon="add"
/>
<style jsx>{`
.macro {
display: grid;
grid-template-columns: auto 1fr auto;
grid-column-gap: 1rem;
}
`}</style>
</div>
);
}
Expand Down

0 comments on commit 4e841ee

Please sign in to comment.