Skip to content

Commit 66c0d26

Browse files
committed
feat: frontend draft
1 parent 7f41a1b commit 66c0d26

File tree

18 files changed

+225
-141
lines changed

18 files changed

+225
-141
lines changed

frontend/src/App.css

Lines changed: 0 additions & 42 deletions
This file was deleted.

frontend/src/App.tsx

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,13 @@
1-
import { useState } from 'react'
2-
import reactLogo from './assets/react.svg'
3-
import viteLogo from '/vite.svg'
4-
import './App.css'
5-
1+
import ThemeProvider from './context/ThemeContext';
2+
import MainPage from './pages/MainPage';
63

74
function App() {
8-
const [count, setCount] = useState(0)
95

106
return (
11-
<>
12-
<div>
13-
<a href="https://vite.dev" target="_blank">
14-
<img src={viteLogo} className="logo" alt="Vite logo" />
15-
</a>
16-
<a href="https://react.dev" target="_blank">
17-
<img src={reactLogo} className="logo react" alt="React logo" />
18-
</a>
19-
</div>
20-
<h1>Vite + React</h1>
21-
<div className="card">
22-
<button onClick={() => setCount((count) => count + 1)}>
23-
count is {count}
24-
</button>
25-
<p>
26-
Edit <code>src/App.tsx</code> and save to test HMR
27-
</p>
28-
</div>
29-
<p className="read-the-docs">
30-
Click on the Vite and React logos to learn more
31-
</p>
32-
</>
7+
<ThemeProvider>
8+
<MainPage/>
9+
</ThemeProvider>
3310
)
3411
}
3512

36-
export default App
13+
export default App;

frontend/src/assets/react.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
3+
function SearchBar() {
4+
5+
6+
return (
7+
<div className="search-bar">
8+
9+
</div>
10+
);
11+
}
12+
13+
export default SearchBar;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import '../styles/ThemeSwitch.css'
2+
3+
type ThemeSwitchProps = {
4+
theme: string;
5+
toggleTheme: () => void;
6+
}
7+
8+
function ThemeSwitch({ theme, toggleTheme }: ThemeSwitchProps) {
9+
return (
10+
<div className="theme-switch">
11+
<button onClick={toggleTheme}>
12+
Theme: {theme}
13+
</button>
14+
</div>
15+
);
16+
}
17+
18+
export default ThemeSwitch;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import ThemeSwitchContainer from "../containers/ThemeSwitchContainer";
2+
3+
4+
function ToolBar() {
5+
6+
return (
7+
<div className="tool-bar">
8+
<ThemeSwitchContainer/>
9+
10+
</div>
11+
);
12+
}
13+
14+
export default ToolBar;

frontend/src/components/TopBar.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import ToolBarContainer from "../containers/ToolBarContainer";
2+
import SearchBarContainer from "../containers/SearchBarContainer";
3+
import '../styles/TopBar.css'
4+
5+
function TopBar() {
6+
7+
return (
8+
<div className="top-bar">
9+
<ToolBarContainer/>
10+
<h1>TaskBoard</h1>
11+
<SearchBarContainer/>
12+
</div>
13+
);
14+
}
15+
16+
export default TopBar;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import SearchBar from "../components/SearchBar";
2+
3+
4+
function SearchBarContainer() {
5+
6+
return (
7+
<SearchBar/>
8+
);
9+
}
10+
11+
export default SearchBarContainer;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { useTheme } from '../context/ThemeContext';
2+
import ThemeSwitch from "../components/ThemeSwitch";
3+
4+
function ThemeSwitchContainer() {
5+
const { theme, toggleTheme } = useTheme();
6+
7+
return (
8+
<ThemeSwitch theme={theme} toggleTheme={toggleTheme} />
9+
);
10+
}
11+
12+
export default ThemeSwitchContainer;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import ToolBar from "../components/ToolBar";
2+
3+
4+
function ToolBarContainer() {
5+
6+
7+
return (
8+
<ToolBar/>
9+
);
10+
}
11+
12+
export default ToolBarContainer;

0 commit comments

Comments
 (0)