diff --git a/frontend-next/src/components/app/header.js b/frontend-next/src/components/app/header.js index 1fb986d..8a71e2a 100644 --- a/frontend-next/src/components/app/header.js +++ b/frontend-next/src/components/app/header.js @@ -1,14 +1,9 @@ -import { auth, database } from "../../../firebase-config"; +import { database } from "../../../firebase-config"; import { ref, set, remove } from "firebase/database"; -import { signOut } from "firebase/auth"; -import { Popover } from "@headlessui/react"; import Link from "next/link" import { NotificationPanel } from "./notifications/notifications"; - -function logout() { - signOut(auth); -} +import { ProfilePanel } from "./profile/ProfilePanel" // Closes chat room function closeChatRoom(roomObj, user) { @@ -126,39 +121,8 @@ export function Header({ {/* Notifications Panel */} - {/*"Profile Dropdown TODO: MOVE TO PROFILE IMPORT - req user, take logout function with"*/} - - -
-
{user.firstName}
-
- -
-
-
- - -
- - View Profile - - - Sign Out - -
-
-
+ {/*Profile Dropdown */} + ); diff --git a/frontend-next/src/components/app/profile/ProfilePanel.js b/frontend-next/src/components/app/profile/ProfilePanel.js new file mode 100644 index 0000000..b9ee881 --- /dev/null +++ b/frontend-next/src/components/app/profile/ProfilePanel.js @@ -0,0 +1,46 @@ +import { Popover } from "@headlessui/react"; +import { auth } from "../../../../firebase-config"; +import { signOut } from "firebase/auth"; +import Link from "next/link" + + +function logout() { + signOut(auth); +} + +export function ProfilePanel({user}) { + return ( + + +
+
{user.firstName}
+
+ +
+
+
+ + +
+ + View Profile + + + Sign Out + +
+
+
+ ) +} \ No newline at end of file