From 7129071a553b7a4da4b0564025ae9f787f6f9c8f Mon Sep 17 00:00:00 2001 From: "Rayyan (Rayy)" Date: Tue, 10 Oct 2023 09:32:54 +0000 Subject: [PATCH] Change "Account" to user email when signed out. --- src/App.js | 2 +- src/components/Header.js | 52 +++++++++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/App.js b/src/App.js index f0ff7ee..d336dbb 100644 --- a/src/App.js +++ b/src/App.js @@ -98,7 +98,7 @@ const signIn = (email, password) => { } return (
-
+
} /> diff --git a/src/components/Header.js b/src/components/Header.js index 73fa5b0..d7b62ff 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -3,24 +3,38 @@ import Navbar from "react-bootstrap/Navbar" import Nav from "react-bootstrap/Nav" import NavDropdown from "react-bootstrap/NavDropdown" -export function Header ( props ) { - // props.items is the value of nav state in App.js - // create a collection of navigation items - const Links = props.items.map( (item, itemkey) => { -return ( - {item.label} -) - } ) +export function Header(props) { + // props.items is the value of nav state in App.js + // create a collection of navigation items + const Links = props.items.map((item, itemkey) => { return ( - - - App - - - ) + {item.label} + ) + }) + // component for Account + const Account = (props) => { + if (props.user) { + return ( + + Log out + + ) + } + else { + return null + } + + } + return ( + + + App + + + ) } \ No newline at end of file