MCPcopy Create free account
hub / github.com/SuboptimalEng/coding-tutorials / App

Function App

_templates/03-basic-electron/src/renderer/App.tsx:10–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8import { decrement, increment } from './redux/counterSlice';
9
10function App() {
11 useEffect(() => {
12 applyTheme(baseTheme);
13 }, []);
14
15 const { value } = useAppSelector((state) => state.counter);
16 const dispatch = useAppDispatch();
17
18 return (
19 <div className="App">
20 <header className="App-header ">
21 {/* TODO: Figure out bg opacity. */}
22 <div className="bg-secondary bg-opacity-50 text-text-base flex flex-col place-items-center">
23 <div className="flex">
24 <div
25 onClick={() => applyTheme(baseTheme)}
26 className="border rounded p-2 m-2"
27 >
28 Base theme
29 </div>
30 <div
31 onClick={() => applyTheme(darkTheme)}
32 className="border rounded p-2 m-2"
33 >
34 Dark theme
35 </div>
36 </div>
37 <img src={logo} className="App-logo w-60" alt="logo" />
38 <div className="border rounded p-2 mb-4">Learn React</div>
39 <div className="flex w-full place-items-center justify-center space-x-2 mb-2">
40 <div
41 className="border p-2 rounded"
42 onClick={() => dispatch(decrement())}
43 >
44 -
45 </div>
46 <div>{value}</div>
47 <div
48 className="border p-2 rounded"
49 onClick={() => dispatch(increment())}
50 >
51 +
52 </div>
53 </div>
54 </div>
55 </header>
56 </div>
57 );
58}
59
60export default App;

Callers

nothing calls this directly

Calls 2

applyThemeFunction · 0.90
useAppDispatchFunction · 0.90

Tested by

no test coverage detected