Skip to content

Commit

Permalink
Merge pull request #403 from NK-Works/router-issue-solved
Browse files Browse the repository at this point in the history
Refresh Render Issue Solved
  • Loading branch information
Anuj3553 authored Nov 7, 2024
2 parents 395c702 + 865c57c commit ab9f26c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { modeAtom } from "./atom/Atom";
import { useEffect, useState } from "react";
import "./App.css";
import "./index.css";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import { Routes, Route } from "react-router-dom";
import PropTypes from "prop-types";
import LoadingBar from "react-top-loading-bar";
import About from "./component/About";
Expand Down Expand Up @@ -42,7 +42,6 @@ import CreateBlog from "./component/CreateBlog";
import Projects from "./component/Projects";
import UploadProject from "./component/UploadProject";

// Main Layout Component
const Layout = ({ children, mode, setProgress, toggleMode, showAlert }) => {
return (
<div className="h-full w-full">
Expand Down Expand Up @@ -124,8 +123,8 @@ function App() {
<Cursor />
<ProjectState>
<ProfileState>
<Router>
<LoadingBar color="blue" progress={progress} onLoaderFinished={() => setProgress(0)} />

<LoadingBar color="blue" progress={progress} onLoaderFinished={() => setProgress(0)} />
<div className="alert-container"> <Alert alert={alert} /> </div>
<ProgressBar mode={mode} />
<ScrollTop />
Expand Down Expand Up @@ -158,7 +157,7 @@ function App() {
<Route exact path='/*' element={<NotFound />} />
</Routes>
</Layout>
</Router>

</ProfileState>
</ProjectState>
</div>
Expand Down
6 changes: 3 additions & 3 deletions client/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @format */

import { BrowserRouter } from "react-router-dom";
import ReactDOM from "react-dom/client";
import App from "./App.jsx";
import "./index.css";
Expand All @@ -8,10 +8,10 @@ import { AuthProvider } from "./contexts/authContext/index.jsx";
// import Alert from "./component/Alert";

ReactDOM.createRoot(document.getElementById("root")).render(
<>
<BrowserRouter>
<AuthProvider>
<App />
<Toaster />
</AuthProvider>
</>
</BrowserRouter>
);

0 comments on commit ab9f26c

Please sign in to comment.