Skip to content

Commit

Permalink
docs: add disabled flag for the main button
Browse files Browse the repository at this point in the history
  • Loading branch information
LowderPlay committed Dec 1, 2023
1 parent 670fdc5 commit 61d4b4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,13 @@ _Returns:_
```ts
import useTelegramMainButton from "./useTelegramMainButton";

useTelegramMainButton(onClick: () => boolean, text: string): void
useTelegramMainButton(onClick: () => boolean, text: string, disabled: boolean = false): void
```
_Params:_
* `onClick` is a callback that is executed when user presses the button.
If the callback returns true, the button will be hidden.
* `text` is a string which contains the text that should be displayed on the button.
* `disabled` (default `false`) is a boolean flag that indicates, whether the button should be disabled or not.

This hook shows a main button and adds the callback as the listener for clicks.
The button is automatically hidden if the component using this hook is disposed.
Expand Down

0 comments on commit 61d4b4d

Please sign in to comment.