Skip to content

Commit

Permalink
chore(web): fix story page gap issue
Browse files Browse the repository at this point in the history
  • Loading branch information
KaWaite committed Sep 8, 2023
1 parent e03a0a9 commit cb09be2
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, useEffect, useMemo, useRef } from "react";
import { Fragment, useEffect, useRef } from "react";

import { InstallableStoryBlock } from "@reearth/services/api/storytellingApi/blocks";
import { styled } from "@reearth/services/theme";
Expand All @@ -8,6 +8,8 @@ import StoryPage from "../Page";

export const pagesElementId = "story-page-content";

const pageHeight = document.getElementById(pagesElementId)?.clientHeight;

export type Props = {
sceneId?: string;
storyId?: string;
Expand Down Expand Up @@ -44,11 +46,6 @@ const StoryContent: React.FC<Props> = ({
const scrollRef = useRef<number | undefined>(undefined);
const scrollTimeoutRef = useRef<NodeJS.Timeout>();

const pageHeight = useMemo(() => {
const element = document.getElementById(pagesElementId);
return element?.clientHeight;
}, []);

useEffect(() => {
const ids = pages?.map(p => p.id) as string[];
const panelContentElement = document.getElementById(pagesElementId);
Expand Down

0 comments on commit cb09be2

Please sign in to comment.