2
0

LightBox.tsx 367 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 {...props.node.properties} onClick={() => setToggler(!toggler)} />
  8. <FsLightbox
  9. toggler={toggler}
  10. sources={[props.src]}
  11. />
  12. </>
  13. );
  14. };