aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/user/UserInfoCard.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
commit0791682e1f333adb5c79b979e3e8c5c50bb5f85a (patch)
tree47b85b9bfb5026743a4a9984c5c24b8363e8a5af /Timeline/ClientApp/src/app/user/UserInfoCard.tsx
parent66417650b46f27f8238cc6997e2ff14579c1244a (diff)
parent89806d334fe2c7ef0ea8b3d12c74759e8e3ba860 (diff)
downloadtimeline-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/user/UserInfoCard.tsx')
-rw-r--r--Timeline/ClientApp/src/app/user/UserInfoCard.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Timeline/ClientApp/src/app/user/UserInfoCard.tsx b/Timeline/ClientApp/src/app/user/UserInfoCard.tsx
index 8b1294c4..0f321f32 100644
--- a/Timeline/ClientApp/src/app/user/UserInfoCard.tsx
+++ b/Timeline/ClientApp/src/app/user/UserInfoCard.tsx
@@ -11,9 +11,10 @@ import { useTranslation } from 'react-i18next';
import { fromEvent } from 'rxjs';
import { timelineVisibilityTooltipTranslationMap } from '../data/timeline';
-import { useAvatarUrl } from '../data/user';
+import { useAvatar } from '../data/user';
import { TimelineCardComponentProps } from '../timeline/TimelinePageTemplateUI';
+import BlobImage from '../common/BlobImage';
export type PersonalTimelineManageItem = 'avatar' | 'nickname';
@@ -25,7 +26,7 @@ const UserInfoCard: React.FC<UserInfoCardProps> = (props) => {
const { onHeight, onManage } = 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!);
@@ -55,8 +56,8 @@ const UserInfoCard: React.FC<UserInfoCardProps> = (props) => {
className={clsx('rounded border bg-light p-2', props.className)}
onTransitionEnd={notifyHeight}
>
- <img
- src={avatarUrl}
+ <BlobImage
+ blob={avatar}
onLoad={notifyHeight}
className="avatar large mr-2 mb-2 rounded-circle float-left"
/>