Skip to content

Commit

Permalink
fix: click to expand on image
Browse files Browse the repository at this point in the history
  • Loading branch information
BalogunofAfrica authored and Extheoisah committed Sep 21, 2023
1 parent ef0f0e8 commit 6e402b6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/home/MediaScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box, Icon } from "@chakra-ui/react";
import Image from "next/image";
import React, { useEffect, useRef, useState } from "react";
import { BiX } from "react-icons/bi";
import HomeMediaPortal from "./HomeMediaPortal";
Expand All @@ -7,7 +8,7 @@ const MediaScreen = ({
mediaElement,
wrapperId = "home-media-viewer",
}: {
mediaElement: React.ReactNode;
mediaElement: React.JSX.Element;
wrapperId?: string;
}) => {
const [isFullScreen, setIsFullScreen] = useState(false);
Expand Down Expand Up @@ -89,9 +90,14 @@ const MediaScreen = ({
onClick={disableFullScreen}
w="100%"
h="100%"
></Box>
/>
<Box pos="absolute" maxW="100%" maxH="100%" p={4} display="flex">
{mediaElement}
{React.cloneElement<React.ComponentProps<typeof Image>>(
mediaElement,
{
width: 1000,
}
)}
</Box>
<CloseButton handleClose={disableFullScreen} />
</Box>
Expand Down

0 comments on commit 6e402b6

Please sign in to comment.