Skip to content

Commit

Permalink
🔀 Merge pull request #57 from alexlee-dev/feature/item-timer-heading
Browse files Browse the repository at this point in the history
✨ Add ItemTimer heading
  • Loading branch information
Alex Lee committed Aug 24, 2019
2 parents a8d4890 + 5e37e33 commit de95fb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/__tests__/components/__snapshots__/ItemTimer.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@

exports[`<ItemTimer /> Should render the <ItemTimer /> component. 1`] = `
<DocumentFragment>
<span>
0 minutes 0 seconds
</span>
<div
class="StyledBox-sc-13pk1d4-0 IRSNj"
>
<h3
class="StyledHeading-sc-1rdh4aw-0 ftOecI"
>
Item Timer
</h3>
<span>
0 minutes 0 seconds
</span>
</div>
</DocumentFragment>
`;
8 changes: 7 additions & 1 deletion src/components/ItemTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
refreshItems
} from '../redux/actions/world'
import { createDuration } from '../util'
import { Box, Heading } from 'grommet'

const ItemTimer = ({ handleTimerStarted, handleTimerStopped, world }) => {
const { isTimerRunning } = world
Expand Down Expand Up @@ -35,7 +36,12 @@ const ItemTimer = ({ handleTimerStarted, handleTimerStopped, world }) => {

useEffect(startTimer, [isTimerRunning])

return <span>{timeLeft}</span>
return (
<Box>
<Heading level="3">Item Timer</Heading>
<span>{timeLeft}</span>
</Box>
)
}

ItemTimer.propTypes = {
Expand Down

0 comments on commit de95fb9

Please sign in to comment.