From 5d8a29d19c7337ea5b15c1158310660ff3716306 Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Sun, 31 Mar 2024 05:22:10 +0000 Subject: [PATCH] Final Touches --- frontend-next/.eslintrc.json | 3 ++- frontend-next/src/app/app/page.js | 12 +++--------- frontend-next/src/app/page.js | 2 -- frontend-next/src/app/user/[stub]/page.js | 4 ++-- frontend-next/src/components/app/header.js | 1 - frontend-next/src/components/app/main_tab/chat.js | 1 - .../src/components/app/profile/ProfileRoom.js | 2 +- frontend-next/src/components/app/sidebar/home.js | 3 +-- 8 files changed, 9 insertions(+), 19 deletions(-) diff --git a/frontend-next/.eslintrc.json b/frontend-next/.eslintrc.json index 1c9c6d8..6b2f9c6 100644 --- a/frontend-next/.eslintrc.json +++ b/frontend-next/.eslintrc.json @@ -3,6 +3,7 @@ "rules": { "no-unused-vars": ["warn", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }], "jsx-a11y/alt-text": "off", - "@next/next/no-img-element": "off" + "@next/next/no-img-element": "off", + "no-console": "on", } } diff --git a/frontend-next/src/app/app/page.js b/frontend-next/src/app/app/page.js index a2bb435..75d60e3 100644 --- a/frontend-next/src/app/app/page.js +++ b/frontend-next/src/app/app/page.js @@ -2,14 +2,10 @@ // System Imports import { useState, useEffect } from "react"; import { auth, database } from "../../../firebase-config"; -import { ref, onValue, set, remove, get } from "firebase/database"; +import { ref, onValue } from "firebase/database"; import { useAuthState } from "react-firebase-hooks/auth" import { useGeolocated } from "react-geolocated"; -// Refactored Component Imports -// Data Structure Imports -import { Member } from "../../components/app/datatypes"; - // Header Import import { Header } from "../../components/app/header"; @@ -24,7 +20,6 @@ function Home() { // It's time to document and change these awful variable names // State variables for app page const [user, setUser] = useState(null); - const [mainTab, setMainTab] = useState("home"); // Primary tab const [loadingLoc, setLoadingLoc] = useState(true); // location variable loading, true = loading, false = finished loading const [authUser, loading] = useAuthState(auth) @@ -50,7 +45,6 @@ function Home() { }); useEffect(() => { - console.log(coords) if (coords) { setLoadingLoc(false); } @@ -69,10 +63,10 @@ function Home() { /> {/* Main Page Section */}
- {mainTab == "home" && !loadingLoc && ( + {!loadingLoc && ( )} - {mainTab == "home" && loadingLoc && ( + {loadingLoc && ( )}
diff --git a/frontend-next/src/app/page.js b/frontend-next/src/app/page.js index 4cdce00..dee3a1c 100644 --- a/frontend-next/src/app/page.js +++ b/frontend-next/src/app/page.js @@ -9,13 +9,11 @@ function Home() { const [isLoadingLoc, setLoadingLoc] = useState(true); const [roomCount, setRoomCount] = useState(null); const [isAuthenticated, setAuth] = useState(false); - const [userID, setUserID] = useState(null); // Authentication useEffect(() => { onAuthStateChanged(auth, (user) => { if (user) { - setUserID(user.uid); setAuth(true); } else { setAuth(false); diff --git a/frontend-next/src/app/user/[stub]/page.js b/frontend-next/src/app/user/[stub]/page.js index 846f641..17bc135 100644 --- a/frontend-next/src/app/user/[stub]/page.js +++ b/frontend-next/src/app/user/[stub]/page.js @@ -1,8 +1,8 @@ "use client"; // System Imports import { useState, useEffect } from "react"; -import { auth, database, storage } from "../../../../firebase-config"; -import { ref, onValue, get, update } from "firebase/database"; +import { auth, database } from "../../../../firebase-config"; +import { ref, onValue, get } from "firebase/database"; import { onAuthStateChanged } from "firebase/auth"; // Refactored Component Imports diff --git a/frontend-next/src/components/app/header.js b/frontend-next/src/components/app/header.js index 4a190a7..f6605f7 100644 --- a/frontend-next/src/components/app/header.js +++ b/frontend-next/src/components/app/header.js @@ -2,7 +2,6 @@ import { auth, database } from "../../../firebase-config"; import { ref, set, remove } from "firebase/database"; import { signOut } from "firebase/auth"; import { Popover } from "@headlessui/react"; -import { useState, useEffect } from "react"; function logout() { diff --git a/frontend-next/src/components/app/main_tab/chat.js b/frontend-next/src/components/app/main_tab/chat.js index 4e6c1f6..28d6cae 100644 --- a/frontend-next/src/components/app/main_tab/chat.js +++ b/frontend-next/src/components/app/main_tab/chat.js @@ -7,7 +7,6 @@ import { database } from "../../../../firebase-config"; // Chatroom Module for Primary Tab export function MainTabChatRoom({ roomObj, user }) { var { register, control, reset, handleSubmit } = useForm(); - const [isLoading, setLoading] = useState(true); // Message updater var chatsArr = []; diff --git a/frontend-next/src/components/app/profile/ProfileRoom.js b/frontend-next/src/components/app/profile/ProfileRoom.js index 269c6e6..80e6268 100644 --- a/frontend-next/src/components/app/profile/ProfileRoom.js +++ b/frontend-next/src/components/app/profile/ProfileRoom.js @@ -20,7 +20,7 @@ export function ProfileRoom({ room }) { diff --git a/frontend-next/src/components/app/sidebar/home.js b/frontend-next/src/components/app/sidebar/home.js index 59b7a2b..dbfce0b 100644 --- a/frontend-next/src/components/app/sidebar/home.js +++ b/frontend-next/src/components/app/sidebar/home.js @@ -3,7 +3,7 @@ import { database } from "../../../../firebase-config"; import { ref, set, get } from "firebase/database"; import { useEffect, useState } from "react"; -import { ChatRoomSidebar, Marker } from "../datatypes"; +import { ChatRoomSidebar } from "../datatypes"; // Sidebar on Home Page, with various functionality (create, nearby, my rooms) // CreateRoom Module for Sidebar Create Tab @@ -80,7 +80,6 @@ export function Home_Sidebar({ if (snapshot.exists()) { var rooms = snapshot.val() for (var room in rooms) { - console.log(rooms[room]) var newRoom = (