From 7cefd5566a48a45ef9ecb67b881c7c8312abb08f Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 2 Oct 2020 00:12:33 +0800 Subject: ... --- .../src/app/views/timeline-common/CollapseCard.tsx | 28 ---------------- .../app/views/timeline-common/InfoCardTemplate.tsx | 8 ++--- .../src/app/views/timeline-common/TimelineItem.tsx | 14 ++++---- .../timeline-common/TimelinePageTemplateUI.tsx | 38 +++++++--------------- .../src/app/views/timeline-common/TimelineTop.tsx | 13 +++++--- .../app/views/timeline-common/timeline-common.sass | 25 +++++++------- .../src/app/views/timeline/TimelineInfoCard.tsx | 10 +++++- .../ClientApp/src/app/views/user/UserInfoCard.tsx | 10 +++++- 8 files changed, 62 insertions(+), 84 deletions(-) delete mode 100644 Timeline/ClientApp/src/app/views/timeline-common/CollapseCard.tsx (limited to 'Timeline/ClientApp/src') diff --git a/Timeline/ClientApp/src/app/views/timeline-common/CollapseCard.tsx b/Timeline/ClientApp/src/app/views/timeline-common/CollapseCard.tsx deleted file mode 100644 index 1c233058..00000000 --- a/Timeline/ClientApp/src/app/views/timeline-common/CollapseCard.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from "react"; -import clsx from "clsx"; - -import SyncStatusBadge, { - TimelineSyncStatus, -} from "../timeline-common/SyncStatusBadge"; -import CollapseButton from "../timeline-common/CollapseButton"; - -const CollapseCard: React.FC<{ - className?: string; - syncStatus: TimelineSyncStatus; - toggleCollapse: () => void; - visible: boolean; -}> = ({ className, syncStatus, toggleCollapse, visible }) => { - return ( -
-
- - -
-
- ); -}; - -export default CollapseCard; diff --git a/Timeline/ClientApp/src/app/views/timeline-common/InfoCardTemplate.tsx b/Timeline/ClientApp/src/app/views/timeline-common/InfoCardTemplate.tsx index a5166aa4..a8de20aa 100644 --- a/Timeline/ClientApp/src/app/views/timeline-common/InfoCardTemplate.tsx +++ b/Timeline/ClientApp/src/app/views/timeline-common/InfoCardTemplate.tsx @@ -8,17 +8,17 @@ import CollapseButton from "../timeline-common/CollapseButton"; const InfoCardTemplate: React.FC< Pick< TimelineCardComponentProps<"">, - "toggleCollapse" | "syncStatus" | "className" + "collapse" | "toggleCollapse" | "syncStatus" | "className" > & { children: React.ReactElement[] } -> = ({ toggleCollapse, syncStatus, className, children }) => { +> = ({ collapse, toggleCollapse, syncStatus, className, children }) => { return (
- +
-
{children}
+
{children}
); }; diff --git a/Timeline/ClientApp/src/app/views/timeline-common/TimelineItem.tsx b/Timeline/ClientApp/src/app/views/timeline-common/TimelineItem.tsx index 2b6dcd0a..327b6833 100644 --- a/Timeline/ClientApp/src/app/views/timeline-common/TimelineItem.tsx +++ b/Timeline/ClientApp/src/app/views/timeline-common/TimelineItem.tsx @@ -83,13 +83,15 @@ const TimelineItem: React.FC = (props) => { onClick={props.onClick} style={props.style} > -
-
-
-
+
+
+
+
+
+
+
+ {current &&
}
-
- {current &&
}
diff --git a/Timeline/ClientApp/src/app/views/timeline-common/TimelinePageTemplateUI.tsx b/Timeline/ClientApp/src/app/views/timeline-common/TimelinePageTemplateUI.tsx index ef13fa50..e1938656 100644 --- a/Timeline/ClientApp/src/app/views/timeline-common/TimelinePageTemplateUI.tsx +++ b/Timeline/ClientApp/src/app/views/timeline-common/TimelinePageTemplateUI.tsx @@ -17,16 +17,15 @@ import Timeline, { TimelineDeleteCallback, } from "./Timeline"; import TimelineTop from "./TimelineTop"; -import CollapseCard from "./CollapseCard"; import TimelinePostEdit, { TimelinePostSendCallback } from "./TimelinePostEdit"; import { TimelineSyncStatus } from "./SyncStatusBadge"; -import clsx from "clsx"; export interface TimelineCardComponentProps { timeline: TimelineInfo; onManage?: (item: TManageItems | "property") => void; onMember: () => void; className?: string; + collapse: boolean; syncStatus: TimelineSyncStatus; toggleCollapse: () => void; } @@ -219,31 +218,16 @@ export default function TimelinePageTemplateUI( body = ( <> - -
- - -
-
+ + {timelineBody} ); diff --git a/Timeline/ClientApp/src/app/views/timeline-common/TimelineTop.tsx b/Timeline/ClientApp/src/app/views/timeline-common/TimelineTop.tsx index a98d3687..93a2a32c 100644 --- a/Timeline/ClientApp/src/app/views/timeline-common/TimelineTop.tsx +++ b/Timeline/ClientApp/src/app/views/timeline-common/TimelineTop.tsx @@ -1,14 +1,17 @@ import React from "react"; export interface TimelineTopProps { - children: React.ReactElement; + height?: number | string; + children?: React.ReactElement; } -const TimelineTop: React.FC = ({ children }) => { +const TimelineTop: React.FC = ({ height, children }) => { return ( -
-
-
+
+
+
+
+
{children}
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 aa3544fe..4151bfcc 100644 --- a/Timeline/ClientApp/src/app/views/timeline-common/timeline-common.sass +++ b/Timeline/ClientApp/src/app/views/timeline-common/timeline-common.sass @@ -29,19 +29,26 @@ $timeline-line-color-current: #36c2e6 box-shadow: 0 0 20px 3px color.adjust($timeline-line-color-current, $lightness: +10%, $alpha: -0.1) .timeline-line + &-area-container + display: flex + justify-content: flex-end + padding-right: 5px + + flex: 0 0 auto + width: 60px + &-area display: flex flex-direction: column align-items: center - flex: 0 0 auto - width: 60px + width: 30px &-segment width: $timeline-line-width background: $timeline-line-color &.start - height: 20px + height: 14px flex: 0 0 auto &.end @@ -131,15 +138,9 @@ $timeline-line-color-current: #36c2e6 vertical-align: middle margin-right: 0.6em -.timeline-template-card-container - position: sticky +.timeline-template-card + position: fixed z-index: 1 top: 56px - margin: 0.5em - -.timeline-template-card - width: 360px - max-width: calc(100vw - 1em) - position: absolute - top: 0 right: 0 + margin: 0.5em diff --git a/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx b/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx index 6966ab41..2d787709 100644 --- a/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx +++ b/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx @@ -16,7 +16,14 @@ export type TimelineInfoCardProps = TimelineCardComponentProps< >; const TimelineInfoCard: React.FC = (props) => { - const { timeline, onMember, onManage, syncStatus, toggleCollapse } = props; + const { + timeline, + collapse, + onMember, + onManage, + syncStatus, + toggleCollapse, + } = props; const { t } = useTranslation(); @@ -26,6 +33,7 @@ const TimelineInfoCard: React.FC = (props) => {

diff --git a/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx b/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx index bad2a9e1..888fb18a 100644 --- a/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx +++ b/Timeline/ClientApp/src/app/views/user/UserInfoCard.tsx @@ -16,7 +16,14 @@ export type UserInfoCardProps = TimelineCardComponentProps< >; const UserInfoCard: React.FC = (props) => { - const { timeline, onMember, onManage, syncStatus, toggleCollapse } = props; + const { + timeline, + collapse, + onMember, + onManage, + syncStatus, + toggleCollapse, + } = props; const { t } = useTranslation(); const avatar = useAvatar(timeline?.owner?.username); @@ -25,6 +32,7 @@ const UserInfoCard: React.FC = (props) => {
-- cgit v1.2.3