Skip to content

Commit

Permalink
commented console log statements and unused component files (#32)
Browse files Browse the repository at this point in the history
administrative merge commit - merging clear-logs into main
  • Loading branch information
ArshMalik02 authored Mar 16, 2023
2 parents 7edd8c6 + a093b5f commit 8c1fcf1
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 250 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ packages/react-devtools-extensions/shared/build
packages/react-devtools-extensions/.tempUserDataDir
packages/react-devtools-inline/dist
packages/react-devtools-shell/dist
packages/react-devtools-timeline/dist
packages/react-devtools-timeline/dist

#This file was modified from https://github.com/facebook/react/blob/main/.gitignore.
2 changes: 1 addition & 1 deletion src/components/ClassesStacked.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const ClassesStacked = (props) => {

function Work (){
let n1size = props.props.courses.length
console.log("what is worng here?", n1size)
// console.log("what is worng here?", n1size)
let arr = []
for (let i = 0; i < n1size && i < 4; i++ ) {
arr.push(props.props.courses[i]);
Expand Down
12 changes: 6 additions & 6 deletions src/components/CoursePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const defaultValues = {

const CourseForm = () => {
let { id } = useParams();
console.log(id);
// console.log(id);

const [checkValues, setcheckValues] = useState(defaultValues);
const [students, setStudents] = useState(null);
Expand All @@ -94,27 +94,27 @@ const CourseForm = () => {
useEffect(() => {
onAuthStateChanged(auth, (user) => {
if (user) {
console.log("running use effect from course page");
console.log(id);
// console.log("running use effect from course page");
// console.log(id);
const otherStudentPromise = getStudentsInClass(
id
);
otherStudentPromise.then((value) => {
// @Sujay - the request assumes that every student has a distinct name
// The value here is an array of students with the name id, but there would\
// always be only one element because of our assumption.
console.log("logging from course page", value);
// console.log("logging from course page", value);
setAllStudentsInCourse(value);
});
} else {
console.log("Dashboard Err!!");
// console.log("Dashboard Err!!");
}
});
}, []);

const handleSubmit = (event) => {
event.preventDefault();
console.log(checkValues);
// console.log(checkValues);

//update database
const course = id; //"CS 35L – Software Construction Lab";
Expand Down
14 changes: 7 additions & 7 deletions src/components/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ function Dashboard() {
useEffect(() => {
onAuthStateChanged(auth, (user) => {
if (user) {
console.log("entering Promise all");
// console.log("entering Promise all");
// Implementing Promise all
// const userPromise = getUserData();
// Promise.all([userPromise]).then((values) => {
// console.log("dashboard user:", values[0]);
// setStudent(values[0]);
// });
console.log("Dashboard onAuth!!");
console.log("returned from form");
// console.log("Dashboard onAuth!!");
// console.log("returned from form");
const promise = getUserData();
promise.then((value) => {
console.log("here", value);
// console.log("here", value);
setStudent(value);
const studentCourses = value.courses;
studentCourses.forEach((course) => {
const coursePromise = getStudentsInClass(course);
coursePromise.then((cvalue) => {
console.log(cvalue);
// console.log(cvalue);
let temp = [];
if (!courseStudentMap.has(course)) {
cvalue.forEach((s) => {
Expand All @@ -66,11 +66,11 @@ function Dashboard() {
setCourseStudentMap(courseStudentMap);
});
promise.catch((err) => {
console.log(err);
// console.log(err);
});
}
else {
console.log("Dashboard Err!!")
// console.log("Dashboard Err!!")
}
});
}, []);
Expand Down
10 changes: 5 additions & 5 deletions src/components/DashboardCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ function handleProfileImage(image) {
}

function DashboardCard(props) {
console.log("what is the props here?", props);
// console.log("what is the props here?", props);
let image = handleProfileImage(props.image);
// state variable to hold student's profile object
const [student, setStudent] = useState(null);
useEffect(() => {
onAuthStateChanged(auth, (user) => {
console.log("Header user", user);
// console.log("Header user", user);
if (user) {
console.log("running use effect from profile");
// console.log("running use effect from profile");
const studentPromise = getUserDataFromName(props.name);
studentPromise.then((value) => {
console.log(value);
// console.log(value);
setStudent(value[0]);
});
} else {
console.log("dashboard card err!!");
// console.log("dashboard card err!!");
}
});
}, []);
Expand Down
2 changes: 1 addition & 1 deletion src/components/DashboardHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const SubStyle = {

function DashboardHeader(props) {
if (!props.props?.name) return (<p>Loading...</p>);
console.log("this is student", props.props);
// console.log("this is student", props.props);
return(
<Container>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DashboardList.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function DashboardList(props){

const n1size = props.courseMap.get(props.student.courses[props.index]).length;

console.log("n1size is", n1size)
// console.log("n1size is", n1size)

function Work () {
let arr = []
Expand Down
14 changes: 7 additions & 7 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ function Navbar() {
const [student, setStudent] = useState(null);
useEffect(() => {
onAuthStateChanged(auth, (user) => {
console.log("Header user", user);
// console.log("Header user", user);
if (user) {
setLoginStatus(true);
login(user);
console.log("running use effect from profile");
// console.log("running use effect from profile");
const studentPromise = getUserData();
studentPromise.then((value) => {
console.log(value);
// console.log(value);
setStudent(value);
});
} else {
Expand Down Expand Up @@ -109,7 +109,7 @@ function Navbar() {
style={{textTransform: 'none', marginLeft: '12px', fontFamily: 'Poppins', fontStyle: 'normal', fontSize: "17.5px", color: "#333333"}}
onClick={async () => {
await signInWithGoogle();
console.log("returned from sign in");
// console.log("returned from sign in");
if (newUser){
navigate("/profileform");
} else {
Expand All @@ -126,7 +126,7 @@ function Navbar() {
style={{textTransform: 'none', marginLeft: '12px', fontFamily: 'Poppins', fontStyle: 'normal', fontSize: "17.5px", color: "#333333"}}
onClick={async () => {
await signOutOfApp();
console.log("returned from sign out");
// console.log("returned from sign out");
navigate("/");
}}
>
Expand Down Expand Up @@ -175,7 +175,7 @@ function Navbar() {
style={{textTransform: 'none', marginLeft: '12px', fontFamily: 'Poppins', fontStyle: 'normal', fontSize: "17.5px", color: "#333333"}}
onClick={async () => {
await signInWithGoogle();
console.log("returned from sign in");
// console.log("returned from sign in");
if (newUser){
navigate("/profileform");
} else {
Expand All @@ -192,7 +192,7 @@ function Navbar() {
style={{textTransform: 'none', marginLeft: '12px', fontFamily: 'Poppins', fontStyle: 'normal', fontSize: "17.5px", color: "#333333"}}
onClick={async () => {
await signOutOfApp();
console.log("returned from sign out");
// console.log("returned from sign out");
navigate("/");
}}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NameBlockProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const TextStyle = {

const NameBlockProfile = (props) => {
let nsize = props.props.courses.length;
console.log("checking profile picture", props.props.imgUrl);
// console.log("checking profile picture", props.props.imgUrl);

if (props.props.imgUrl) {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/components/ProfileBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ const ProfileBackground = () => {
useEffect(() => {
onAuthStateChanged(auth, (user) => {
if (user) {
console.log("running use effect from profile");
// console.log("running use effect from profile");
const studentPromise = getUserData();
studentPromise.then((value) => {
console.log(value);
// console.log(value);
setStudent(value);
});
}
else {
console.log("Dashboard Err!!")
// console.log("Dashboard Err!!")
}
});
}, []);
console.log("Checking nullity", student);
// console.log("Checking nullity", student);
if (!student?.name) return (<p>Loading...</p>);

return(
Expand Down
10 changes: 5 additions & 5 deletions src/components/ProfileOtherBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ const HeaderStyle = {

const ProfileOtherBackground = () => {
let { id } = useParams();
console.log(id);
// console.log(id);

// state variable to hold other student's profile object
const [otherStudent, setOtherStudent] = useState(null);

useEffect(() => {
onAuthStateChanged(auth, (user) => {
if (user) {
console.log("running use effect from profile other");
console.log(id);
// console.log("running use effect from profile other");
// console.log(id);
const otherStudentPromise = getUserDataFromName(id);
otherStudentPromise.then((value) => {
// @Sujay - the request assumes that every student has a distinct name
Expand All @@ -71,11 +71,11 @@ const ProfileOtherBackground = () => {
});
}
else {
console.log("Dashboard Err!!")
// console.log("Dashboard Err!!")
}
});
}, []);
console.log("Checking nullity", otherStudent);
// console.log("Checking nullity", otherStudent);
if (!otherStudent?.name) return (<p>Loading...</p>);
return(
<Bg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProtectedRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const ProtectedRoute = ({ children }) => {
const { user } = useAuth();
if (!user) {
// user is not authenticated
console.log("user is not authenticated");
// console.log("user is not authenticated");
return <Navigate to="/" />;
}
return children;
Expand Down
Loading

0 comments on commit 8c1fcf1

Please sign in to comment.