From 5cf67fdbaad0b45e3966be7588b9c5a085a04242 Mon Sep 17 00:00:00 2001 From: Peer Richelsen Date: Wed, 23 Feb 2022 11:09:22 +0000 Subject: [PATCH] fixed avatar group and tooltip (#1950) --- apps/web/components/ui/Avatar.tsx | 2 +- apps/web/components/ui/AvatarGroup.tsx | 33 ++------------------------ 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/apps/web/components/ui/Avatar.tsx b/apps/web/components/ui/Avatar.tsx index 4232d5c8..ecc18d7b 100644 --- a/apps/web/components/ui/Avatar.tsx +++ b/apps/web/components/ui/Avatar.tsx @@ -36,7 +36,7 @@ export default function Avatar(props: AvatarProps) { return title ? ( {avatar} - + {title} diff --git a/apps/web/components/ui/AvatarGroup.tsx b/apps/web/components/ui/AvatarGroup.tsx index c1320e1a..45fb0be6 100644 --- a/apps/web/components/ui/AvatarGroup.tsx +++ b/apps/web/components/ui/AvatarGroup.tsx @@ -4,8 +4,6 @@ import classNames from "@lib/classNames"; import Avatar from "@components/ui/Avatar"; -// import * as Tooltip from "@radix-ui/react-tooltip"; - export type AvatarGroupProps = { size: number; truncateAfter?: number; @@ -18,44 +16,17 @@ export type AvatarGroupProps = { }; export const AvatarGroup = function AvatarGroup(props: AvatarGroupProps) { - /* const truncatedAvatars: string[] = - props.items.length > props.truncateAfter - ? props.items - .slice(props.truncateAfter) - .map((item) => item.title) - .filter(Boolean) - : [];*/ - return ( -
    +
      {props.items.slice(0, props.truncateAfter).map((item, idx) => { if (item.image != null) { return ( -
    • +
    • ); } })} - {/*props.items.length > props.truncateAfter && ( -
    • - - - +1 - - {truncatedAvatars.length !== 0 && ( - - -
        - {truncatedAvatars.map((title) => ( -
      • {title}
      • - ))} -
      -
      - )} -
      -
    • - )*/}
    ); };