()
| 15 | |
| 16 | |
| 17 | function App() { |
| 18 | const [theme, setTheme] = useState('dark-theme'); |
| 19 | const [checked, setChecked] = useState(false); |
| 20 | const [navToggle, setNavToggle] = useState(false); |
| 21 | |
| 22 | useEffect(()=>{ |
| 23 | document.documentElement.className = theme; |
| 24 | }, [theme]); |
| 25 | |
| 26 | const themeToggler = () =>{ |
| 27 | if(theme === 'light-theme'){ |
| 28 | setTheme('dark-theme'); |
| 29 | setChecked(false) |
| 30 | }else{ |
| 31 | setTheme('light-theme'); |
| 32 | setChecked(true) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | return ( |
| 37 | <div className="App"> |
| 38 | <Sidebar navToggle={navToggle} /> |
| 39 | |
| 40 | <div className="theme"> |
| 41 | <div className="light-dark-mode"> |
| 42 | <div className="left-content"> |
| 43 | <Brightness4Icon /> |
| 44 | </div> |
| 45 | <div className="right-content"> |
| 46 | <Switch |
| 47 | value="" |
| 48 | checked={checked} |
| 49 | inputProps={{ 'aria-label': '' }} |
| 50 | size="medium" |
| 51 | onClick={themeToggler} |
| 52 | |
| 53 | /> |
| 54 | </div> |
| 55 | </div> |
| 56 | </div> |
| 57 | |
| 58 | <div className="ham-burger-menu"> |
| 59 | <IconButton onClick={() => setNavToggle(!navToggle)}> |
| 60 | <MenuIcon /> |
| 61 | </IconButton> |
| 62 | </div> |
| 63 | |
| 64 | <MainContentStyled> |
| 65 | <div className="lines"> |
| 66 | <div className="line-1"></div> |
| 67 | <div className="line-2"></div> |
| 68 | <div className="line-3"></div> |
| 69 | <div className="line-4"></div> |
| 70 | <div className="line-5"></div> |
| 71 | </div> |
| 72 | |
| 73 | <Switching> |
| 74 | <Route path="/" exact> |
nothing calls this directly
no outgoing calls
no test coverage detected