From f0f1984405db795d5a60bd03d05bec524dc12db3 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 31 Jul 2023 17:15:53 +0800 Subject: ... --- FrontEnd/src/pages/timeline/TimelineCard.tsx | 94 ++++++++++++++-------------- 1 file changed, 46 insertions(+), 48 deletions(-) (limited to 'FrontEnd/src/pages/timeline/TimelineCard.tsx') diff --git a/FrontEnd/src/pages/timeline/TimelineCard.tsx b/FrontEnd/src/pages/timeline/TimelineCard.tsx index bcdfa4c2..cdc8a5a7 100644 --- a/FrontEnd/src/pages/timeline/TimelineCard.tsx +++ b/FrontEnd/src/pages/timeline/TimelineCard.tsx @@ -1,15 +1,13 @@ import { useState } from "react"; -import classnames from "classnames"; import { HubConnectionState } from "@microsoft/signalr"; -import { useIsSmallScreen } from "@/utilities/hooks"; -import { timelineVisibilityTooltipTranslationMap } from "@/services/timeline"; import { useUser } from "@/services/user"; import { pushAlert } from "@/services/alert"; + import { HttpTimelineInfo } from "@/http/timeline"; import { getHttpBookmarkClient } from "@/http/bookmark"; -import { useC } from "@/views/common/common"; +import { useMobile } from "@/views/common/common"; import { useDialog } from "@/views/common/dialog"; import UserAvatar from "@/views/common/user/UserAvatar"; import PopupMenu from "@/views/common/menu/PopupMenu"; @@ -35,17 +33,18 @@ export default function TimelineCard(props: TimelinePageCardProps) { const user = useUser(); - const c = useC(); - const [collapse, setCollapse] = useState(true); const toggleCollapse = (): void => { setCollapse((o) => !o); }; - const isSmallScreen = useIsSmallScreen(); + const isMobile = useMobile(); - const { createDialogSwitch, dialog, dialogPropsMap, switchDialog } = - useDialog(["member", "property", "delete"]); + const { createDialogSwitch, dialogPropsMap } = useDialog([ + "member", + "property", + "delete", + ]); const content = (
@@ -53,25 +52,24 @@ export default function TimelineCard(props: TimelinePageCardProps) { {timeline.title} {timeline.nameV2} -
+
- {timeline.owner.nickname} - + + {timeline.owner.nickname} + + @{timeline.owner.username}
-

{timeline.description}

- - {c(timelineVisibilityTooltipTranslationMap[timeline.visibility])} - -
- {user != null ? ( +

{timeline.description}

+
+ {user && ( { getHttpBookmarkClient() [timeline.isBookmark ? "delete" : "post"]( @@ -89,13 +87,13 @@ export default function TimelineCard(props: TimelinePageCardProps) { }); }} /> - ) : null} + )} - {timeline.manageable ? ( + {timeline.manageable && ( - + - ) : null} + )}
); return ( - <> - -
+
+ + +
+ {isMobile ? ( + - - -
- {isSmallScreen ? ( - - {content} - - ) : ( -
{content}
- )} -
+ {content} + + ) : ( +
{content}
+ )} - + ); } -- cgit v1.2.3