File tree 1 file changed +19
-3
lines changed
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -140,14 +140,30 @@ augmentations are applied before the lightbox starts rendering.
140
140
141
141
For example, you can add a toolbar button using the following augmentation:
142
142
143
- ``` jsx
144
- import { addToolbarButton } from " yet-another-react-lightbox" ;
143
+ ``` tsx
144
+ import { addToolbarButton , IconButton } from " yet-another-react-lightbox" ;
145
+
146
+ declare module " yet-another-react-lightbox" {
147
+ interface Labels {
148
+ " My button" ? : string ;
149
+ }
150
+ }
145
151
146
152
// ...
147
153
148
154
function MyPlugin({ augment }) {
149
155
augment (({ toolbar , ... restProps }) => ({
150
- toolbar: addToolbarButton (toolbar, " my-button" , < MyButton / > ),
156
+ toolbar: addToolbarButton (
157
+ toolbar ,
158
+ " my-button" ,
159
+ <IconButton
160
+ icon = { MyIcon }
161
+ label = " My button"
162
+ onClick = { () => {
163
+ // ...
164
+ }}
165
+ />,
166
+ ),
151
167
... restProps ,
152
168
}));
153
169
}
You can’t perform that action at this time.
0 commit comments