LightBox.tsx 371 B

12345678910111213141516
  1. import React, { useState } from 'react';
  2. import FsLightbox from 'fslightbox-react';
  3. export const LightBox = (props) => {
  4. const [toggler, setToggler] = useState(false);
  5. return (
  6. <>
  7. <img src={props.src} alt={props.alt} onClick={() => setToggler(!toggler)}/>
  8. <FsLightbox
  9. toggler={toggler}
  10. sources={[props.src]}
  11. />
  12. </>
  13. );
  14. };