Skip to content

Commit

Permalink
#14 fix : location of redux
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Mar 19, 2023
1 parent a612efd commit 327e1e1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
58 changes: 27 additions & 31 deletions front/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import instance from "api/api";
import NavBar from "components/common/NavBar";
import { Box } from "@mui/material";
import UserService from "api/UserService";
import { Provider } from "react-redux";
import store from "components/common/store";
import { useDispatch } from "react-redux";

const App = (): JSX.Element => {
Expand All @@ -31,35 +29,33 @@ const App = (): JSX.Element => {
loadUserData();

return (
<Provider store={store}>
<Box className="full">
<BrowserRouter>
<NavBar />
<Sheet
sx={{
width: "90%",
height: "85%",
mx: "auto", // margin left & right
my: 3, // margin top & botom
py: 1, // padding top & bottom
px: 1, // padding left & right
display: "flex",
flexDirection: "column",
gap: 2,
borderRadius: "sm",
boxShadow: "md",
alignItems: "center",
}}
variant="outlined"
>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/*" element={<MainRoute />} />
</Routes>
</Sheet>
</BrowserRouter>
</Box>
</Provider>
<Box className="full">
<BrowserRouter>
<NavBar />
<Sheet
sx={{
width: "90%",
height: "85%",
mx: "auto", // margin left & right
my: 3, // margin top & botom
py: 1, // padding top & bottom
px: 1, // padding left & right
display: "flex",
flexDirection: "column",
gap: 2,
borderRadius: "sm",
boxShadow: "md",
alignItems: "center",
}}
variant="outlined"
>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/*" element={<MainRoute />} />
</Routes>
</Sheet>
</BrowserRouter>
</Box>
);
};
export default App;
18 changes: 11 additions & 7 deletions front/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import { Provider } from "react-redux";
import store from "components/common/store";

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
document.getElementById("root") as HTMLElement
);
root.render(
<React.StrictMode>
<App />
<Provider store={store}>
<App />
</Provider>
</React.StrictMode>
);

Expand Down

0 comments on commit 327e1e1

Please sign in to comment.