added sounds, updated nped config and tweaks + code quality improvements
This commit is contained in:
22
src/components/UI/SoundBtn.tsx
Normal file
22
src/components/UI/SoundBtn.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { faVolumeHigh, faVolumeXmark } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useSoundEnabled } from "react-sounds";
|
||||
|
||||
const SoundBtn = () => {
|
||||
const [enabled, setEnabled] = useSoundEnabled();
|
||||
|
||||
const handleClick = () => {
|
||||
setEnabled(!enabled);
|
||||
};
|
||||
|
||||
return (
|
||||
<button onClick={handleClick}>
|
||||
<FontAwesomeIcon
|
||||
icon={enabled ? faVolumeHigh : faVolumeXmark}
|
||||
size="2x"
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default SoundBtn;
|
||||
Reference in New Issue
Block a user