Open dannya opened 4 years ago
Set an explicit width (100%, as the demos suggest it should be) on the Gallery container element.
Add a new prop setComponentWidth (default: '100%') to the Gallery component for configuring the container element width.
setComponentWidth
'100%'
Gallery
Allowed types for this prop are string and boolean - this allows for the following customizations:
string
boolean
(no prop explicitly set) or setComponentWidth={true}: set the container width to the component default (100%).
(no prop explicitly set)
setComponentWidth={true}
100%
setComponentWidth='80%' or setComponentWidth='768px' or any valid CSS width value: set the container width to the specified value.
setComponentWidth='80%'
setComponentWidth='768px'
setComponentWidth={false}: do not set any width on the component container - this allows the consuming code to manage this itself.
setComponentWidth={false}
Update docs and tests.
Fixes: https://github.com/neptunian/react-photo-gallery/issues/140 Fixes: https://github.com/neptunian/react-photo-gallery/issues/157 Fixes: https://github.com/neptunian/react-photo-gallery/issues/166
Coverage decreased (-0.8%) to 85.762% when pulling c7b3186c6309e1dcbda3c7f9c34f18f48df5baf1 on wonderscore:fix/layout-shrinkage into 0bb8e4c4a027c021f8a5a06de71e89026596fd95 on neptunian:master.
Set an explicit width (100%, as the demos suggest it should be) on the Gallery container element.
Add a new prop
setComponentWidth
(default:'100%'
) to theGallery
component for configuring the container element width.Allowed types for this prop are
string
andboolean
- this allows for the following customizations:(no prop explicitly set)
orsetComponentWidth={true}
: set the container width to the component default (100%
).setComponentWidth='80%'
orsetComponentWidth='768px'
or any valid CSS width value: set the container width to the specified value.setComponentWidth={false}
: do not set any width on the component container - this allows the consuming code to manage this itself.Update docs and tests.
Fixes: https://github.com/neptunian/react-photo-gallery/issues/140 Fixes: https://github.com/neptunian/react-photo-gallery/issues/157 Fixes: https://github.com/neptunian/react-photo-gallery/issues/166