Skip to content

Commit

Permalink
resolve eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Koltheguy committed Apr 17, 2024
1 parent 15228fa commit aad60df
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
13 changes: 5 additions & 8 deletions src/Lobby/Lobby.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, { useState, useEffect, useContext } from "react";
import { getAuth, signOut, updateProfile } from "firebase/auth";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faGoogle } from "@fortawesome/free-brands-svg-icons";
import { getAuth, signOut } from "firebase/auth";
// import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
// import { faGoogle } from "@fortawesome/free-brands-svg-icons";
import styles from "./Lobby.module.css";
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { useUser } from "reactfire";
// import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { ReactFireStoreContext } from "../ReactFireProvider";

const Lobby = () => {
Expand All @@ -13,9 +12,7 @@ const Lobby = () => {
signOut(auth);
};

const { displayName, uid, changeUserName } = useContext(
ReactFireStoreContext
);
const { displayName, changeUserName } = useContext(ReactFireStoreContext);

const [username, setUsername] = useState(displayName);

Expand Down
22 changes: 12 additions & 10 deletions src/ReactFireProvider.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useState } from "react";
import { collection, query } from "firebase/firestore";
// import { collection, query } from "firebase/firestore";
import { getAuth, updateProfile } from "firebase/auth";
import { useFirestore, useFirestoreCollectionData, useUser } from "reactfire";
// import { useFirestore, useFirestoreCollectionData, useUser } from "reactfire";
import { useUser } from "reactfire";
import {
uniqueNamesGenerator,
adjectives,
Expand Down Expand Up @@ -31,18 +32,19 @@ export default function ReactFireStoreProvider(props) {
let displayName, uid;
if (status !== "loading") {
({ displayName, uid } = data);
console.debug(uid);
}

const [refresh, setRefresh] = useState(true);

const firestore = useFirestore();
const UserCollection = collection(firestore, "User");
const UserQuery = query(UserCollection);
const { data: User } = useFirestoreCollectionData(UserQuery);
const GameCollection = collection(firestore, "Game");
const Game = useFirestoreCollectionData(GameCollection);
const ChatCollection = collection(firestore, "Chat");
const Chat = useFirestoreCollectionData(ChatCollection);
// const firestore = useFirestore();
// const UserCollection = collection(firestore, "User");
// const UserQuery = query(UserCollection);
// const { data: User } = useFirestoreCollectionData(UserQuery);
// const GameCollection = collection(firestore, "Game");
// const Game = useFirestoreCollectionData(GameCollection);
// const ChatCollection = collection(firestore, "Chat");
// const Chat = useFirestoreCollectionData(ChatCollection);

const changeUserName = async (name) => {
const matches = obscenityMatcher.getAllMatches(name);
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import firebase from "firebase/compat/app";
// import firebase from "firebase/compat/app";
import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
import React from "react";
Expand Down

0 comments on commit aad60df

Please sign in to comment.