fix type error in <Shell> Userdropdown (#980)

* removed settings from bottom nav

* truncate bottom nav

* fixed type error in Shell
pull/983/head
Peer Richelsen 2021-10-17 13:13:24 +01:00 committed by GitHub
parent 4d5b5663c0
commit 415d5fe8bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 82 additions and 87 deletions

View File

@ -298,18 +298,14 @@ function UserDropdown({ small }: { small?: boolean }) {
const query = useMeQuery(); const query = useMeQuery();
const user = query.data; const user = query.data;
return ( return user ? (
!!user && (
<Dropdown> <Dropdown>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<div className="flex items-center space-x-2 cursor-pointer group"> <div className="flex items-center space-x-2 cursor-pointer group">
<Avatar <Avatar
imageSrc={user.avatar} imageSrc={user.avatar}
alt={user.username} alt={user.username}
className={classNames( className={classNames(small ? "w-8 h-8" : "w-10 h-10", "bg-gray-300 rounded-full flex-shrink-0")}
small ? "w-8 h-8" : "w-10 h-10",
"bg-gray-300 rounded-full flex-shrink-0"
)}
/> />
{!small && ( {!small && (
<> <>
@ -385,6 +381,5 @@ function UserDropdown({ small }: { small?: boolean }) {
</DropdownMenuItem> </DropdownMenuItem>
</DropdownMenuContent> </DropdownMenuContent>
</Dropdown> </Dropdown>
) ) : null;
);
} }