diff --git a/ui/src/components/Header.tsx b/ui/src/components/Header.tsx index d9e33570e..dfa11e3d9 100644 --- a/ui/src/components/Header.tsx +++ b/ui/src/components/Header.tsx @@ -1,8 +1,3 @@ -import { PageData } from "../types"; -import { Avatar } from "./Avatar"; -import Logo from "./Logo"; -import { ToolbarOffset } from "./ToolbarOffset"; -import UserSidebarContent from "./UserSidebarContent"; import { Drawer, IconButton, @@ -18,7 +13,13 @@ import styled from "@mui/material/styles/styled"; import { get } from "lodash"; import React, { FC, useState } from "react"; import { ChevronLeft, ChevronRight, Menu as MenuIcon } from "react-feather"; + import LogoURL from "../static/logo_white.svg"; +import { PageData } from "../types"; +import { Avatar } from "./Avatar"; +import Logo from "./Logo"; +import { ToolbarOffset } from "./ToolbarOffset"; +import UserSidebarContent from "./UserSidebarContent"; const DrawerHeader = styled("div")(({ theme }) => ({ display: "flex", @@ -47,7 +48,15 @@ const Header: FC = ({ includeSidebar, data }) => { setAnchorEl(null); }; const userName = - get(data, "user.name") || get(data, "user.claims.given_name"); + get(data, "user.name") || + get(data, "user.claims.given_name") || + get(data, "profile.claims.name") || + get(data, "profile.claims.given_name") || + ""; + const userPictureUrl = + get(data, "user.claims.picture") || + get(data, "profile.claims.picture") || + null; const handleDrawerOpen = () => { setDrawerOpen(true); @@ -109,32 +118,25 @@ const Header: FC = ({ includeSidebar, data }) => { ) : ( - + )} - {userName && ( - <> - - - - - Logout - - - )} + + + + + Logout + );