-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
315 additions
and
167 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
import React, {useState, useEffect, useRef} from 'react'; | ||
import localFont from 'next/font/local'; | ||
import React, { useState } from 'react'; | ||
import styles from '../css/controls.module.css'; | ||
|
||
const dotFont = localFont({ src: '../app/e-dot-digital-7.ttf' }) | ||
interface ControlsProps { | ||
changeState: (newValue: boolean) => void; | ||
} | ||
|
||
const Controls = () => { | ||
const Controls: React.FC<ControlsProps> = ({ changeState }) => { | ||
const [crt, setCrt] = useState(false); | ||
|
||
return ( | ||
<section className={styles.container}> | ||
<input className={styles.checkbox} type="checkbox" /> | ||
<input className={styles.checkbox} type="checkbox" /> | ||
<input className={styles.checkbox} type="checkbox" /> | ||
</section> | ||
) | ||
const handleChange = () => { | ||
const newValue = !crt; | ||
setCrt(newValue); | ||
changeState(newValue); | ||
}; | ||
|
||
return ( | ||
<section className={styles.container}> | ||
<input | ||
className={styles.checkbox} | ||
type="checkbox" | ||
checked={crt} | ||
onChange={handleChange} | ||
/> | ||
<label htmlFor="">CRT Controls</label> | ||
</section> | ||
); | ||
}; | ||
|
||
export default Controls; |
This file contains 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
Oops, something went wrong.