('');
@@ -21,22 +22,29 @@ const Register: React.FC = () => {
};
return (
-
-
Register
- setEmail(e.target.value)}
- placeholder="Email"
- />
- setPassword(e.target.value)}
- placeholder="Password"
- />
-
-
+
+
+ Register
+ setEmail(e.target.value)}
+ />
+ setPassword(e.target.value)}
+ />
+
+
+
);
};
diff --git a/src/components/TopNavBar.tsx b/src/components/TopNavBar.tsx
index c041aaf..123f7a8 100644
--- a/src/components/TopNavBar.tsx
+++ b/src/components/TopNavBar.tsx
@@ -1,23 +1,56 @@
-import React from 'react';
-import {Flex, Heading, MenuTrigger, ActionButton, Menu, Item} from '@adobe/react-spectrum';
+import React, { useEffect, useState } from 'react';
+import { Flex, Heading, MenuTrigger, ActionButton, Menu, Item } from '@adobe/react-spectrum';
+import { getAuth, onAuthStateChanged, signOut } from 'firebase/auth';
+import { Key } from 'react';
-// Nishil
+// Nishil & Syed
// Implements the top navigation bar
const TopNavBar: React.FC = () => {
- return (
+ const [isLoggedIn, setIsLoggedIn] = useState(false);
+ const auth = getAuth();
+
+ useEffect(() => {
+ const unsubscribe = onAuthStateChanged(auth, (user) => {
+ setIsLoggedIn(!!user);
+ });
+ return () => unsubscribe();
+ }, [auth]);
+
+ const handleSignOut = async () => {
+ try {
+ await signOut(auth);
+ setIsLoggedIn(false);
+ } catch (error) {
+ console.error("Sign out failed", error);
+ }
+ };
-
- Metroll
-
- ☰
-
-
-
+ const handleMenuOptions = (key: Key) => {
+ if (key === 'signout') {
+ handleSignOut();
+ }
+ };
+
+ return (
+
+ Metroll
+
+ ☰
+
+
+
);
-}
+};
export default TopNavBar;
diff --git a/src/components/customicons.tsx b/src/components/customicons.tsx
new file mode 100644
index 0000000..8ba613c
--- /dev/null
+++ b/src/components/customicons.tsx
@@ -0,0 +1,37 @@
+import * as React from 'react';
+import SvgIcon from '@mui/material/SvgIcon';
+
+
+
+export function GoogleIcon() {
+ return (
+
+
+
+ );
+}
+
+export {};
\ No newline at end of file
diff --git a/src/pages/LoginPage.tsx b/src/pages/LoginPage.tsx
index 245219f..e455db6 100644
--- a/src/pages/LoginPage.tsx
+++ b/src/pages/LoginPage.tsx
@@ -3,18 +3,26 @@ import React from 'react';
import Login from '../components/Login';
import {useNavigate} from "react-router-dom";
import GoogleSignIn from "../components/GoogleSSO";
-
+import { Button, Container, Stack } from '@mui/material';
// Nishil & Justin
const LoginPage: React.FC = () => {
const navigate = useNavigate();
return (
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
);
};
diff --git a/src/pages/RegisterPage.tsx b/src/pages/RegisterPage.tsx
index eb1ecfa..3a9e15b 100644
--- a/src/pages/RegisterPage.tsx
+++ b/src/pages/RegisterPage.tsx
@@ -2,19 +2,21 @@
import React from 'react';
import Register from '../components/Register';
import {useNavigate} from "react-router-dom";
-
+import { Button, Container, Stack } from '@mui/material';
// Nishil & Justin
const RegisterPage: React.FC = () => {
const navigate = useNavigate();
return (
-
-
-
-
-
+
+
+
+
+
+
+
);
-};
+ };
export default RegisterPage;