| 134 | } |
| 135 | |
| 136 | export interface Props<LinkOptions> extends NativeButtonProps { |
| 137 | /** |
| 138 | * Takes a function that returns a Promise to be fulfilled before calling |
| 139 | * `onClick`. If you do not return promise, `onClick` is called immediately. |
| 140 | */ |
| 141 | beforeOnClick?: () => Promise<void> | void; |
| 142 | children: React.ReactNode; |
| 143 | className?: string; |
| 144 | /** Disables click action and adds `disabled` class */ |
| 145 | disabled?: boolean; |
| 146 | /** |
| 147 | * Style when button is disabled |
| 148 | * @default { opacity: 0.6 } |
| 149 | */ |
| 150 | disabledStyle?: React.CSSProperties; |
| 151 | forwardedRef?: React.Ref<HTMLButtonElement>; |
| 152 | /** |
| 153 | * Passes as the native `title` attribute for the `button` element. |
| 154 | * This uses `htmlTitle` instead of `title` because many share buttons |
| 155 | * already use `title` for the share payload sent to the target network. |
| 156 | */ |
| 157 | htmlTitle?: HTMLButtonElement['title']; |
| 158 | networkName: string; |
| 159 | networkLink: NetworkLink<LinkOptions>; |
| 160 | onClick?: (event: React.MouseEvent<HTMLButtonElement>, link: string) => void; |
| 161 | /** |
| 162 | * Takes a function to be called after closing share dialog. |
| 163 | */ |
| 164 | onShareWindowClose?: () => void; |
| 165 | openShareDialogOnClick?: boolean; |
| 166 | opts: LinkOptions; |
| 167 | resetButtonStyle?: boolean; |
| 168 | /** |
| 169 | * URL of the shared page |
| 170 | */ |
| 171 | url: string; |
| 172 | style?: React.CSSProperties; |
| 173 | windowWidth?: number; |
| 174 | windowHeight?: number; |
| 175 | windowPosition?: WindowPosition; |
| 176 | } |
| 177 | |
| 178 | export type ShareButtonProps<LinkOptions extends Record<string, unknown>> = Omit< |
| 179 | Props<LinkOptions>, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…