diff --git a/src/pages/CheckinPage.jsx b/src/pages/CheckinPage.jsx
index cce8cf7..84549c3 100644
--- a/src/pages/CheckinPage.jsx
+++ b/src/pages/CheckinPage.jsx
@@ -110,12 +110,11 @@ const CheckinPage = () => {
const changeIsCheckedIn = async (volunteer, numberOfParticipants) => {
try {
const event_data_id = volunteer.event_data_id;
- console.log('Number of participants:', numberOfParticipants);
+ console.log(event_data_id, numberOfParticipants);
- const response = await Backend.put(`/data/checkin/${event_data_id}`, {
- number_in_party: numberOfParticipants,
- });
- console.log('Response from server:', response);
+ // const response = await Backend.put(`/data/checkin/${event_data_id}`, {
+ // number_in_party: numberOfParticipants,
+ // });
await setData(); // Refresh data
} catch (err) {
@@ -124,7 +123,6 @@ const CheckinPage = () => {
};
const handleCheckinButtonClick = volunteer => {
- console.log(volunteer);
setSelectedVolunteer(volunteer); // `volunteer` is the volunteer object from the list
setIsCheckinModalOpen(true);
};
@@ -137,7 +135,6 @@ const CheckinPage = () => {
const getRegistered = async event_id => {
try {
// send new checkin status to backend, set new data by retrieving the new backend data
- //console.log(event_id);
const response = await Backend.get(`/stats/register/${event_id}`).then(data => {
setRegistered(parseInt(data.data));
});
diff --git a/src/pages/DummyStatsPage.jsx b/src/pages/DummyStatsPage.jsx
index 6977b49..6186d8d 100644
--- a/src/pages/DummyStatsPage.jsx
+++ b/src/pages/DummyStatsPage.jsx
@@ -296,7 +296,6 @@ const getVolunteerStats = async dataId => {
const getEvents = async () => {
const resp = await Backend.get('/events');
- console.log(resp.data);
return resp.data;
};
@@ -307,19 +306,16 @@ const getProfiles = async () => {
const weeklyTrashData = async () => {
const resp = await Backend.get('/stats/week');
- // console.log(resp);
return resp.data;
};
const monthlyTrashData = async () => {
const resp = await Backend.get('/stats/month');
- // console.log(resp);
return resp.data;
};
const yearlyTrashData = async () => {
const resp = await Backend.get('/stats/year');
- // console.log(resp);
return resp.data;
};
@@ -330,13 +326,11 @@ const weeklyParticipantsData = async () => {
const monthlyParticipantsData = async () => {
const resp = await Backend.get('/stats/participants/week');
- // console.log(resp);
return resp.data;
};
const yearlyParticipantsData = async () => {
const resp = await Backend.get('/stats/participants/year');
- // console.log(resp);
return resp.data;
};
diff --git a/src/pages/EventPage.jsx b/src/pages/EventPage.jsx
index d10fed4..a3fa6d6 100644
--- a/src/pages/EventPage.jsx
+++ b/src/pages/EventPage.jsx
@@ -47,7 +47,6 @@ const Events = () => {
try {
const eventsData = await Backend.get('/events/currentEvents');
setEvents(eventsData.data);
- console.log(eventsData.data);
// setDates();
setLocations(getLocation(eventsData.data));
setDates(getDate(eventsData.data));
@@ -94,7 +93,6 @@ const Events = () => {
}
setSelectedEvents(newCheckedItems);
- console.log(selectedEvents);
};
const getLocation = data => {
@@ -102,7 +100,6 @@ const Events = () => {
for (let i in data) {
location.push(data[i].location);
}
- console.log(location.length);
return location;
};
@@ -111,7 +108,6 @@ const Events = () => {
for (let i in data) {
date.push(data[i].date.substring(0, 10));
}
- console.log(date.length);
return date;
};
@@ -129,19 +125,16 @@ const Events = () => {
useEffect(() => {
getEvents();
- console.log(locations);
// getEventId(eventId);
}, []);
const handleLocationChange = event => {
const selectedLocation = event.target.value;
- console.log(selectedLocation);
setLocation(selectedLocation);
};
const handleDateChange = event => {
const selectedDate = event.target.value;
- console.log(selectedDate);
setDate(selectedDate);
};
@@ -243,7 +236,6 @@ const Events = () => {
if (!fuse) {
return;
}
- console.log(name);
let ands = [];
if (name) ands.push({ name: name });
if (location) ands.push({ location: location });
@@ -252,12 +244,10 @@ const Events = () => {
let result;
if (ands.length > 0) {
const fuseResult = fuse.search({ $and: ands });
- console.log(fuseResult);
// If we want to filter by score:
// result = fuseResult.filter(item => item.score <= 0.5).map(item => item.item);
result = fuseResult.map(item => item.item);
} else result = events;
- console.log(result);
setDisplayEvents(result);
}, [name, location, date, fuse]);
diff --git a/src/pages/HomePage.jsx b/src/pages/HomePage.jsx
index ff17462..717832a 100644
--- a/src/pages/HomePage.jsx
+++ b/src/pages/HomePage.jsx
@@ -53,7 +53,6 @@ const Home = () => {
}
setSelectedEvents(newCheckedItems);
- console.log(selectedEvents);
};
const eventCards = displayEvents.map(element => (
@@ -78,7 +77,6 @@ const Home = () => {
if (!fuse) {
return;
}
- console.log(name);
let ands = [];
if (name) ands.push({ name: name });
if (location) ands.push({ location: location });
@@ -87,12 +85,10 @@ const Home = () => {
let result;
if (ands.length > 0) {
const fuseResult = fuse.search({ $and: ands });
- console.log(fuseResult);
// If we want to filter by score:
// result = fuseResult.filter(item => item.score <= 0.5).map(item => item.item);
result = fuseResult.map(item => item.item);
} else result = events;
- console.log(result);
setDisplayEvents(result);
}, [name, location, date, fuse]);
diff --git a/src/pages/InputDataPage.jsx b/src/pages/InputDataPage.jsx
index 9169c44..a4dc177 100644
--- a/src/pages/InputDataPage.jsx
+++ b/src/pages/InputDataPage.jsx
@@ -39,7 +39,6 @@ const InputDataPage = () => {
const { onNavbarDrawerOpen } = useContext(NavbarContext);
const navigate = useNavigate();
- console.log(volunteerResults);
useEffect(() => {
// 0 is all, 1 is checked-in, 2 is not checked-in, 3 are guests
setDisplayedVolunteers(volunteerResults.filter(volunteer => volunteer.is_checked_in === true));
diff --git a/src/pages/LoginV2.jsx b/src/pages/LoginV2.jsx
index 0d771d1..69fd46a 100644
--- a/src/pages/LoginV2.jsx
+++ b/src/pages/LoginV2.jsx
@@ -33,7 +33,6 @@ const LoginV2 = () => {
useEffect(() => {
const unsubscribe = onAuthStateChanged(auth, async user => {
- console.log('inside useeffect');
try {
if (
user &&
@@ -41,8 +40,7 @@ const LoginV2 = () => {
user.providerData[0].providerId == 'facebook.com')
) {
// Keep in mind that if the user logs in with the plain email/password, they'll have no displayName attribute
- console.log(user);
- console.log('firebase inside');
+
const userName = user.displayName.split(' ');
const firstName = userName[0];
const lastName = userName.length > 1 ? userName[1] : '';
@@ -56,8 +54,6 @@ const LoginV2 = () => {
};
await setRole('volunteer');
- console.log(profile);
- console.log('success');
if (!(await getProfileByFirebaseUid(profile.firebase_uid))) {
postProfile(profile);
diff --git a/src/pages/PastEvents.jsx b/src/pages/PastEvents.jsx
index 309dd4a..24f0c19 100644
--- a/src/pages/PastEvents.jsx
+++ b/src/pages/PastEvents.jsx
@@ -27,11 +27,6 @@ const PastEvents = () => {
const { onNavbarDrawerOpen } = useContext(NavbarContext);
- useEffect(() => {
- console.log('!');
- console.log(displayEvents);
- }, [displayEvents]);
-
// useEffect(() => {
// // If input is empty, display all volunteers, else conduct the search
// if (input.trim() === '') {
@@ -69,7 +64,6 @@ const PastEvents = () => {
if (!fuse) {
return;
}
- console.log(name);
let ands = [];
if (name) ands.push({ name: name });
if (location) ands.push({ location: location });
@@ -78,12 +72,10 @@ const PastEvents = () => {
let result;
if (ands.length > 0) {
const fuseResult = fuse.search({ $and: ands });
- console.log(fuseResult);
// If we want to filter by score:
// result = fuseResult.filter(item => item.score <= 0.5).map(item => item.item);
result = fuseResult.map(item => item.item);
} else result = events;
- console.log(result);
setDisplayEvents(result);
}, [name, location, date, fuse, events]);
diff --git a/src/pages/Register.jsx b/src/pages/Register.jsx
index e8b4e83..710cd04 100644
--- a/src/pages/Register.jsx
+++ b/src/pages/Register.jsx
@@ -54,8 +54,6 @@ const Register = () => {
} = useForm({ resolver: yupResolver(schema), defaultValues });
const postVolunteerData = async formData => {
- console.log(formData);
-
const submitData = {
volunteer_id: formData.volunteer_id,
number_in_party: formData.number_in_party,
diff --git a/src/pages/SelectEvent.jsx b/src/pages/SelectEvent.jsx
index cc1eed8..0d537ee 100644
--- a/src/pages/SelectEvent.jsx
+++ b/src/pages/SelectEvent.jsx
@@ -32,7 +32,6 @@ const SelectEvent = () => {
const getEvents = async () => {
try {
const events = await Backend.get('/events');
- console.log(events.data);
setEventsData(events.data);
} catch (err) {
console.log(`Error getting events: `, err.message);
@@ -58,7 +57,6 @@ const SelectEvent = () => {
placeholder="Select event"
{...register('event_id')}
onChange={event => {
- console.log(event.target.value);
setCurrEvent(event.target.value);
}}
>
diff --git a/src/pages/Signup.jsx b/src/pages/Signup.jsx
index d8fc6c4..e34443a 100644
--- a/src/pages/Signup.jsx
+++ b/src/pages/Signup.jsx
@@ -56,9 +56,6 @@ const CreateAccount = () => {
try {
const newUser = await createUserInFirebase(email, password, '/successful-login', navigate);
- console.log('new user ');
- console.log(newUser);
-
await createVolunteerRow({
firstName,
lastName,
@@ -214,7 +211,6 @@ const createVolunteerRow = async ({ firstName, lastName, role, email, firebase_u
email: email,
firebase_uid: firebase_uid,
});
- // console.log(response);
return response;
};
diff --git a/src/pages/SignupV2.jsx b/src/pages/SignupV2.jsx
index 2a0414f..908fc0e 100644
--- a/src/pages/SignupV2.jsx
+++ b/src/pages/SignupV2.jsx
@@ -63,7 +63,6 @@ const CreateAccount = () => {
email: email,
firebase_uid: firebase_uid,
});
- // console.log(response);
return response;
};
diff --git a/src/pages/ViewEvents.jsx b/src/pages/ViewEvents.jsx
index 3d17e2b..d509f73 100644
--- a/src/pages/ViewEvents.jsx
+++ b/src/pages/ViewEvents.jsx
@@ -68,8 +68,6 @@ const ViewEvents = () => {
const getEventId = async () => {
try {
const eventIdData = await Backend.get(`/stats/export/data/${eventId}`);
- console.log('Look here');
- console.log(eventIdData);
setEventIdData(eventIdData.data);
} catch (err) {
console.log(err.message);
@@ -126,12 +124,12 @@ const ViewEvents = () => {
const changeIsCheckedIn = async (volunteer, numberOfParticipants) => {
try {
const event_data_id = volunteer.event_data_id;
- console.log('Number of participants:', numberOfParticipants);
+ console.log(event_data_id);
- const response = await Backend.put(`/data/checkin/${event_data_id}`, {
- number_in_party: numberOfParticipants,
- });
- console.log('Response from server:', response);
+ // const response = await Backend.put(`/data/checkin/${event_data_id}`, {
+ // number_in_party: numberOfParticipants,
+ // });
+ console.log(numberOfParticipants);
await setData(); // Refresh data
} catch (err) {
@@ -140,7 +138,6 @@ const ViewEvents = () => {
};
const handleCheckinButtonClick = volunteer => {
- console.log(volunteer);
setSelectedVolunteer(volunteer); // `volunteer` is the volunteer object from the list
setIsCheckinModalOpen(true);
};
@@ -153,7 +150,6 @@ const ViewEvents = () => {
const getRegistered = async event_id => {
try {
// send new checkin status to backend, set new data by retrieving the new backend data
- //console.log(event_id);
const response = await Backend.get(`/stats/register/${event_id}`).then(data => {
setRegistered(parseInt(data.data));
});
diff --git a/src/pages/Volunteers.jsx b/src/pages/Volunteers.jsx
index d6d44d0..bd48425 100644
--- a/src/pages/Volunteers.jsx
+++ b/src/pages/Volunteers.jsx
@@ -53,10 +53,6 @@ const Volunteers = () => {
setData();
}, []);
- useEffect(() => {
- console.log('>', volunteers);
- }, [volunteers]);
-
useEffect(() => {
// If input is empty, display all volunteers, else conduct the search
if (input.trim() === '') {
diff --git a/src/utils/firebaseAuthUtils.js b/src/utils/firebaseAuthUtils.js
index ef09ad5..904556f 100644
--- a/src/utils/firebaseAuthUtils.js
+++ b/src/utils/firebaseAuthUtils.js
@@ -28,7 +28,6 @@ const auth = getAuth(app);
* @param {hook} navigate useNavigate hook
*/
export const createUserInFirebase = async (email, password, redirect, navigate) => {
- console.log(email, password);
try {
const user = await createUserWithEmailAndPassword(auth, email, password);
navigate(redirect);
diff --git a/src/utils/imageUtils.js b/src/utils/imageUtils.js
index cd73ce0..98ad00c 100644
--- a/src/utils/imageUtils.js
+++ b/src/utils/imageUtils.js
@@ -5,8 +5,6 @@ export const postImage = async (name, s3_url) => {
s3_url: s3_url,
name: name,
});
- console.log('name', name);
-
return response.data;
};
From f274ff42c320a6e2a06eba2be1cf4501151768ba Mon Sep 17 00:00:00 2001
From: Dang Nguyen Nguyen
Date: Mon, 29 Apr 2024 22:45:21 -0700
Subject: [PATCH 15/16] fixed unappealing grid
---
src/pages/VolunteerHomePage.jsx | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/pages/VolunteerHomePage.jsx b/src/pages/VolunteerHomePage.jsx
index 5b92b94..334beb6 100644
--- a/src/pages/VolunteerHomePage.jsx
+++ b/src/pages/VolunteerHomePage.jsx
@@ -174,18 +174,16 @@ const VolunteerHomePage = () => {
-
-
-
- {eventCards}
-
-
+
+
+ {eventCards}
+
From b1855ce5888620743357ec93b4a6c6512ede1658 Mon Sep 17 00:00:00 2001
From: Dang Nguyen Nguyen
Date: Tue, 30 Apr 2024 00:24:47 -0700
Subject: [PATCH 16/16] Fixed the problem with stretched pfp in navbar and
volunteer table
---
src/components/Navbar/Navbar.jsx | 11 +++++++----
src/components/VolunteersTable.jsx | 10 ++++++++--
src/pages/HomePage.jsx | 12 +++++-------
3 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/src/components/Navbar/Navbar.jsx b/src/components/Navbar/Navbar.jsx
index c2e0217..0d48d4b 100644
--- a/src/components/Navbar/Navbar.jsx
+++ b/src/components/Navbar/Navbar.jsx
@@ -1,4 +1,4 @@
-import { Box, Text, Flex } from '@chakra-ui/react';
+import { Box, Text, Flex, Image } from '@chakra-ui/react';
import adminLogo from '../../Assets/navbar/stand_up_to_trash_logo.png';
import { useNavigate } from 'react-router-dom';
import { useContext, useEffect } from 'react';
@@ -128,7 +128,7 @@ const Navbar = () => {
paddingBottom="35px"
paddingLeft="20px"
>
-
+
{
>
{/* User image */}
-
{
-
+
{first_name} {last_name}
@@ -92,7 +92,13 @@ const RenderVolunteerRow = ({ volunteer }) => {
-
+
{volunteer.first_name} {volunteer.last_name}
diff --git a/src/pages/HomePage.jsx b/src/pages/HomePage.jsx
index 717832a..ef07876 100644
--- a/src/pages/HomePage.jsx
+++ b/src/pages/HomePage.jsx
@@ -165,13 +165,11 @@ const Home = () => {
-
-
-
- {/* */}
- {eventCards}
-
-
+
+
+ {/* */}
+ {eventCards}
+
| |