Skip to content

Commit 03478a5

Browse files
fixed console errors from avatar comp
1 parent 036f0da commit 03478a5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

client/packages/lowcoder/src/comps/comps/avatar.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ const AvatarWrapper = styled(Avatar) <AvatarProps & { $cursorPointer?: boolean,
4141
cursor: ${(props) => props.$cursorPointer ? 'pointer' : ''};
4242
`;
4343

44-
const Wrapper = styled.div <{ iconSize: number, labelPosition: string,$style: AvatarContainerStyleType}>`
44+
const Wrapper = styled.div <{ $iconSize: number, $labelPosition: string,$style: AvatarContainerStyleType}>`
4545
display: flex;
4646
width: 100%;
4747
height: 100%;
4848
align-items: center;
49-
flex-direction: ${(props) => props.labelPosition === 'left' ? 'row' : 'row-reverse'};
49+
flex-direction: ${(props) => props.$labelPosition === 'left' ? 'row' : 'row-reverse'};
5050
${(props) => {
5151
return (
5252
props.$style && {
@@ -57,14 +57,14 @@ ${(props) => {
5757
}}
5858
`
5959

60-
const LabelWrapper = styled.div<{ iconSize: number, alignmentPosition: string }>`
61-
width: calc(100% - ${(props) => props.iconSize}px);
60+
const LabelWrapper = styled.div<{ $iconSize: number, $alignmentPosition: string }>`
61+
width: calc(100% - ${(props) => props.$iconSize}px);
6262
display: flex;
6363
padding-left: 5px;
6464
padding-right: 5px;
6565
flex-direction: column;
6666
justify-content: flex-end;
67-
align-items: ${(props) => props.alignmentPosition === 'left' ? 'flex-start' : 'flex-end'};
67+
align-items: ${(props) => props.$alignmentPosition === 'left' ? 'flex-start' : 'flex-end'};
6868
`
6969
const LabelSpan = styled.span<{ $style:AvatarLabelStyleType }>`
7070
max-width: 100%;
@@ -166,7 +166,7 @@ const AvatarView = (props: RecordConstructorToView<typeof childrenMap>) => {
166166
disabled={!props.enableDropdownMenu}
167167
dropdownRender={() => menu}
168168
>
169-
<Wrapper iconSize={props.iconSize} labelPosition={props.labelPosition} $style={props.style}>
169+
<Wrapper $iconSize={props.iconSize} $labelPosition={props.labelPosition} $style={props.style}>
170170
<Badge
171171
count={props.badgeCount.value}
172172
dot={props.badgeType === 'dot'}
@@ -187,7 +187,7 @@ const AvatarView = (props: RecordConstructorToView<typeof childrenMap>) => {
187187
{title.value}
188188
</AvatarWrapper>
189189
</Badge>
190-
<LabelWrapper iconSize={props.iconSize} alignmentPosition={props.alignmentPosition}>
190+
<LabelWrapper $iconSize={props.iconSize} $alignmentPosition={props.alignmentPosition}>
191191
<LabelSpan $style={props.labelStyle}>{props.avatarLabel.value}</LabelSpan>
192192
<CaptionSpan $style={props.captionStyle}>{props.avatarCatption.value}</CaptionSpan>
193193
</LabelWrapper>

client/packages/lowcoder/src/comps/comps/avatarGroup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ const AvatarGroupView = (props: RecordConstructorToView<typeof childrenMap> & {
111111
alignment={props.alignment}
112112
>
113113
{
114-
<Avatar.Group maxCount={props.maxCount} size={props.avatarSize}>
114+
<Avatar.Group max={{ count: props.maxCount }} size={props.avatarSize}>
115115
{
116116
props.avatars.map((item, index) => {
117117
return (
118-
<Tooltip title={item.Tooltip}>
118+
<Tooltip title={item.Tooltip} key={index}>
119119
<Avatar
120120
src={item.src ?? undefined}
121121
icon={(item.AvatarIcon as ReactElement)?.props.value === '' || item.label.trim() !== '' ? undefined : item.AvatarIcon}

0 commit comments

Comments
 (0)