Skip to content

Commit

Permalink
chore(web): camera move in published page (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya01 authored Jun 11, 2024
1 parent 1ef4c0e commit 4a926d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/src/beta/features/PublishedVisualizer/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
isBuiltinWidget,
} from "@reearth/beta/features/Visualizer/Crust";
import { Story } from "@reearth/beta/features/Visualizer/StoryPanel";
import type { Camera } from "@reearth/beta/utils/value";
import { MapRef } from "@reearth/core";
import { config } from "@reearth/services/config";

Expand All @@ -27,6 +28,7 @@ export default (alias?: string) => {
const [data, setData] = useState<PublishedData>();
const [ready, setReady] = useState(false);
const [error, setError] = useState(false);
const [currentCamera, setCurrentCamera] = useState<Camera | undefined>(undefined);

const sceneProperty = processProperty(data?.property);
const pluginProperty = useMemo(
Expand Down Expand Up @@ -251,6 +253,8 @@ export default (alias?: string) => {
error,
engineMeta,
visualizerRef,
currentCamera,
setCurrentCamera,
};
};

Expand Down
4 changes: 4 additions & 0 deletions web/src/beta/features/PublishedVisualizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export default function Published({ alias }: Props) {
error,
engineMeta,
visualizerRef,
currentCamera,
setCurrentCamera,
} = useHooks(alias);

return error ? (
Expand All @@ -40,6 +42,8 @@ export default function Published({ alias }: Props) {
sceneProperty={sceneProperty}
pluginProperty={pluginProperty}
showStoryPanel={!!story}
currentCamera={currentCamera}
onCameraChange={setCurrentCamera}
/>
);
}

0 comments on commit 4a926d4

Please sign in to comment.