Skip to content

Commit

Permalink
implemented the landing page with relative routes
Browse files Browse the repository at this point in the history
  • Loading branch information
stacy-tech committed Sep 30, 2024
1 parent 8fb5745 commit 7178abe
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';

import { Home, Layout, List, ManageList } from './views';

import LandingPage from './views/LandingPage'; //Import my LandingPage

import { useAuth, useShoppingListData, useShoppingLists } from './api';

import { useStateWithStorage } from './utils';
Expand Down Expand Up @@ -43,7 +45,8 @@ export function App() {
return (
<Router>
<Routes>
<Route path="/" element={<Layout />}>
<Route path="/" element={<LandingPage />} /> {/* Landing page root */}
<Route path="/app" element={<Layout />}>
<Route
index
element={
Expand All @@ -57,15 +60,17 @@ export function App() {
}
/>
<Route
path="/list"
path="list" //change to relative path
element={<List data={data} listPath={listPath} />}
/>
<Route
path="/manage-list"
path="manage-list" //changed to relative path
element={<ManageList listPath={listPath} user={user} data={data} />}
/>
</Route>
</Routes>
</Router>
);
}

export default App;
14 changes: 14 additions & 0 deletions src/views/LandingPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.landing-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
padding: 20px;
box-sizing: border-box;
}

p {
margin: 0;
}
12 changes: 12 additions & 0 deletions src/views/LandingPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import './LandingPage.css';

const LandingPage = () => {
return (
<div className="landing-container">
<h1> Welcome to Our Landing Page!</h1>
<p>Your Journey Starts here.</p>
</div>
);
};
export default LandingPage;

0 comments on commit 7178abe

Please sign in to comment.