Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2b7e8dc
build: initial commit
KH-Pua Oct 9, 2023
b00ab22
Merge pull request #1 from sathyat20/keehui
sathyat20 Oct 9, 2023
ffc1e66
Basic map layout
sathyat20 Oct 9, 2023
841101e
Merge pull request #2 from sathyat20/mapAPI
sathyat20 Oct 9, 2023
8d3fd35
Switched to different API
sathyat20 Oct 10, 2023
484e549
Merge pull request #3 from sathyat20/newMapAPI
sathyat20 Oct 10, 2023
a3f5956
Removed unnecessary packages
sathyat20 Oct 10, 2023
61d1da1
Merge pull request #4 from sathyat20/newMapAPI
sathyat20 Oct 10, 2023
8e01b04
build: Explore.js, placeDetails.js, placeComments.js
KH-Pua Oct 17, 2023
db9b82b
Merge pull request #5 from sathyat20/keehui
sathyat20 Oct 17, 2023
7ddac9c
Explore page + routes in different component
sathyat20 Oct 17, 2023
242b276
fully merged
sathyat20 Oct 17, 2023
eebab9b
Merge pull request #6 from sathyat20/newMapAPI
sathyat20 Oct 17, 2023
1f9fbb2
Bugs fixed + UserId based trip rendering
sathyat20 Oct 18, 2023
8562f02
Merge pull request #7 from sathyat20/newMapAPI
sathyat20 Oct 18, 2023
345dd22
build: Search.js
KH-Pua Oct 18, 2023
4579aac
Merge branch 'main' of https://github.com/sathyat20/project2-bootcamp…
KH-Pua Oct 18, 2023
16478f1
build: Search.js completed
KH-Pua Oct 18, 2023
ccabbdd
Merge pull request #8 from sathyat20/keehui
sathyat20 Oct 18, 2023
639573f
Displaying added trip from explore page but still figuring out adding…
sathyat20 Oct 19, 2023
9a547bb
Merge pull request #9 from sathyat20/newMapAPI
sathyat20 Oct 19, 2023
c0a983c
fix: like, comment & save function in Explore.js, placeComments.js & …
KH-Pua Oct 20, 2023
182b2df
Merge branch 'main' of https://github.com/sathyat20/project2-bootcamp…
KH-Pua Oct 20, 2023
a6fc63c
Merge pull request #10 from sathyat20/keehui
sathyat20 Oct 20, 2023
25622b9
fix: Profile.js
KH-Pua Oct 21, 2023
2507e13
Merge branch 'main' of https://github.com/sathyat20/project2-bootcamp…
KH-Pua Oct 21, 2023
d560cbb
Merge pull request #11 from sathyat20/keehui
sathyat20 Oct 21, 2023
ed3bb39
Updates to trip page
sathyat20 Oct 21, 2023
2dd3c0f
changes to trip page
sathyat20 Oct 21, 2023
71ac7d1
Merge pull request #12 from sathyat20/newMapAPI
sathyat20 Oct 21, 2023
fc523dd
Trips page
sathyat20 Oct 22, 2023
edf8236
Merge pull request #13 from sathyat20/newMapAPI
sathyat20 Oct 22, 2023
7f39b3b
Fixed most bugs
sathyat20 Oct 22, 2023
7b92316
Merge branch 'main' into newMapAPI
sathyat20 Oct 22, 2023
58df717
Merge pull request #14 from sathyat20/newMapAPI
sathyat20 Oct 22, 2023
9d3bfab
fix: Explore.js(Photos for each place)
KH-Pua Oct 23, 2023
a716fc9
fix: revert changes made on Sathya's code
KH-Pua Oct 23, 2023
89d5304
Merge branch 'main' of https://github.com/sathyat20/project2-bootcamp…
KH-Pua Oct 23, 2023
101f6bc
Fixed bugs
sathyat20 Oct 23, 2023
928ed7f
Merge pull request #15 from sathyat20/keehui
sathyat20 Oct 23, 2023
5593486
fixed bug
sathyat20 Oct 23, 2023
6c0ce33
Merge pull request #16 from sathyat20/newMapAPI
sathyat20 Oct 23, 2023
1c01a61
Fixed bugs
sathyat20 Oct 23, 2023
a80c601
Merge pull request #17 from sathyat20/newMapAPI
sathyat20 Oct 23, 2023
282f204
fix: Explore.js, Profile.js, itemCard.js (saved & visited items redir…
KH-Pua Oct 23, 2023
c31ef70
Merge branch 'main' of https://github.com/sathyat20/project2-bootcamp…
KH-Pua Oct 23, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
34,322 changes: 20,661 additions & 13,661 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@chakra-ui/react": "^2.8.1",
"@flaticon/flaticon-uicons": "^2.4.0",
"@react-google-maps/api": "^2.19.2",
"firebase": "^10.4.0",
"flowbite-datepicker": "^1.2.2",
"react": "^18.1.0",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^18.1.0",
"react-scripts": "5.0.1"
"react-router-dom": "^6.16.0",
"react-scripts": "^5.0.1",
"react-tailwindcss-datepicker": "^1.6.6",
"use-places-autocomplete": "^4.0.1"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -27,5 +36,12 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@ubilabs/google-maps-react-hooks": "^2.0.2",
"daisyui": "^3.8.0",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.4",
"tailwindcss": "^3.3.3"
}
}
96 changes: 80 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,84 @@
import React from "react";
import logo from "./logo.png";
import { useState, useEffect, createContext } from "react";
import { Routes, Route } from "react-router-dom";
import "./App.css";
import { auth } from "./firebase.js";

class App extends React.Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
</header>
</div>
);
}
}
import Login from "./pages/Login.js";
import Explore from "./pages/Explore/Explore.js";
import Search from "./pages/Search.js";
import Create from "./pages/Create.js";
import Profile from "./pages/Profile.js";
import ErrorPage from "./pages/ErrorPage.js";
import TripProvider from "./Provider/TripProvider";
import CoordinatesProvider from "./Provider/CoordinatesProvider";

import { onAuthStateChanged } from "firebase/auth";

export const UserContext = createContext();

const App = (props) => {
const [user, setUser] = useState({});
const [username, setUsername] = useState("");
const [isLoggedIn, setIsLoggedIn] = useState(false);

const infoToPass = {
user,
setUser,
username,
setUsername,
isLoggedIn,
setIsLoggedIn,
};

// that empty [] at the end is the condition for the useEffect to run - useEffect only runs when the stuff in the brackets changes. if nothing is in the brackets, it only runs once on startup, making the whole useEffect block equal to a componentDidMount
useEffect(() => {
onAuthStateChanged(auth, (userInfo) => {
if (userInfo) {
// User signed in
setUser(userInfo);
setIsLoggedIn(true);

///////////redirect to "/Feed" page//////////////////
} else {
// No sign in user
setUser({});
setIsLoggedIn(false);
///////////redirect to "/" Login Page//////////////////
}
});
}, []);

return (
<UserContext.Provider value={infoToPass}>
<TripProvider>
<CoordinatesProvider>
<Routes>
<Route path="/" element={<Login />} errorElement={<ErrorPage />} />
<Route
path="/Explore"
element={<Explore />}
errorElement={<ErrorPage />}
/>
<Route
path="/Search"
element={<Search />}
errorElement={<ErrorPage />}
/>
<Route
path="/Create"
element={<Create />}
errorElement={<ErrorPage />}
/>
<Route
path="/Profile"
element={<Profile />}
errorElement={<ErrorPage />}
/>
</Routes>
</CoordinatesProvider>
</TripProvider>
</UserContext.Provider>
);
};

export default App;
Loading