Added user on header menu
This commit is contained in:
parent
a055e4f1fa
commit
48e3b96fd4
1 changed files with 23 additions and 1 deletions
|
|
@ -56,7 +56,7 @@ export default function Header(): JSX.Element {
|
||||||
const lastFlowVisitedIndex = routeHistory
|
const lastFlowVisitedIndex = routeHistory
|
||||||
.reverse()
|
.reverse()
|
||||||
.findIndex(
|
.findIndex(
|
||||||
(path) => path.includes("/flow/") && path !== location.pathname
|
(path) => path.includes("/flow/") && path !== location.pathname,
|
||||||
);
|
);
|
||||||
|
|
||||||
const lastFlowVisited = routeHistory[lastFlowVisitedIndex];
|
const lastFlowVisited = routeHistory[lastFlowVisitedIndex];
|
||||||
|
|
@ -200,6 +200,28 @@ export default function Header(): JSX.Element {
|
||||||
/>
|
/>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent>
|
<DropdownMenuContent>
|
||||||
|
{!autoLogin && (
|
||||||
|
<>
|
||||||
|
<DropdownMenuLabel>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
"h-5 w-5 rounded-full focus-visible:outline-0 " +
|
||||||
|
(userData?.profile_image ??
|
||||||
|
(userData?.id
|
||||||
|
? gradients[
|
||||||
|
parseInt(userData?.id ?? "", 30) %
|
||||||
|
gradients.length
|
||||||
|
]
|
||||||
|
: "bg-gray-500"))
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{userData?.username ?? "User"}
|
||||||
|
</div>
|
||||||
|
</DropdownMenuLabel>
|
||||||
|
<DropdownMenuSeparator />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<DropdownMenuLabel>General</DropdownMenuLabel>
|
<DropdownMenuLabel>General</DropdownMenuLabel>
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
className="cursor-pointer"
|
className="cursor-pointer"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue