Web: Files: TableView: use avatar in author cell

This commit is contained in:
Viktor Fomin 2022-03-29 11:29:53 +03:00
parent f05dadf17c
commit adb8e4e680
2 changed files with 16 additions and 11 deletions

View File

@ -1,12 +1,14 @@
import React from "react";
import { StyledText, StyledAuthorAvatar } from "./CellStyles";
import { StyledText, StyledAuthorCell } from "./CellStyles";
import Avatar from "@appserver/components/avatar";
const AuthorCell = ({ fileOwner, sideColor, item }) => {
return (
<>
<StyledAuthorAvatar
src={item.createdBy.avatarSmall}
<StyledAuthorCell>
<Avatar
source={item.createdBy.avatarSmall}
className="author-avatar-cell"
role="user"
/>
<StyledText
color={sideColor}
@ -17,7 +19,7 @@ const AuthorCell = ({ fileOwner, sideColor, item }) => {
>
{fileOwner}
</StyledText>
</>
</StyledAuthorCell>
);
};

View File

@ -6,11 +6,14 @@ const StyledText = styled(Text)`
margin-right: 12px;
`;
const StyledAuthorAvatar = styled.img`
width: 16px;
height: 16px;
margin-right: 8px;
border-radius: 20px;
const StyledAuthorCell = styled.div`
display: flex;
.author-avatar-cell {
width: 16px;
height: 16px;
margin-right: 8px;
}
`;
export { StyledText, StyledAuthorAvatar };
export { StyledText, StyledAuthorCell };