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 { useRouter } from "next/router"
import { useEffect } from "react"
import { useEffect, useState } from "react"
import UserService from '../../services/userService'
import { User } from "../../models/user"
import { GetServerSidePropsContext } from "next"
@@ -15,6 +15,7 @@ function RouteHandler({ user }) {
const { currUser } = useAuth()
const router = useRouter()
const userService: UserService = new UserService()
const [loading, setLoading] = useState<Boolean>(false)
useEffect(() => {
@@ -35,7 +36,9 @@ function RouteHandler({ user }) {
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) {
console.log(error)
@@ -44,6 +47,10 @@ function RouteHandler({ user }) {
})();
}, [currUser])
if (loading) {
return <div>figuring out where you should go</div>
}
return (
<div className="text-black">this is the route handler page</div>
)
+1 -5
View File
@@ -5,11 +5,7 @@ import { User } from '../models/user'
export default class UserService {
private db : Firestore = getFirestore()
private static collectionName: string = "users"
constructor() {
}
// give back the avatar based on the person's google account avatar
getUserAvatar(displayName: string) {
return `https://ui-avatars.com/api/?name=${displayName}`