diff options
author | crupest <crupest@outlook.com> | 2020-08-04 18:14:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 18:14:41 +0800 |
commit | 0791682e1f333adb5c79b979e3e8c5c50bb5f85a (patch) | |
tree | 47b85b9bfb5026743a4a9984c5c24b8363e8a5af /Timeline/ClientApp/src/app/timeline/TimelineMember.tsx | |
parent | 66417650b46f27f8238cc6997e2ff14579c1244a (diff) | |
parent | 89806d334fe2c7ef0ea8b3d12c74759e8e3ba860 (diff) | |
download | timeline-0791682e1f333adb5c79b979e3e8c5c50bb5f85a.tar.gz timeline-0791682e1f333adb5c79b979e3e8c5c50bb5f85a.tar.bz2 timeline-0791682e1f333adb5c79b979e3e8c5c50bb5f85a.zip |
Merge pull request #132 from crupest/refactor
Refactor a lot of things.
Diffstat (limited to 'Timeline/ClientApp/src/app/timeline/TimelineMember.tsx')
-rw-r--r-- | Timeline/ClientApp/src/app/timeline/TimelineMember.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Timeline/ClientApp/src/app/timeline/TimelineMember.tsx b/Timeline/ClientApp/src/app/timeline/TimelineMember.tsx index 8c637f46..39af412e 100644 --- a/Timeline/ClientApp/src/app/timeline/TimelineMember.tsx +++ b/Timeline/ClientApp/src/app/timeline/TimelineMember.tsx @@ -10,9 +10,10 @@ import { Button,
} from 'reactstrap';
-import { User, useAvatarUrl } from '../data/user';
+import { User, useAvatar } from '../data/user';
import SearchInput from '../common/SearchInput';
+import BlobImage from '../common/BlobImage';
const TimelineMemberItem: React.FC<{
user: User;
@@ -21,13 +22,13 @@ const TimelineMemberItem: React.FC<{ }> = ({ user, owner, onRemove }) => {
const { t } = useTranslation();
- const avatarUrl = useAvatarUrl(user.username);
+ const avatar = useAvatar(user.username);
return (
<ListGroupItem className="container">
<Row>
<Col className="col-auto">
- <img src={avatarUrl} className="avatar small" />
+ <BlobImage blob={avatar} className="avatar small" />
</Col>
<Col>
<Row>{user.nickname}</Row>
@@ -84,7 +85,7 @@ const TimelineMember: React.FC<TimelineMemberProps> = (props) => { | { type: 'init' }
>({ type: 'init' });
- const userSearchAvatarUrl = useAvatarUrl(
+ const userSearchAvatar = useAvatar(
userSearchState.type === 'user' ? userSearchState.data.username : undefined
);
@@ -156,8 +157,8 @@ const TimelineMember: React.FC<TimelineMemberProps> = (props) => { <Container className="mb-3">
<Row>
<Col className="col-auto">
- <img
- src={userSearchAvatarUrl}
+ <BlobImage
+ blob={userSearchAvatar}
className="avatar small"
/>
</Col>
|