File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ import type {GalleryItemProps} from '../../components';
55export type GalleryContextType = {
66 openGallery : ( items : GalleryItemProps [ ] , initialFileIndex ?: number ) => void ;
77 closeGallery : ( ) => void ;
8+ open : boolean ;
89} ;
910
1011export const GalleryContext = React . createContext < GalleryContextType > ( {
1112 openGallery : ( ) => { } ,
1213 closeGallery : ( ) => { } ,
14+ open : false ,
1315} ) ;
Original file line number Diff line number Diff line change @@ -40,8 +40,9 @@ export const GalleryProvider = ({
4040 closeGallery : ( ) => {
4141 setIsOpen ( false ) ;
4242 } ,
43+ open : isOpen ,
4344 } ) ,
44- [ ] ,
45+ [ isOpen ] ,
4546 ) ;
4647
4748 return (
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ _useGallery hook returns_:
4949| :----------- | :--------------------------------------------------------- | :----------------------------------- |
5050| openGallery | ` (items: GalleryItem[], initialItemIndex: number) => void ` | The function for opening the gallery |
5151| closeGallery | ` () => void ` | The function for closing the gallery |
52+ | open | ` boolean ` | The boolean value of gallery state |
5253
5354_ openGallery function args_ :
5455
You can’t perform that action at this time.
0 commit comments