MCPcopy Create free account
hub / github.com/codebucks27/react-portfolio-final / SoundBar

Function SoundBar

src/subComponents/SoundBar.jsx:53–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51`
52
53const SoundBar = () => {
54
55 const ref = useRef(null);
56 const [click, setClick] = useState(false);
57
58 const handleClick = () => {
59 setClick(!click);
60
61 if(!click){
62 ref.current.play();
63 }else{
64 ref.current.pause();
65 }
66 }
67 return (
68 <Box onClick={() => handleClick()}>
69 <Line $click={click}/>
70 <Line $click={click}/>
71 <Line $click={click}/>
72 <Line $click={click}/>
73 <Line $click={click}/>
74
75
76 <audio src={music} ref={ref} loop />
77 </Box>
78 )
79}
80
81export default SoundBar

Callers

nothing calls this directly

Calls 1

handleClickFunction · 0.70

Tested by

no test coverage detected