adding border to avatargroup based on the parent background color (#1954)

This commit is contained in:
Peer Richelsen authored and GitHub committed 2022-02-23 13:55:59 +00:00
1 parent b860a79d59
commit 9e89f954e8
5 files changed
+7 -1

No files matched your search

+2 -1
View File
@@ -5,6 +5,7 @@ import classNames from "@lib/classNames";
import Avatar from "@components/ui/Avatar";
export type AvatarGroupProps = {
border?: string; // this needs to be the color of the parent container background, i.e.: border-white dark:border-gray-900
size: number;
truncateAfter?: number;
items: {
@@ -21,7 +22,7 @@ export const AvatarGroup = function AvatarGroup(props: AvatarGroupProps) {
{props.items.slice(0, props.truncateAfter).map((item, idx) => {
if (item.image != null) {
return (
<li key={idx} className="-mr-3 inline-block">
<li key={idx} className={classNames("-mr-2 inline-block border-2", props.border)}>
<Avatar imageSrc={item.image} title={item.title} alt={item.alt || ""} size={props.size} />
</li>
);