aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-04 12:29:55 +0800
committerGitHub <noreply@github.com>2020-11-04 12:29:55 +0800
commit1e9e5eb89099ffaa454635fdd7271cece757fb2d (patch)
tree1f19646ac27a3dcd4680e871f34218b85b0915d8 /FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
parentf3503b399ff7b65f363beca313c8a0c336884bec (diff)
parent1ba32f233677cad56636462b1f6552ff6e800801 (diff)
downloadtimeline-1e9e5eb89099ffaa454635fdd7271cece757fb2d.tar.gz
timeline-1e9e5eb89099ffaa454635fdd7271cece757fb2d.tar.bz2
timeline-1e9e5eb89099ffaa454635fdd7271cece757fb2d.zip
Merge pull request #165 from crupest/timeline
Redesign timeline ui.
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx')
-rw-r--r--FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx17
1 files changed, 9 insertions, 8 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
index 6c2c43c1..036577b1 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
@@ -16,7 +16,6 @@ import Timeline, {
TimelinePostInfoEx,
TimelineDeleteCallback,
} from "./Timeline";
-import TimelineTop from "./TimelineTop";
import TimelinePostEdit, { TimelinePostSendCallback } from "./TimelinePostEdit";
import { TimelineSyncStatus } from "./SyncStatusBadge";
@@ -48,13 +47,10 @@ export default function TimelinePageTemplateUI<TManageItems>(
const { t } = useTranslation();
- const bottomSpaceRef = React.useRef<HTMLDivElement | null>(null);
+ const [bottomSpaceHeight, setBottomSpaceHeight] = React.useState<number>(0);
const onPostEditHeightChange = React.useCallback((height: number): void => {
- const { current: bottomSpaceDiv } = bottomSpaceRef;
- if (bottomSpaceDiv != null) {
- bottomSpaceDiv.style.height = `${height}px`;
- }
+ setBottomSpaceHeight(height);
if (height === 0) {
const alertHost = getAlertHost();
if (alertHost != null) {
@@ -178,6 +174,9 @@ export default function TimelinePageTemplateUI<TManageItems>(
timelineBody = (
<Timeline
+ style={{
+ minHeight: `calc(100vh - 56px - ${bottomSpaceHeight}px)`,
+ }}
containerRef={timelineRef}
posts={posts}
onDelete={props.onDelete}
@@ -188,7 +187,10 @@ export default function TimelinePageTemplateUI<TManageItems>(
timelineBody = (
<>
{timelineBody}
- <div ref={bottomSpaceRef} className="flex-fix-length" />
+ <div
+ style={{ height: bottomSpaceHeight }}
+ className="flex-fix-length"
+ />
<TimelinePostEdit
className="fixed-bottom"
onPost={props.onPost}
@@ -226,7 +228,6 @@ export default function TimelinePageTemplateUI<TManageItems>(
collapse={cardCollapse}
toggleCollapse={toggleCardCollapse}
/>
- <TimelineTop height="56px" />
{timelineBody}
</>
);