getting set up for the main view of create team or ask manager

This commit is contained in:
Arjun Patel
2022-01-14 02:00:43 -08:00
parent a44890a607
commit 5b683f2bde
2 changed files with 10 additions and 7 deletions
+9 -2
View File
@@ -1,6 +1,6 @@
import { useAuth } from "../../contexts/authContext" import { useAuth } from "../../contexts/authContext"
import { useRouter } from "next/router" import { useRouter } from "next/router"
import { useEffect } from "react" import { useEffect, useState } from "react"
import UserService from '../../services/userService' import UserService from '../../services/userService'
import { User } from "../../models/user" import { User } from "../../models/user"
import { GetServerSidePropsContext } from "next" import { GetServerSidePropsContext } from "next"
@@ -15,6 +15,7 @@ function RouteHandler({ user }) {
const { currUser } = useAuth() const { currUser } = useAuth()
const router = useRouter() const router = useRouter()
const userService: UserService = new UserService() const userService: UserService = new UserService()
const [loading, setLoading] = useState<Boolean>(false)
useEffect(() => { useEffect(() => {
@@ -35,7 +36,9 @@ function RouteHandler({ user }) {
router.push('/teams/profile') router.push('/teams/profile')
} }
// check if user is in a team or has created one // check if user is in a team go to the team dashboard
} catch(error) { } catch(error) {
console.log(error) console.log(error)
@@ -44,6 +47,10 @@ function RouteHandler({ user }) {
})(); })();
}, [currUser]) }, [currUser])
if (loading) {
return <div>figuring out where you should go</div>
}
return ( return (
<div className="text-black">this is the route handler page</div> <div className="text-black">this is the route handler page</div>
) )
-4
View File
@@ -6,10 +6,6 @@ export default class UserService {
private db : Firestore = getFirestore() private db : Firestore = getFirestore()
private static collectionName: string = "users" private static collectionName: string = "users"
constructor() {
}
// give back the avatar based on the person's google account avatar // give back the avatar based on the person's google account avatar
getUserAvatar(displayName: string) { getUserAvatar(displayName: string) {
return `https://ui-avatars.com/api/?name=${displayName}` return `https://ui-avatars.com/api/?name=${displayName}`