* Pass organization name & logo * Overflow hidden * Show org icon on public page * Add org logo to large user avatars * Clean up * Add org name and logo to context * Get org logo from /avatar.png endpoint * Do not query for logo * Remove name and logo from session middleware * Type fix * Set user onboarding org logo * feat: organization avatar component (#10788) Co-authored-by: sean-brydon <[email protected]> * Type fixes * Type fix * Transition to org slug for organization avatar * Address feedback * Clean up * Clean up * Type fix * fix: set avatar cache control (#11163) * test: Integration tests for handleNewBooking (#11044) Co-authored-by: Shivam Kalra <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]> * fix: booking_paid webhook and added new payment metadata (#11093) * app store improvements, logos, dark mode, added screenshots, fixed author names (#11164) * fix: mobile event types and avatars (#11184) * New Crowdin translations by Github Action * fix: updateProfile metadata overwrite (#11188) Co-authored-by: alannnc <[email protected]> * New Crowdin translations by Github Action --------- Co-authored-by: Sean Brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: Hariom Balhara <[email protected]> Co-authored-by: Shivam Kalra <[email protected]> Co-authored-by: alannnc <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Leo Giovanetti <[email protected]> Co-authored-by: Crowdin Bot <[email protected]>
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
import classNames from "@calcom/lib/classNames";
|
|
|
|
import { Avatar } from "./Avatar";
|
|
|
|
export type AvatarGroupProps = {
|
|
size: "sm" | "lg";
|
|
items: {
|
|
image: string;
|
|
title?: string;
|
|
alt?: string;
|
|
href?: string;
|
|
}[];
|
|
className?: string;
|
|
truncateAfter?: number;
|
|
};
|
|
|
|
export const AvatarGroup = function AvatarGroup(props: AvatarGroupProps) {
|
|
const LENGTH = props.items.length;
|
|
const truncateAfter = props.truncateAfter || 4;
|
|
/**
|
|
* First, filter all the avatars object that have image
|
|
* Then, slice it until before `truncateAfter` index
|
|
*/
|
|
const displayedAvatars = props.items.filter((avatar) => avatar.image).slice(0, truncateAfter);
|
|
const numTruncatedAvatars = LENGTH - displayedAvatars.length;
|
|
|
|
if (!displayedAvatars.length) return <></>;
|
|
|
|
return (
|
|
<ul className={classNames("flex items-center", props.className)}>
|
|
{displayedAvatars.map((item, idx) => (
|
|
<li key={idx} className="-mr-[4px] inline-block">
|
|
<Avatar
|
|
className="border-subtle"
|
|
imageSrc={item.image}
|
|
title={item.title}
|
|
alt={item.alt || ""}
|
|
size={props.size}
|
|
href={item.href}
|
|
/>
|
|
</li>
|
|
))}
|
|
{numTruncatedAvatars > 0 && (
|
|
<li
|
|
className={classNames(
|
|
"bg-inverted relative -mr-[4px] mb-1 inline-flex justify-center overflow-hidden rounded-full",
|
|
props.size === "sm" ? "min-w-6 h-6" : "min-w-16 h-16"
|
|
)}>
|
|
<span
|
|
className={classNames(
|
|
"text-inverted m-auto px-1 text-center",
|
|
props.size === "sm" ? "text-[12px]" : "text-2xl"
|
|
)}>
|
|
+{numTruncatedAvatars}
|
|
</span>
|
|
</li>
|
|
)}
|
|
</ul>
|
|
);
|
|
};
|