MCPcopy Create free account
hub / github.com/amaancoderx/skillui / toggle

Function toggle

components/ThemeProvider.tsx:25–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 }, [])
24
25 const toggle = () => {
26 const next: Theme = theme === 'dark' ? 'light' : 'dark'
27 setTheme(next)
28 localStorage.setItem('theme', next)
29 document.documentElement.classList.toggle('dark', next === 'dark')
30 }
31
32 // Prevent flash: hide until theme is known
33 if (!mounted) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected