From 151bbc24d2330340976599bf66397c145bded7aa Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Thu, 17 Aug 2023 19:06:05 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(headerComponent):=20fix=20re?= =?UTF-8?q?ndering=20issue=20with=20API=20keys=20button=20when=20autoLogin?= =?UTF-8?q?=20is=20true=20=E2=9C=A8=20feat(headerComponent):=20add=20condi?= =?UTF-8?q?tion=20to=20render=20API=20keys=20button=20only=20when=20autoLo?= =?UTF-8?q?gin=20is=20false?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/headerComponent/index.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/components/headerComponent/index.tsx b/src/frontend/src/components/headerComponent/index.tsx index dcbd3737a..3ce19c8aa 100644 --- a/src/frontend/src/components/headerComponent/index.tsx +++ b/src/frontend/src/components/headerComponent/index.tsx @@ -18,13 +18,11 @@ export default function Header() { const { dark, setDark } = useContext(darkContext); const { notificationCenter } = useContext(alertContext); const location = useLocation(); - const { logout, autoLogin } = useContext(AuthContext); + const { logout, autoLogin, isAdmin, setIsAdmin } = useContext(AuthContext); const navigate = useNavigate(); const [stars, setStars] = useState(null); - const { isAdmin, setIsAdmin } = useContext(AuthContext); - // Get and set numbers of stars on header useEffect(() => { async function fetchStars() { @@ -141,16 +139,18 @@ export default function Header() { /> - + {!autoLogin && ( + + )}