Skip to content

Commit e9e6e80

Browse files
committed
2 parents 067b8fa + c8f3542 commit e9e6e80

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/pages/home/Home.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export default function Home() {
1616
setIsVisible(true);
1717
};
1818

19+
const handleClose = () => {
20+
setIsVisible(false);
21+
zoomOutRef.current?.();
22+
};
23+
1924
useEffect(() => {
2025
if (!canvasRef.current) return;
2126
const { zoomOut } = main(canvasRef.current, handleOpen);
@@ -24,14 +29,13 @@ export default function Home() {
2429

2530
return (
2631
<div>
27-
2832
<section className="relative w-full h-screen">
2933
{isVisible && (
3034

3135
<div className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[90vw] h-[90vh] z-50">
3236
<LevelComponent
3337
key={mountKey}
34-
onClose={() => setIsVisible(false)}
38+
onClose={() => handleClose()}
3539
lvl={lvlNum}
3640
/>
3741
</div>

0 commit comments

Comments
 (0)