flame/client/src/App.tsx

37 lines
1.1 KiB
TypeScript

import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { getConfig, setTheme } from './store/actions';
// Redux
import { store } from './store/store';
import { Provider } from 'react-redux';
import Home from './components/Home/Home';
import Apps from './components/Apps/Apps';
import Settings from './components/Settings/Settings';
import Bookmarks from './components/Bookmarks/Bookmarks';
import NotificationCenter from './components/NotificationCenter/NotificationCenter';
// Get config pairs from database
store.dispatch<any>(getConfig());
if (localStorage.theme) {
store.dispatch<any>(setTheme(localStorage.theme));
}
const App = (): JSX.Element => {
return (
<Provider store={store}>
<BrowserRouter>
<Switch>
<Route exact path='/' component={Home} />
<Route path='/settings' component={Settings} />
<Route path='/applications' component={Apps} />
<Route path='/bookmarks' component={Bookmarks} />
</Switch>
</BrowserRouter>
<NotificationCenter />
</Provider>
);
}
export default App;