-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.tsx
38 lines (29 loc) · 1.04 KB
/
App.tsx
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
28
29
30
31
32
33
34
35
36
37
38
import 'react-calendar-heatmap/dist/styles.css';
import React, { useState } from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { ThemeProvider } from 'styled-components';
import GlobalStyles from './styles/GlobalStyles';
import Header from './components/Header';
import Profile from './pages/Profile';
import Repo from './pages/Repo';
import Footer from './components/Footer';
import { ThemeName, themes } from './styles/themes';
function App() {
const [themeName, setThemeName] = useState<ThemeName>('light');
const currentTheme = themes[themeName];
return (
<ThemeProvider theme={currentTheme}>
<BrowserRouter>
<Header themeName={themeName} setThemeName={setThemeName} />
<Routes>
<Route path="/" element={<Profile />} />
<Route path="/:username" element={<Profile />} />
<Route path="/:username/:reponame" element={<Repo />} />
</Routes>
<Footer />
<GlobalStyles />
</BrowserRouter>
</ThemeProvider>
);
}
export default App;