Skip to content

Commit

Permalink
add: TimerChallenge File
Browse files Browse the repository at this point in the history
  • Loading branch information
teganjennings committed May 23, 2024
1 parent f4d8afd commit 207deb3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import Player from './components/Player.jsx';
import Player from "./components/Player.jsx";
import TimerChallenge from "./components/TimerChallenge.jsx";

function App() {
return (
<>
<Player />
<div id="challenges"></div>
</>
);
return (
<>
<Player />
<div id="challenges">
<TimerChallenge title="easy" targetTime={1} />
<TimerChallenge title="not easy" targetTime={5} />
<TimerChallenge title="getting tough" targetTime={10} />{" "}
<TimerChallenge title="pros only" targetTime={15} />
</div>
</>
);
}

export default App;
18 changes: 18 additions & 0 deletions src/components/TimerChallenge.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export default function TimerChallenge({ title, targetTime }) {
function handleStart() {
setTimeout(() => {}, targetTime * 1000);
}
return (
<section className="challenge">
<h2>{title}</h2>
<p className="challenge-time">
{targetTime} second{targetTime > 1 ? "s" : ""}
</p>
<p>
{" "}
<button>Start Challenge</button>
</p>
<p className="active">Time is running... / Time inactive</p>
</section>
);
}

0 comments on commit 207deb3

Please sign in to comment.