Lightbox Full width on mobile

This commit is contained in:
DrMint 2022-03-18 14:01:25 +01:00
parent 3a381d51b5
commit d3ec784549
1 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import { useMediaMobile } from "hooks/useMediaQuery";
import { Dispatch, SetStateAction } from "react";
import Lightbox from "react-image-lightbox";
@ -13,6 +14,8 @@ export type LightBoxProps = {
export default function LightBox(props: LightBoxProps): JSX.Element {
const { state, setState, images, index, setIndex } = props;
const mobile = useMediaMobile();
return (
<>
{state && (
@ -28,7 +31,7 @@ export default function LightBox(props: LightBoxProps): JSX.Element {
imageCaption=""
imageTitle=""
onCloseRequest={() => setState(false)}
imagePadding={50}
imagePadding={mobile ? 0 : 70}
/>
)}
</>