From 7bf163d77c7170159c82bbe94e58ba1d8b4e95ca Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Wed, 3 Apr 2024 23:36:11 +0000 Subject: [PATCH] Move Profile Panel to Profile Component Directory --- frontend-next/src/components/app/header.js | 44 ++---------------- .../components/app/profile/ProfilePanel.js | 46 +++++++++++++++++++ 2 files changed, 50 insertions(+), 40 deletions(-) create mode 100644 frontend-next/src/components/app/profile/ProfilePanel.js 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