Skip to content

Commit

Permalink
chnages to fix breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
cruz27r committed Jan 9, 2024
1 parent 7d66426 commit 776e4e3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 36 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,9 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.x.x"
}

}
57 changes: 21 additions & 36 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// App.js
import React from 'react';
import { BrowserRouter as Router, Route, Routes, useLocation} from 'react-router-dom';
//import logoImage from './assets/images/P2E_Logo.png'; // Correct path to image
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import HomePage from './pages/HomePage/homePage';
import EventsForReadiness from './pages/EventsForReadiness/eventsForReadiness';
import SubmitLinkedIn from './pages/SubmitLinkedIn/submitLinkedIn';
Expand All @@ -12,47 +12,32 @@ import Partners from './pages/Partners/partners';
import Speakers from './pages/Speakers/speakers';
import FAQs from './pages/FAQs/faqs';
import './App.css';
// NavBar is imported but will not be used on the maintenance page
import NavBar from './components/NavBar/navbar';
import SubmitResume from './pages/SubmitResume/submitResume';
import MaintenancePage from './pages/Maintenance/MaintenancePage'; // Path to your MaintenancePage component

const Layout = ({ children }) => {
const location = useLocation(); // Get the current location

// Check if the current path is not the maintenance page
const showNavBar = location.pathname !== "/";

return (
<>
{showNavBar && <NavBar />}
<div className="main-content">
{children}
</div>
</>
);
};

function App() {
return (
<Router>
<div className="App">
<Routes>
<Route path="/" element={<MaintenancePage />} />
<Route path="/home" element={<HomePage />} />
<Route path="/events-for-readiness" element={<EventsForReadiness />} />
<Route path="/submit-linkedin" element={<SubmitLinkedIn />} />
<Route path="/submit-resume" element={<SubmitResume />} />
<Route path="/become-p2e" element={<BecomeP2E />} />
<Route path="/become-speaker" element={<BecomeSpeaker />} />
<Route path="/become-sponsor" element={<BecomeSponsor />} />
<Route path="/interview-prep" element={<InterviewPrep />} />
<Route path="/partners" element={<Partners />} />
<Route path="/speakers" element={<Speakers />} />
<Route path="/faqs" element={<FAQs />} />
{/* Add additional routes if needed */}
</Routes>

</div>
<Routes>
{/* MaintenancePage is rendered without NavBar */}
<Route path="/" element={<MaintenancePage />} />

{/* Other pages are wrapped with NavBar */}
<Route path="/home" element={<><NavBar /><HomePage /></>} />
<Route path="/events-for-readiness" element={<><NavBar /><EventsForReadiness /></>} />
<Route path="/submit-linkedin" element={<><NavBar /><SubmitLinkedIn /></>} />
<Route path="/submit-resume" element={<><NavBar /><SubmitResume /></>} />
<Route path="/become-p2e" element={<><NavBar /><BecomeP2E /></>} />
<Route path="/become-speaker" element={<><NavBar /><BecomeSpeaker /></>} />
<Route path="/become-sponsor" element={<><NavBar /><BecomeSponsor /></>} />
<Route path="/interview-prep" element={<><NavBar /><InterviewPrep /></>} />
<Route path="/partners" element={<><NavBar /><Partners /></>} />
<Route path="/speakers" element={<><NavBar /><Speakers /></>} />
<Route path="/faqs" element={<><NavBar /><FAQs /></>} />
{/* Add additional routes if needed */}
</Routes>
</Router>
);
}
Expand Down

0 comments on commit 776e4e3

Please sign in to comment.