From d8a2ca7d0ad9afdd01c654bea29b2a6c2b92ff2c Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 3 Sep 2020 19:57:49 +0800 Subject: ... --- .../src/app/views/timeline/TimelineInfoCard.tsx | 29 +++------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx') diff --git a/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx b/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx index bf5c3105..9f989148 100644 --- a/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx +++ b/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx @@ -1,7 +1,6 @@ import React from "react"; import clsx from "clsx"; import { useTranslation } from "react-i18next"; -import { fromEvent } from "rxjs"; import { Dropdown, Button } from "react-bootstrap"; import { useAvatar } from "@/services/user"; @@ -17,41 +16,19 @@ export type TimelineInfoCardProps = TimelineCardComponentProps< >; const TimelineInfoCard: React.FC = (props) => { - const { onHeight, onMember, onManage } = props; + const { onMember, 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(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 ( -
+

{props.timeline.name}

- + {props.timeline.owner.nickname} @{props.timeline.owner.username} -- cgit v1.2.3