From 13f3769e77586a040b82454ddc83349632ce0708 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 3 Sep 2020 22:41:33 +0800 Subject: ... --- Timeline/ClientApp/src/app/index.sass | 22 ++--- .../src/app/views/timeline-common/TimelineItem.tsx | 2 +- .../timeline-common/TimelinePageTemplateUI.tsx | 43 ++++++---- .../app/views/timeline-common/timeline-common.sass | 9 +- .../src/app/views/timeline/TimelineInfoCard.tsx | 8 +- .../ClientApp/src/app/views/user/UserInfoCard.tsx | 95 ++++++++++++---------- 6 files changed, 93 insertions(+), 86 deletions(-) (limited to 'Timeline/ClientApp/src') diff --git a/Timeline/ClientApp/src/app/index.sass b/Timeline/ClientApp/src/app/index.sass index 3322e503..08e03bac 100644 --- a/Timeline/ClientApp/src/app/index.sass +++ b/Timeline/ClientApp/src/app/index.sass @@ -15,9 +15,6 @@ body small line-height: 1.2 -.width-1px - width: 1px - .flex-fix-length flex-grow: 0 flex-shrink: 0 @@ -26,27 +23,20 @@ small left: 0 top: 0 -.position-rb - right: 0 - bottom: 0 - .avatar width: 60px - -.avatar.large - width: 100px - -.avatar.small - width: 40px + &.large + width: 100px + &.small + width: 40px .mt-appbar margin-top: 56px .icon-button font-size: 1.4em - -.large-icon-button - font-size: 1.6em + &.large + font-size: 1.6em .cursor-pointer cursor: pointer diff --git a/Timeline/ClientApp/src/app/views/timeline-common/TimelineItem.tsx b/Timeline/ClientApp/src/app/views/timeline-common/TimelineItem.tsx index 09d74d3c..2b6dcd0a 100644 --- a/Timeline/ClientApp/src/app/views/timeline-common/TimelineItem.tsx +++ b/Timeline/ClientApp/src/app/views/timeline-common/TimelineItem.tsx @@ -145,7 +145,7 @@ const TimelineItem: React.FC = (props) => { > { toggleDeleteDialog(); e.stopPropagation(); diff --git a/Timeline/ClientApp/src/app/views/timeline-common/TimelinePageTemplateUI.tsx b/Timeline/ClientApp/src/app/views/timeline-common/TimelinePageTemplateUI.tsx index c2d4aeaa..58fd024b 100644 --- a/Timeline/ClientApp/src/app/views/timeline-common/TimelinePageTemplateUI.tsx +++ b/Timeline/ClientApp/src/app/views/timeline-common/TimelinePageTemplateUI.tsx @@ -18,6 +18,7 @@ import Timeline, { } from "./Timeline"; import TimelinePostEdit, { TimelinePostSendCallback } from "./TimelinePostEdit"; import { TimelineSyncStatus } from "./SyncStatusBadge"; +import clsx from "clsx"; export interface TimelineCardComponentProps { timeline: TimelineInfo; @@ -206,24 +207,30 @@ export default function TimelinePageTemplateUI( body = ( <> - { - const newState = !infoCardCollapse; - setInfoCardCollapse(newState); - if (timeline != null) { - window.localStorage.setItem( - genCardCollapseLocalStorageKey(timeline.uniqueId), - newState.toString() - ); - } - }} - /> +
+ { + const newState = !infoCardCollapse; + setInfoCardCollapse(newState); + if (timeline != null) { + window.localStorage.setItem( + genCardCollapseLocalStorageKey(timeline.uniqueId), + newState.toString() + ); + } + }} + /> +
{timelineBody} ); diff --git a/Timeline/ClientApp/src/app/views/timeline-common/timeline-common.sass b/Timeline/ClientApp/src/app/views/timeline-common/timeline-common.sass index ad024c78..3bcd4a67 100644 --- a/Timeline/ClientApp/src/app/views/timeline-common/timeline-common.sass +++ b/Timeline/ClientApp/src/app/views/timeline-common/timeline-common.sass @@ -138,14 +138,17 @@ $timeline-line-color-current: #36c2e6 vertical-align: middle margin-right: 0.6em -.timeline-info-card +.timeline-template-info-card position: sticky z-index: 1 top: 56px - margin: 0.5em + padding: 0.5em @include media-breakpoint-down(sm) - margin-bottom: 0 + padding-bottom: 0 + + &.my-collapse + float: right @include media-breakpoint-up(sm) float: right diff --git a/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx b/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx index 764910aa..9c1e7f1c 100644 --- a/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx +++ b/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx @@ -32,13 +32,7 @@ const TimelineInfoCard: React.FC = (props) => { const avatar = useAvatar(timeline?.owner?.username); return ( -
+
diff --git a/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx b/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx index 251e53b4..ac3a1361 100644 --- a/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx +++ b/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx @@ -8,6 +8,8 @@ import { useAvatar } from "@/services/user"; import BlobImage from "../common/BlobImage"; import { TimelineCardComponentProps } from "../timeline-common/TimelinePageTemplateUI"; +import SyncStatusBadge from "../timeline-common/SyncStatusBadge"; +import CollapseButton from "../timeline-common/CollapseButton"; export type PersonalTimelineManageItem = "avatar" | "nickname"; @@ -16,53 +18,64 @@ export type UserInfoCardProps = TimelineCardComponentProps< >; const UserInfoCard: React.FC = (props) => { - const { onManage, timeline } = props; + const { + timeline, + onMember, + onManage, + syncStatus, + collapse, + toggleCollapse, + } = props; const { t } = useTranslation(); const avatar = useAvatar(timeline?.owner?.username); return ( -
- -
- {timeline.owner.nickname} - - @{timeline.owner.username} - +
+
+ +
-

{timeline.description}

- - {t(timelineVisibilityTooltipTranslationMap[timeline.visibility])} - -
- {onManage != null ? ( - - - {t("timeline.manage")} - - - onManage("nickname")}> - {t("timeline.manageItem.nickname")} - - onManage("avatar")}> - {t("timeline.manageItem.avatar")} - - onManage("property")}> - {t("timeline.manageItem.property")} - - - {t("timeline.manageItem.member")} - - - - ) : ( - - )} + +
+
+ + {timeline.owner.nickname} + + @{timeline.owner.username} + +
+

{timeline.description}

+ + {t(timelineVisibilityTooltipTranslationMap[timeline.visibility])} + +
+ {onManage != null ? ( + + + {t("timeline.manage")} + + + onManage("nickname")}> + {t("timeline.manageItem.nickname")} + + onManage("avatar")}> + {t("timeline.manageItem.avatar")} + + onManage("property")}> + {t("timeline.manageItem.property")} + + + {t("timeline.manageItem.member")} + + + + ) : ( + + )} +
); -- cgit v1.2.3