aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-09-03 19:57:49 +0800
committercrupest <crupest@outlook.com>2020-09-03 19:57:49 +0800
commitd8a2ca7d0ad9afdd01c654bea29b2a6c2b92ff2c (patch)
tree05a7a1ceee83be0409ad7f9de4932e46306ef3d5 /Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx
parent7d70d0270b5a070b754bca8e1d740c86fd9ac48d (diff)
downloadtimeline-d8a2ca7d0ad9afdd01c654bea29b2a6c2b92ff2c.tar.gz
timeline-d8a2ca7d0ad9afdd01c654bea29b2a6c2b92ff2c.tar.bz2
timeline-d8a2ca7d0ad9afdd01c654bea29b2a6c2b92ff2c.zip
...
Diffstat (limited to 'Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx')
-rw-r--r--Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx23
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>