Skip to content

Commit f7cffd1

Browse files
committed
chore: update styling for AvatarCard
1 parent 69fab82 commit f7cffd1

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

site/src/components/AvatarCard/AvatarCard.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { type ReactNode } from "react";
2-
import { Avatar, AvatarIcon } from "components/Avatar/Avatar";
2+
import { Avatar } from "components/Avatar/Avatar";
33
import { type CSSObject, useTheme } from "@emotion/react";
44

55
type AvatarCardProps = {
6-
header: ReactNode;
6+
header: string;
77
imgUrl: string;
88
altText: string;
99

@@ -32,8 +32,22 @@ export function AvatarCard({
3232
cursor: "default",
3333
}}
3434
>
35-
<div css={{ marginRight: "auto" }}>
36-
<div css={theme.typography.body1 as CSSObject}>{header}</div>
35+
<div css={{ marginRight: "auto", minWidth: 0 }}>
36+
<h3
37+
title={header}
38+
css={[
39+
theme.typography.body1 as CSSObject,
40+
{
41+
lineHeight: 1.5,
42+
margin: 0,
43+
overflow: "hidden",
44+
whiteSpace: "nowrap",
45+
textOverflow: "ellipsis",
46+
},
47+
]}
48+
>
49+
{header}
50+
</h3>
3751

3852
{subtitle && (
3953
<div
@@ -47,11 +61,9 @@ export function AvatarCard({
4761
)}
4862
</div>
4963

50-
<div>
51-
<Avatar>
52-
<AvatarIcon src={imgUrl} alt={altText} />
53-
</Avatar>
54-
</div>
64+
<Avatar src={imgUrl} alt={altText} colorScheme="darken">
65+
{header}
66+
</Avatar>
5567
</article>
5668
);
5769
}

0 commit comments

Comments
 (0)