Skip to content

Commit cb4b7b3

Browse files
committed
Add comments to new question frontend, clean code
1 parent c8837fb commit cb4b7b3

File tree

9 files changed

+35
-32
lines changed

9 files changed

+35
-32
lines changed

frontend/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
1+
import { BrowserRouter, Routes, Route } from "react-router-dom";
22
import NewQuestion from "./pages/NewQuestion";
33

44
function App() {
55
return (
6-
<Router>
6+
<BrowserRouter>
77
<Routes>
88
<Route path="/question" element={<>question page list</>} />
99
<Route path="/question/new" element={<NewQuestion />} />
1010
</Routes>
11-
</Router>
11+
</BrowserRouter>
1212
);
1313
}
1414

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

frontend/src/firebase.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// technically this should be in the backend...
2+
13
import { initializeApp } from "firebase/app";
24
import { getStorage } from "firebase/storage";
35

frontend/src/main.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
11
import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
33
import App from "./App.tsx";
4-
import { createTheme, ThemeProvider } from "@mui/material/styles";
5-
6-
const theme = createTheme({
7-
palette: {
8-
primary: {
9-
main: "#8FB8ED",
10-
contrastText: "#FFFFFF",
11-
},
12-
secondary: {
13-
main: "#ECECEC",
14-
contrastText: "#757575",
15-
},
16-
},
17-
components: {
18-
MuiButton: {
19-
styleOverrides: {
20-
root: {
21-
textTransform: "none",
22-
fontWeight: "bold",
23-
// ":hover": {
24-
// backgroundColor: "",
25-
// },
26-
},
27-
},
28-
},
29-
},
30-
});
4+
import theme from "./theme";
5+
import { ThemeProvider } from "@mui/material/styles";
316

327
createRoot(document.getElementById("root")!).render(
338
<StrictMode>

frontend/src/pages/NewQuestion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { v4 as uuidv4 } from "uuid";
99
import { storage } from "../firebase";
1010
import { getDownloadURL, ref, uploadBytesResumable } from "firebase/storage";
1111

12-
import QuestionMarkdown from "../components/question/QuestionMarkdown";
13-
import QuestionImageContainer from "../components/question/QuestionImageContainer";
12+
import QuestionMarkdown from "../components/NewQuestion/QuestionMarkdown";
13+
import QuestionImageContainer from "../components/NewQuestion/QuestionImageContainer";
1414

1515
// hardcode for now
1616
const difficultyList: string[] = ["Easy", "Medium", "Hard"];

frontend/src/theme.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { createTheme } from "@mui/material/styles";
2+
3+
const theme = createTheme({
4+
palette: {
5+
primary: {
6+
main: "#8FB8ED",
7+
contrastText: "#FFFFFF",
8+
},
9+
secondary: {
10+
main: "#ECECEC",
11+
contrastText: "#757575",
12+
},
13+
},
14+
components: {
15+
MuiButton: {
16+
styleOverrides: {
17+
root: {
18+
textTransform: "none",
19+
fontWeight: "bold",
20+
},
21+
},
22+
},
23+
},
24+
});
25+
26+
export default theme;

0 commit comments

Comments
 (0)