Update Header component to use localStorage for username
This commit is contained in:
parent
7a6b875aeb
commit
f6b2d17b97
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
import { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
function Header({ username }: { username: string }): JSX.Element {
|
||||
function Header(): JSX.Element {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const handleLogout = (): void => {
|
||||
|
@ -31,7 +31,7 @@ function Header({ username }: { username: string }): JSX.Element {
|
|||
}}
|
||||
>
|
||||
<button className="mr-4 underline font-bold text-white">
|
||||
{username}
|
||||
{localStorage.getItem("username")}
|
||||
</button>
|
||||
|
||||
{isOpen && (
|
||||
|
|
Loading…
Reference in a new issue