switch to go backend
All checks were successful
Build and Deploy Website / build (push) Successful in 2m26s
All checks were successful
Build and Deploy Website / build (push) Successful in 2m26s
This commit is contained in:
48
Frontend/src/App.tsx
Normal file
48
Frontend/src/App.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import { BrowserRouter, Routes, Route, useNavigate, useLocation } from "react-router-dom";
|
||||
import AppLayout from "@cloudscape-design/components/app-layout";
|
||||
import SideNavigation from "@cloudscape-design/components/side-navigation";
|
||||
import "@cloudscape-design/global-styles/index.css";
|
||||
import "./App.css";
|
||||
import Home from "./pages/Home";
|
||||
import Resume from "./pages/Resume";
|
||||
import NotFound from "./pages/NotFound";
|
||||
|
||||
function AppContent() {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
return (
|
||||
<AppLayout
|
||||
toolsHide
|
||||
navigation={
|
||||
<SideNavigation
|
||||
header={{ text: "Stephen Parkinson", href: "/" }}
|
||||
activeHref={location.pathname}
|
||||
onFollow={(event) => {
|
||||
event.preventDefault();
|
||||
navigate(event.detail.href);
|
||||
}}
|
||||
items={[
|
||||
{ type: "link", text: "Home", href: "/" },
|
||||
{ type: "link", text: "Resume", href: "/resume" },
|
||||
]}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<Routes>
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/resume" element={<Resume />} />
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<AppContent />
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user