Skip to content

Commit

Permalink
chore(web): missing prop currentCamera for story built-in blocks (#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
airslice authored Jun 7, 2024
1 parent 95c817c commit 1ef4c0e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion web/src/beta/features/Visualizer/StoryPanel/Page/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Fragment, MutableRefObject, ReactNode, useEffect } from "react";

import DragAndDropList from "@reearth/beta/components/DragAndDropList";
import type { ValueType, ValueTypes } from "@reearth/beta/utils/value";
import type { Camera, ValueType, ValueTypes } from "@reearth/beta/utils/value";
import type { InstallableStoryBlock } from "@reearth/services/api/storytellingApi/blocks";
import { useT } from "@reearth/services/i18n";
import { styled } from "@reearth/services/theme";
Expand Down Expand Up @@ -29,6 +29,7 @@ type Props = {
isEditable?: boolean;
isAutoScrolling?: MutableRefObject<boolean>;
scrollTimeoutRef: MutableRefObject<NodeJS.Timeout | undefined>;
currentCamera?: Camera;
children?: ReactNode;
onCurrentPageChange?: (pageId: string, disableScrollIntoView?: boolean) => void;
onPageSettingsToggle?: () => void;
Expand Down Expand Up @@ -73,6 +74,7 @@ const StoryPanel: React.FC<Props> = ({
isEditable,
scrollTimeoutRef,
isAutoScrolling,
currentCamera,
children,
onCurrentPageChange,
onPageSettingsToggle,
Expand Down Expand Up @@ -175,6 +177,7 @@ const StoryPanel: React.FC<Props> = ({
}}
isEditable={isEditable}
isSelected={selectedStoryBlockId === titleId}
currentCamera={currentCamera}
onClick={() => onBlockSelect?.(titleId)}
onBlockDoubleClick={() => onBlockDoubleClick?.(titleId)}
onClickAway={onBlockSelect}
Expand Down Expand Up @@ -224,6 +227,7 @@ const StoryPanel: React.FC<Props> = ({
pageId={page?.id}
isSelected={selectedStoryBlockId === b.id}
isEditable={isEditable}
currentCamera={currentCamera}
onClick={() => onBlockSelect?.(b.id)}
onBlockDoubleClick={() => onBlockDoubleClick?.(b.id)}
onClickAway={onBlockSelect}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MutableRefObject } from "react";

import { ValueType, ValueTypes } from "@reearth/beta/utils/value";
import { Camera, ValueType, ValueTypes } from "@reearth/beta/utils/value";
import type { InstallableStoryBlock } from "@reearth/services/api/storytellingApi/blocks";
import { styled } from "@reearth/services/theme";

Expand All @@ -17,6 +17,7 @@ export type Props = {
showingIndicator?: boolean;
isAutoScrolling?: MutableRefObject<boolean>;
isEditable?: boolean;
currentCamera?: Camera;
onPageSettingsToggle?: () => void;
onPageSelect?: (pageId?: string | undefined) => void;
onCurrentPageChange?: (pageId: string, disableScrollIntoView?: boolean) => void;
Expand Down Expand Up @@ -61,6 +62,7 @@ const StoryContent: React.FC<Props> = ({
showingIndicator,
isAutoScrolling,
isEditable,
currentCamera,
onPageSettingsToggle,
onPageSelect,
onCurrentPageChange,
Expand Down Expand Up @@ -94,6 +96,7 @@ const StoryContent: React.FC<Props> = ({
selectedStoryBlockId={selectedStoryBlockId}
showPageSettings={showPageSettings}
isEditable={isEditable}
currentCamera={currentCamera}
scrollTimeoutRef={scrollTimeoutRef}
isAutoScrolling={isAutoScrolling}
onCurrentPageChange={onCurrentPageChange}
Expand Down
5 changes: 4 additions & 1 deletion web/src/beta/features/Visualizer/StoryPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { forwardRef, memo, Ref, RefObject, useMemo } from "react";
import { createPortal } from "react-dom";

import { ValueType, ValueTypes } from "@reearth/beta/utils/value";
import { Camera, ValueType, ValueTypes } from "@reearth/beta/utils/value";
import { styled } from "@reearth/services/theme";

import { BlockProvider } from "../shared/contexts/blockContext";
Expand All @@ -25,6 +25,7 @@ export type StoryPanelProps = {
selectedStory?: Story;
isEditable?: boolean;
installableStoryBlocks?: InstallableStoryBlock[];
currentCamera?: Camera;
onStoryPageChange?: (id?: string, disableScrollIntoView?: boolean) => void;
onStoryBlockCreate?: (
pageId?: string | undefined,
Expand Down Expand Up @@ -64,6 +65,7 @@ export const StoryPanel = memo(
selectedStory,
isEditable,
installableStoryBlocks,
currentCamera,
onStoryPageChange,
onStoryBlockCreate,
onStoryBlockMove,
Expand Down Expand Up @@ -157,6 +159,7 @@ export const StoryPanel = memo(
showingIndicator={!!pageInfo}
isAutoScrolling={isAutoScrolling}
isEditable={isEditable}
currentCamera={currentCamera}
onPageSettingsToggle={handlePageSettingsToggle}
onPageSelect={handlePageSelect}
onCurrentPageChange={handleCurrentPageChange}
Expand Down
1 change: 1 addition & 0 deletions web/src/beta/features/Visualizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const Visualizer: FC<VisualizerProps> = ({
selectedStory={story}
installableStoryBlocks={installableStoryBlocks}
isEditable={!!inEditor}
currentCamera={currentCamera}
onStoryPageChange={handleStoryPageChange}
onStoryBlockCreate={handleStoryBlockCreate}
onStoryBlockDelete={handleStoryBlockDelete}
Expand Down

0 comments on commit 1ef4c0e

Please sign in to comment.