Skip to content

Commit

Permalink
[Finishes] Added display and media control
Browse files Browse the repository at this point in the history
  • Loading branch information
samkahchiin committed Apr 10, 2020
1 parent 57cebc9 commit 724e6d9
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 2 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@fortawesome/react-fontawesome": "^0.1.9",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Display/Display.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import classes from './Display.module.css'
const display = (props) => {
return (
<div className={classes.Display}>
<h2>{props.type}</h2>
<h1>{props.duration}</h1>
<h2 id="timer-label">{props.type}</h2>
<h1 id="time-left">{props.duration}</h1>
</div>
)
}
Expand Down
20 changes: 20 additions & 0 deletions src/components/MediaControl/MediaControl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faPlay, faPause, faSync } from '@fortawesome/free-solid-svg-icons';
import classes from './MediaControl.module.css';

const mediaControl = () => {
return (
<div className={classes.MediaControl}>
<span id="start_stop">
<FontAwesomeIcon className="fa-2x" icon={faPlay} />
<FontAwesomeIcon className="fa-2x" icon={faPause} />
</span>
<span id="reset">
<FontAwesomeIcon className="fa-2x" icon={faSync} />
</span>
</div>
)
}

export default mediaControl;
3 changes: 3 additions & 0 deletions src/components/MediaControl/MediaControl.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.MediaControl span {
margin: 0 10px;
}
2 changes: 2 additions & 0 deletions src/containers/ControlPanel/ControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from 'react';
import BreakControl from '../../components/TimeControl/BreakControl/BreakControl';
import SessionControl from '../../components/TimeControl/SessionControl/SessionControl';
import Display from '../../components/Display/Display';
import MediaControl from '../../components/MediaControl/MediaControl';

const BREAK = 'break';
const SESSION = 'session';
Expand Down Expand Up @@ -55,6 +56,7 @@ class ControlPanel extends Component {
decrease={this.decreaseSessionHandler}
/>
<Display type={this.state.type} duration={this.state.sessionLength}/>
<MediaControl />
</div>
);
}
Expand Down
26 changes: 26 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,32 @@
resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18"
integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==

"@fortawesome/fontawesome-common-types@^0.2.28":
version "0.2.28"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.28.tgz#1091bdfe63b3f139441e9cba27aa022bff97d8b2"
integrity sha512-gtis2/5yLdfI6n0ia0jH7NJs5i/Z/8M/ZbQL6jXQhCthEOe5Cr5NcQPhgTvFxNOtURE03/ZqUcEskdn2M+QaBg==

"@fortawesome/fontawesome-svg-core@^1.2.28":
version "1.2.28"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.28.tgz#e5b8c8814ef375f01f5d7c132d3c3a2f83a3abf9"
integrity sha512-4LeaNHWvrneoU0i8b5RTOJHKx7E+y7jYejplR7uSVB34+mp3Veg7cbKk7NBCLiI4TyoWS1wh9ZdoyLJR8wSAdg==
dependencies:
"@fortawesome/fontawesome-common-types" "^0.2.28"

"@fortawesome/free-solid-svg-icons@^5.13.0":
version "5.13.0"
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.13.0.tgz#44d9118668ad96b4fd5c9434a43efc5903525739"
integrity sha512-IHUgDJdomv6YtG4p3zl1B5wWf9ffinHIvebqQOmV3U+3SLw4fC+LUCCgwfETkbTtjy5/Qws2VoVf6z/ETQpFpg==
dependencies:
"@fortawesome/fontawesome-common-types" "^0.2.28"

"@fortawesome/react-fontawesome@^0.1.9":
version "0.1.9"
resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.9.tgz#c865b9286c707407effcec99958043711367cd02"
integrity sha512-49V3WNysLZU5fZ3sqSuys4nGRytsrxJktbv3vuaXkEoxv22C6T7TEG0TW6+nqVjMnkfCQd5xOnmJoZHMF78tOw==
dependencies:
prop-types "^15.7.2"

"@hapi/address@2.x.x":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
Expand Down

0 comments on commit 724e6d9

Please sign in to comment.