Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation #13

Merged
merged 34 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
01d1e50
Add prop-types package and refactor code
evansnyamekye Feb 28, 2024
b7ca744
Delete UserAuth and UserSignUp components
evansnyamekye Feb 28, 2024
33f4800
Add UserAuth component for user authentication
evansnyamekye Feb 28, 2024
2f3f4a8
Add UserSignUp component
evansnyamekye Feb 28, 2024
d9b603e
Refactor App.js to include new components and implement user authenti…
evansnyamekye Feb 28, 2024
72b3326
Add Navigation component
evansnyamekye Feb 28, 2024
e0c64e5
Remove BrowserRouter from root render
evansnyamekye Feb 28, 2024
6f7e698
Add Layout component
evansnyamekye Feb 28, 2024
95bc1af
Add stay.jpg image
evansnyamekye Feb 28, 2024
2a3f647
Add CSS styles and layout
evansnyamekye Feb 28, 2024
14bf1db
Add styles
tsheporamantso Feb 28, 2024
571cc98
Add home page
evansnyamekye Feb 29, 2024
4c2125f
Update UserAuth.js to store and retrieve user ID in local storage
George7h Feb 29, 2024
c314e70
Add placesSlice.js to handle fetching places from the API
George7h Feb 29, 2024
4b410d4
Add Redux store configuration
George7h Feb 29, 2024
5db996c
Add Redux Toolkit and React Redux dependencies
George7h Feb 29, 2024
d6204dc
Add PlacesList component
George7h Feb 29, 2024
f00f798
Add Redux store and Provider to App component
George7h Feb 29, 2024
6c4d84c
Add PlacesList component to Layout
George7h Feb 29, 2024
d047f43
Add navigation links to the header
George7h Feb 29, 2024
877d724
Fix linter errors
George7h Feb 29, 2024
3954dfe
Add PlaceList and MyReservations components to Layout route
George7h Feb 29, 2024
1ace3bd
Refactor Layout component to include react-router-dom and update main…
George7h Feb 29, 2024
63b0175
Add MyReservations component
George7h Feb 29, 2024
a5552f7
Update navigation links in Navigation component
George7h Feb 29, 2024
cf3c40d
Add new SVG image and update Layout component
George7h Mar 1, 2024
4de2159
Update navigation path in UserAuth component
George7h Mar 1, 2024
76c3a45
Add SVG icons and update navigation links
George7h Mar 1, 2024
a0a8095
Fix stylelint errors
George7h Mar 1, 2024
a7b812e
Remove Home.js component
George7h Mar 1, 2024
721e04f
Add pagination functionality to PlacesList component
George7h Mar 1, 2024
c134e5f
Fix stylint error
George7h Mar 1, 2024
502640d
Add next and previous SVG icons
George7h Mar 1, 2024
711d899
Fix Stylint errors
George7h Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^2.2.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.6.7",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.1.0",
"react-router-dom": "^6.22.1",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
Expand Down
1 change: 1 addition & 0 deletions public/images/Myreservations.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/Places.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/Reserve.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/StaySphere.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/hotels/hotel-img.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/hotels/hotel1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/hotels/hotel2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/hotels/hotel3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/hotels/hotel4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/hotels/hotel5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/img-background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/previous.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/stay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
* {
margin: 0;
/* margin: 0;
padding: 0;
box-sizing: border-box;
box-sizing: border-box; */
list-style: none;
text-decoration: none;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif, Geneva, Tahoma;
}
43 changes: 32 additions & 11 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
import { Routes, Route } from 'react-router-dom';
import UserAuth from './Component/UserAuth';
import UserSignUp from './Component/UserSignUp';
import React, { useState, useEffect } from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import UserAuth from './Components/UserAuth';
import UserSignUp from './Components/UserSignUp';
import Layout from './Components/Layout';
import PlaceList from './Components/PlaceList';
import MyReservations from './Components/MyReservations';
import './App.css';

function App() {
const [loggedIn, setLoggedIn] = useState(false);

useEffect(() => {
const authToken = localStorage.getItem('authToken');
if (authToken) {
setLoggedIn(true);
}
}, []);

return (
<>
<div className="App">
<Routes>
<Route path="/" element={<UserAuth />} />
<Route path="/signup" element={<UserSignUp />} />
</Routes>
</div>
</>
<Router>
<Routes>
<Route path="/" element={<UserAuth setLoggedIn={setLoggedIn} />} />
<Route path="/signup" element={<UserSignUp />} />
{loggedIn ? (
<Route
path="/layout"
element={<Layout />}
>
<Route path="placelist" element={<PlaceList />} />
<Route path="myreservations" element={<MyReservations />} />
</Route>
) : null}
</Routes>
</Router>
);
}

Expand Down
41 changes: 0 additions & 41 deletions src/Component/UserAuth.js

This file was deleted.

17 changes: 17 additions & 0 deletions src/Components/Layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { Outlet } from 'react-router-dom';
import Navigation from './Navigation';

function Layout() {
return (
<div className="container">
<Navigation />
{/* Start of Main Content */}
<Outlet />
{/* End of Main Content */}

</div>
);
}

export default Layout;
13 changes: 13 additions & 0 deletions src/Components/MyReservations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

function MyReservations() {
return (
<div>
{/* <h1>StaySpare</h1>
<p>This is the main Content of the Hotel application</p> */}
This is my reservations page
</div>
);
}

export default MyReservations;
Loading
Loading