(event: React.MouseEvent<HTMLButtonElement>)
| 214 | : undefined; |
| 215 | |
| 216 | const handleClick = async (event: React.MouseEvent<HTMLButtonElement>) => { |
| 217 | if (disabled) { |
| 218 | return; |
| 219 | } |
| 220 | |
| 221 | const link = networkLink(url, opts); |
| 222 | |
| 223 | event.preventDefault(); |
| 224 | |
| 225 | if (beforeOnClick) { |
| 226 | const returnVal = beforeOnClick(); |
| 227 | |
| 228 | if (isPromise(returnVal)) { |
| 229 | await returnVal; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | if (openShareDialogOnClick) { |
| 234 | const windowConfig = { |
| 235 | height: windowHeight, |
| 236 | width: windowWidth, |
| 237 | ...(windowPosition === 'windowCenter' |
| 238 | ? getBoxPositionOnWindowCenter(windowWidth, windowHeight) |
| 239 | : getBoxPositionOnScreenCenter(windowWidth, windowHeight)), |
| 240 | }; |
| 241 | |
| 242 | windowOpen(link, windowConfig, onShareWindowClose); |
| 243 | } |
| 244 | |
| 245 | if (onClick) { |
| 246 | onClick(event, link); |
| 247 | } |
| 248 | }; |
| 249 | |
| 250 | const newClassName = cx( |
| 251 | 'react-share__ShareButton', |
nothing calls this directly
no test coverage detected
searching dependent graphs…