From d33fce46b1c5fdb39fa557ce468ee9b19e88b381 Mon Sep 17 00:00:00 2001 From: Alex Frantz Date: Fri, 7 Nov 2025 01:47:18 -0500 Subject: [PATCH] fix weird overlay --- src/components/Overlay.tsx | 4 +-- src/components/modules/PictureCarousel.tsx | 40 +++++++--------------- src/pages/App.tsx | 20 +++++++++-- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/components/Overlay.tsx b/src/components/Overlay.tsx index c4f2cd7..a9403cc 100644 --- a/src/components/Overlay.tsx +++ b/src/components/Overlay.tsx @@ -10,9 +10,9 @@ export default function Overlay({ return (
-
{children}
+ {children}
); } diff --git a/src/components/modules/PictureCarousel.tsx b/src/components/modules/PictureCarousel.tsx index 9945511..17836e8 100644 --- a/src/components/modules/PictureCarousel.tsx +++ b/src/components/modules/PictureCarousel.tsx @@ -1,5 +1,3 @@ -import { useState } from "react"; -import Overlay from "../Overlay"; import Picture from "../Picture"; const images = [ @@ -10,34 +8,22 @@ const images = [ "https://storage.alexav.gg/content/2f36c1dd-eaf8-4fd3-a3cd-1d25fe8f5a07.jpg", ]; -export default function PictureCarousel() { - const [selectedImage, setSelectedImage] = useState(""); - +export default function PictureCarousel({ + onClick, +}: { + onClick: (url: string) => void; +}) { return ( - <> - {selectedImage !== "" && ( - setSelectedImage("")}> - - - )} +
+

pictures

-
-

pictures

- -
-
- {images.map((v, k) => { - return ( - setSelectedImage(v)} - /> - ); - })} -
+
+
+ {images.map((v, k) => { + return onClick(v)} />; + })}
- +
); } diff --git a/src/pages/App.tsx b/src/pages/App.tsx index a92b471..812776c 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -1,4 +1,6 @@ +import { useState } from "react"; import Layout from "../components/Layout"; +import Overlay from "../components/Overlay"; import MusicComponent from "../components/MusicComponent"; import TVComponent from "../components/TVComponent"; import GameComponent from "../components/GameComponent"; @@ -6,14 +8,28 @@ import FantasyStatus from "../components/FantasyStatus"; import PictureCarousel from "../components/modules/PictureCarousel"; export default function App() { + const [selectedImage, setSelectedImage] = useState(""); + return ( + {selectedImage !== "" && ( + setSelectedImage("")}> + + + )} +
+ setSelectedImage(url)} /> +

welcome to my site !

- -