aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/timeline/TimelineInfoCard.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-04 18:14:41 +0800
committerGitHub <noreply@github.com>2020-08-04 18:14:41 +0800
commit6177e4fc237aedf62b7d6011f19f04d98c26da39 (patch)
treefe97f2ec93a81a83811f548707ac9825328c7b7e /Timeline/ClientApp/src/app/timeline/TimelineInfoCard.tsx
parentf84fc5e653d6d29add893b6d2573d04c91fd1d40 (diff)
parent09b7e1f737659d0ee75e5ac2fd5c1decf8fa15a6 (diff)
downloadtimeline-6177e4fc237aedf62b7d6011f19f04d98c26da39.tar.gz
timeline-6177e4fc237aedf62b7d6011f19f04d98c26da39.tar.bz2
timeline-6177e4fc237aedf62b7d6011f19f04d98c26da39.zip
Merge pull request #132 from crupest/refactor
Refactor a lot of things.
Diffstat (limited to 'Timeline/ClientApp/src/app/timeline/TimelineInfoCard.tsx')
-rw-r--r--Timeline/ClientApp/src/app/timeline/TimelineInfoCard.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Timeline/ClientApp/src/app/timeline/TimelineInfoCard.tsx b/Timeline/ClientApp/src/app/timeline/TimelineInfoCard.tsx
index c25b2376..ece7d38a 100644
--- a/Timeline/ClientApp/src/app/timeline/TimelineInfoCard.tsx
+++ b/Timeline/ClientApp/src/app/timeline/TimelineInfoCard.tsx
@@ -10,10 +10,11 @@ import {
import { useTranslation } from 'react-i18next';
import { fromEvent } from 'rxjs';
-import { useAvatarUrl } from '../data/user';
+import { useAvatar } from '../data/user';
import { timelineVisibilityTooltipTranslationMap } from '../data/timeline';
import { TimelineCardComponentProps } from './TimelinePageTemplateUI';
+import BlobImage from '../common/BlobImage';
export type OrdinaryTimelineManageItem = 'delete';
@@ -26,7 +27,7 @@ const TimelineInfoCard: React.FC<TimelineInfoCardProps> = (props) => {
const { t } = useTranslation();
- const avatarUrl = useAvatarUrl(props.timeline.owner.username);
+ const avatar = useAvatar(props.timeline.owner.username);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const containerRef = React.useRef<HTMLDivElement>(null!);
@@ -60,8 +61,8 @@ const TimelineInfoCard: React.FC<TimelineInfoCardProps> = (props) => {
{props.timeline.name}
</h3>
<div className="d-inline-block align-middle">
- <img
- src={avatarUrl}
+ <BlobImage
+ blob={avatar}
onLoad={notifyHeight}
className="avatar small rounded-circle"
/>