react-photoswipe-gallery icon indicating copy to clipboard operation
react-photoswipe-gallery copied to clipboard

Pass `className` of `Gallery` into the `Protal`

Open mortyccp opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. I want to use the styled component library to style the Gallery but seem it's not working due to className of Gallery is not passed to the Portal

Describe the solution you'd like I would like the Gallery to accept className as props and pass to the created Portal

Describe alternatives you've considered I can style the component using global CSS.

mortyccp avatar May 27 '22 08:05 mortyccp

Hi! The Gallery component doesn't render any DOM elements. It's just a context provider. Photoswipe right before init appends its own elements to the body (by default). It can be controlled with appendToEl option, which you can pass using <Gallery options={{ appendToEl: yourElementRef.current }} /> prop.

irudoy avatar May 27 '22 08:05 irudoy

OK. I think that will work. But would be best if className is passed to slideContent .element by default at here.

mortyccp avatar May 29 '22 15:05 mortyccp