This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{difficultyLevel === undefined && <DifficultyLevel setDifficultyLevel={setDifficulty}/>} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const setTime = (seconds: number) => { | |
setTimeInSeconds(seconds); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const endTimerFunc = () => { | |
setStartTimer(false); | |
setEndTimer(true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [startTimer, setStartTimer] = useState<boolean>(false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{timeInSeconds as number > 0 ? <Timer timeInSeconds={timeInSeconds as number} startTimer={startTimer} endTimerFunc={endTimerFunc}/> : <Duration setTimeInSeconds={setTime}/>} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { FC } from 'react'; | |
type difficultyLevelType = 0 | 1 | 2; | |
interface DifficultyLevelProps{ | |
setDifficultyLevel: (value: difficultyLevelType) => void; | |
} | |
const DifficultyLevel : FC<DifficultyLevelProps> = ({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { FC } from 'react'; | |
type timeInSecondsType = 60 | 120 | 180; | |
interface DurationProps{ | |
setTimeInSeconds: (value: timeInSecondsType) => void; | |
} | |
const Duration : FC<DurationProps> = ({ | |
setTimeInSeconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { ChangeEvent, FC } from 'react' | |
interface InputBoxProps{ | |
value: string | undefined; | |
onChange: (e:ChangeEvent<HTMLInputElement>) => void; | |
} | |
const InputBox : FC<InputBoxProps> = ({ | |
value, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { FC } from 'react'; | |
import styles from './paragraph.module.css'; | |
interface ParagraphProps{ | |
value: any; | |
} | |
const Paragraph : FC<ParagraphProps> = ({ | |
value | |
}) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return ( | |
<div> | |
{startTimer ? readableFormat : 'Timer is set, type to trigger timer'} | |
</div> | |
) |