Skip to content

Commit a4f3e69

Browse files
authored
fix: fix bug with table and avatar (8base#410)
* fix(avatar): remove background if image has src * fix(table): fix nodata view at table with groupBy * chore: reivew fix
1 parent f67ae8a commit a4f3e69

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/components/Avatar/Avatar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function Avatar({
5151
const initials = getInitials(firstName, lastName);
5252

5353
return (
54-
<AvatarTag pickVariant={ pickVariant } { ...rest } firstName={ firstName } tagName="div">
54+
<AvatarTag transparent={ !!src } pickVariant={ pickVariant } { ...rest } firstName={ firstName } tagName="div">
5555
{
5656
src ? <AvatarImgTag modifiers={ rest } tagName="img" src={ src } /> : initials
5757
}

src/components/Avatar/Avatar.theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const [AvatarTag, themeAvatar] = createThemeTag(name, ({ COLORS }: *) => ({
1919
justifyContent: 'center',
2020
alignItems: 'center',
2121
position: 'relative',
22-
backgroundColor: getBackgroundColorByName(props.firstName),
22+
backgroundColor: props.transparent ? 'transparent' : getBackgroundColorByName(props.firstName),
2323
color: COLORS.WHITE,
2424
fontWeight: 600,
2525
}),

src/components/Table/TableBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ class TableBuilder extends PureComponent<TableBulderProps, TableBuilderState> {
373373
renderContent = () => {
374374
const { groupBy, data, renderGroupTitle } = this.props;
375375

376-
if (groupBy && typeof groupBy === 'function') {
376+
if (data && data.length !== 0 && groupBy && typeof groupBy === 'function') {
377377

378378
const groupedData = groupBy(data) || {};
379379
return (

0 commit comments

Comments
 (0)