Skip to content

Commit

Permalink
fix: fix bug with table and avatar (#410)
Browse files Browse the repository at this point in the history
* fix(avatar): remove background if image has src

* fix(table): fix nodata view at table with groupBy

* chore: reivew fix
  • Loading branch information
Selnapenek authored Apr 15, 2022
1 parent f67ae8a commit a4f3e69
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Avatar/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Avatar({
const initials = getInitials(firstName, lastName);

return (
<AvatarTag pickVariant={ pickVariant } { ...rest } firstName={ firstName } tagName="div">
<AvatarTag transparent={ !!src } pickVariant={ pickVariant } { ...rest } firstName={ firstName } tagName="div">
{
src ? <AvatarImgTag modifiers={ rest } tagName="img" src={ src } /> : initials
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Avatar/Avatar.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const [AvatarTag, themeAvatar] = createThemeTag(name, ({ COLORS }: *) => ({
justifyContent: 'center',
alignItems: 'center',
position: 'relative',
backgroundColor: getBackgroundColorByName(props.firstName),
backgroundColor: props.transparent ? 'transparent' : getBackgroundColorByName(props.firstName),
color: COLORS.WHITE,
fontWeight: 600,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/TableBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class TableBuilder extends PureComponent<TableBulderProps, TableBuilderState> {
renderContent = () => {
const { groupBy, data, renderGroupTitle } = this.props;

if (groupBy && typeof groupBy === 'function') {
if (data && data.length !== 0 && groupBy && typeof groupBy === 'function') {

const groupedData = groupBy(data) || {};
return (
Expand Down

0 comments on commit a4f3e69

Please sign in to comment.