MCPcopy Create free account
hub / github.com/codemistic/Web-Development / App

Function App

locallibrary/frontend/src/App.jsx:13–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11import Header from "./components/Header";
12
13function App() {
14 // Dark Mode (ContextAPI can also be used)
15 const [theme, setTheme] = useState("dark");
16 const toggleTheme = () => {
17 setTheme((curr) => (curr === "light" ? "dark" : "light"));
18 };
19
20 return (
21 <div className={`App_${theme}`}>
22 <Header toggleTheme={toggleTheme} theme={theme} />
23 <Routes>
24 <Route path="/" element={<Home theme={theme} />} />
25 <Route path="/Books" element={<AllBooks theme={theme} />} />
26 <Route path="/Authors" element={<AllAuthors theme={theme} />} />
27 <Route path="/Book/:id" element={<Book theme={theme} />} />
28 <Route path="/Author/:id" element={<Author />} />
29 </Routes>
30 </div>
31 );
32}
33
34export default App;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected