diff options
author | crupest <crupest@outlook.com> | 2020-09-03 19:57:49 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-09-03 19:57:49 +0800 |
commit | 4b529fc9f11b84161b9a1fc9e12b8116debce4e9 (patch) | |
tree | 1c7ea7072ad08a575f48daa9a416cc9d5e746ee5 /Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx | |
parent | 47677c0bcc3ef8c582fb212b473d2aad1abd7132 (diff) | |
download | timeline-4b529fc9f11b84161b9a1fc9e12b8116debce4e9.tar.gz timeline-4b529fc9f11b84161b9a1fc9e12b8116debce4e9.tar.bz2 timeline-4b529fc9f11b84161b9a1fc9e12b8116debce4e9.zip |
...
Diffstat (limited to 'Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx')
-rw-r--r-- | Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx b/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx index f1878b5c..cec81421 100644 --- a/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx +++ b/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx @@ -17,34 +17,15 @@ export type UserInfoCardProps = TimelineCardComponentProps< >; const UserInfoCard: React.FC<UserInfoCardProps> = (props) => { - const { onHeight, onManage } = props; + const { onManage } = props; const { t } = useTranslation(); const avatar = useAvatar(props.timeline.owner.username); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const containerRef = React.useRef<HTMLDivElement>(null!); - - const notifyHeight = React.useCallback((): void => { - if (onHeight) { - onHeight(containerRef.current.getBoundingClientRect().height); - } - }, [onHeight]); - - React.useEffect(() => { - const subscription = fromEvent(window, "resize").subscribe(notifyHeight); - return () => subscription.unsubscribe(); - }); - return ( - <div - ref={containerRef} - className={clsx("rounded border bg-light p-2 clearfix", props.className)} - onTransitionEnd={notifyHeight} - > + <div className={clsx("rounded border bg-light p-2", props.className)}> <BlobImage blob={avatar} - onLoad={notifyHeight} className="avatar large mr-2 rounded-circle float-left" /> <div> |