diff --git a/pages/teams/profile.tsx b/pages/teams/profile.tsx index 00a8dc7..d34b9c2 100644 --- a/pages/teams/profile.tsx +++ b/pages/teams/profile.tsx @@ -9,6 +9,7 @@ import Image from "next/image"; export default function Profile() { const { currUser, logOut } = useAuth(); const [user, setUser] = useState(null); + const [loading, setLoading] = useState(false); const router = useRouter(); const userService: UserService = new UserService(); @@ -55,6 +56,8 @@ export default function Profile() { }, []); async function handleSubmit(e) { + setLoading(true); + e.preventDefault(); if (!firstName) { @@ -91,6 +94,8 @@ export default function Profile() { "Something went wrong in saving your information. Please try again." ); } + + setLoading(false); } const [firstName, setFirstName] = useState( @@ -114,7 +119,7 @@ export default function Profile() { - Avatar + Avatar* Please change your google image to change this. @@ -126,7 +131,7 @@ export default function Profile() { - Email + Email* This is set from your Google account and cannot be changed. @@ -140,7 +145,7 @@ export default function Profile() {
- First Name + First Name* - Last Name + Last Name* - Nickname + Nickname* What does your team call you? This is what is displayed. @@ -178,7 +183,7 @@ export default function Profile() { - Role + Role* Are you a developer? designer? manager? @@ -195,30 +200,39 @@ export default function Profile() { {/* if they already had a nickname, they are probably revisiting this page */} {/* can't cancel if they are a new user */} - {user && user.nickName ? ( - <> - - - + {loading ? ( + ) : ( <> - {/* if they already had a nickname, they are probably revisiting this page */} - + {user && user.nickName ? ( + <> + + + + ) : ( + <> + {/* if they already had a nickname, they are probably revisiting this page */} + + + )} )}