forked from karlhadwen/todoist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
27 lines (24 loc) · 782 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Header } from './components/layout/Header';
import { Content } from './components/layout/Content';
import { ProjectsProvider, SelectedProjectProvider } from './context';
export const App = ({ darkModeDefault = false }) => {
const [darkMode, setDarkMode] = useState(darkModeDefault);
return (
<SelectedProjectProvider>
<ProjectsProvider>
<main
data-testid="application"
className={darkMode ? 'darkmode' : undefined}
>
<Header darkMode={darkMode} setDarkMode={setDarkMode} />
<Content />
</main>
</ProjectsProvider>
</SelectedProjectProvider>
);
};
App.propTypes = {
darkModeDefault: PropTypes.bool,
};