diff options
author | crupest <crupest@outlook.com> | 2020-09-03 21:10:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-09-03 21:10:58 +0800 |
commit | 01446b3c8306112cd965eeaaa40a0ac573cc374e (patch) | |
tree | 92516444e0955624dc0bc1d9109eff46d977052d /Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx | |
parent | d8a2ca7d0ad9afdd01c654bea29b2a6c2b92ff2c (diff) | |
download | timeline-01446b3c8306112cd965eeaaa40a0ac573cc374e.tar.gz timeline-01446b3c8306112cd965eeaaa40a0ac573cc374e.tar.bz2 timeline-01446b3c8306112cd965eeaaa40a0ac573cc374e.zip |
...
Diffstat (limited to 'Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx')
-rw-r--r-- | Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx b/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx index cec81421..251e53b4 100644 --- a/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx +++ b/Timeline/ClientApp/src/app/views/user/UserInfoCard.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 { timelineVisibilityTooltipTranslationMap } from "@/services/timeline"; @@ -17,10 +16,10 @@ export type UserInfoCardProps = TimelineCardComponentProps< >; const UserInfoCard: React.FC<UserInfoCardProps> = (props) => { - const { onManage } = props; + const { onManage, timeline } = props; const { t } = useTranslation(); - const avatar = useAvatar(props.timeline.owner.username); + const avatar = useAvatar(timeline?.owner?.username); return ( <div className={clsx("rounded border bg-light p-2", props.className)}> @@ -29,14 +28,14 @@ const UserInfoCard: React.FC<UserInfoCardProps> = (props) => { className="avatar large mr-2 rounded-circle float-left" /> <div> - {props.timeline.owner.nickname} + {timeline.owner.nickname} <small className="ml-3 text-secondary"> - @{props.timeline.owner.username} + @{timeline.owner.username} </small> </div> - <p className="mb-0">{props.timeline.description}</p> + <p className="mb-0">{timeline.description}</p> <small className="mt-1 d-block"> - {t(timelineVisibilityTooltipTranslationMap[props.timeline.visibility])} + {t(timelineVisibilityTooltipTranslationMap[timeline.visibility])} </small> <div className="text-right mt-2"> {onManage != null ? ( |