Skip to content

Commit

Permalink
after review
Browse files Browse the repository at this point in the history
  • Loading branch information
dew326 committed Sep 26, 2023
1 parent 7376717 commit 57140c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
9 changes: 2 additions & 7 deletions src/bundle/ui-dev/src/modules/common/user-name/user.name.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,11 @@ const UserName = ({ name, thumbnail }) => {
};

UserName.propTypes = {
name: PropTypes.string,
name: PropTypes.string.isRequired,
thumbnail: PropTypes.shape({
mimeType: PropTypes.string.isRequired,
uri: PropTypes.string.isRequired,
}),
};

UserName.defaultProps = {
name: '',
thumbnail: {},
}).isRequired,
};

export default UserName;
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,29 @@ export default class TableViewItemComponent extends PureComponent {
}

renderCreatorCell() {
const { owner } = this.props.item.content._info;

if (!owner) {
return null;
}

return (
<div className="c-table-view-item__text-wrapper">
<UserName
name={this.getName(this.props.item.content._info.owner)}
thumbnail={this.props.item.content._info.owner?.thumbnail}
/>
<UserName name={this.getName(this.props.item.content._info.owner)} thumbnail={owner.thumbnail} />
</div>
);
}

renderContributorCell() {
const { creator } = this.props.item.content._info.currentVersion;

if (!creator) {
return null;
}

return (
<div className="c-table-view-item__text-wrapper">
<UserName
name={this.getName(this.props.item.content._info.currentVersion.creator)}
thumbnail={this.props.item.content._info.currentVersion.creator?.thumbnail}
/>
<UserName name={this.getName(creator)} thumbnail={creator.thumbnail} />
</div>
);
}
Expand Down

0 comments on commit 57140c0

Please sign in to comment.