Skip to content

Replace redux with zustand for state management. #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.9",
"@mui/material": "^5.10.10",
"@reduxjs/toolkit": "^1.8.6",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
Expand All @@ -33,7 +32,6 @@
"react-icons": "^4.6.0",
"react-monaco-editor": "^0.50.1",
"react-moveable": "^0.40.0",
"react-redux": "^8.0.4",
"react-router-dom": "^6.4.2",
"react-scripts": "5.0.1",
"slate": "^0.82.1",
Expand Down
172 changes: 83 additions & 89 deletions ui/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './App.css';
import "./App.css";

import { HashRouter as Router, Routes, Route } from "react-router-dom";

Expand All @@ -17,9 +17,6 @@ import { Header, Footer } from "./components/Header";
import Box from "@mui/material/Box";
import { SnackbarProvider } from "notistack";

import { Provider } from "react-redux";

import store from "./lib/store";
import Docs from "./pages/docs";

import { createTheme, ThemeProvider } from "@mui/material/styles";
Expand All @@ -45,98 +42,95 @@ function NormalLayout({ children }: any) {
function App() {
return (
<Router>
<Provider store={store}>
<ThemeProvider theme={theme}>
<AuthProvider>
<SnackbarProvider maxSnack={5}>
<Routes>
<Route
path="/about"
element={
<NormalLayout>
<About />
</NormalLayout>
}
/>
<Route
path="/docs"
element={
<NormalLayout>
<Docs />
</NormalLayout>
}
></Route>
<Route
path="/repos"
element={
<NormalLayout>
<Repos />
</NormalLayout>
}
></Route>
<Route
path="/repo/:id"
element={
<Box height="100vh">
<Header />
<Box height="100%" pt="50px">
<Repo />
</Box>
<ThemeProvider theme={theme}>
<AuthProvider>
<SnackbarProvider maxSnack={5}>
<Routes>
<Route
path="/about"
element={
<NormalLayout>
<About />
</NormalLayout>
}
/>
<Route
path="/docs"
element={
<NormalLayout>
<Docs />
</NormalLayout>
}
></Route>
<Route
path="/repos"
element={
<NormalLayout>
<Repos />
</NormalLayout>
}
></Route>
<Route
path="/repo/:id"
element={
<Box height="100vh">
<Header />
<Box height="100%" pt="50px">
<Repo />
</Box>
}
></Route>
<Route
path="/test"
element={
<NormalLayout>
<Test />
</NormalLayout>
}
></Route>
<Route
path="/login"
element={
<NormalLayout>
<Login />
</NormalLayout>
}
></Route>
<Route
path="/signup"
element={
<NormalLayout>
<Signup />
</NormalLayout>
}
></Route>
<Route
path="/profile"
element={
<NormalLayout>
<Profile />
</NormalLayout>
}
></Route>
<Route
path="/"
element={
<NormalLayout>
<Home />
</NormalLayout>
}
></Route>
</Routes>
</SnackbarProvider>
</AuthProvider>
</ThemeProvider>
</Provider>
</Box>
}
></Route>
<Route
path="/test"
element={
<NormalLayout>
<Test />
</NormalLayout>
}
></Route>
<Route
path="/login"
element={
<NormalLayout>
<Login />
</NormalLayout>
}
></Route>
<Route
path="/signup"
element={
<NormalLayout>
<Signup />
</NormalLayout>
}
></Route>
<Route
path="/profile"
element={
<NormalLayout>
<Profile />
</NormalLayout>
}
></Route>
<Route
path="/"
element={
<NormalLayout>
<Home />
</NormalLayout>
}
></Route>
</Routes>
</SnackbarProvider>
</AuthProvider>
</ThemeProvider>
</Router>
);
}

export default App;


// function App() {
// return (
// <div className="App">
Expand Down
Loading