Skip to content

Commit

Permalink
docs(sdk,main-button): refactor the code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
heyqbnk committed Oct 1, 2024
1 parent 1149a12 commit 1fdcff0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions apps/docs/packages/telegram-apps-sdk/2-x/components/main-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ properties. To do so, use the `mount` method. It will update the `isMounted` sig
```ts [Variable]
import { mainButton } from '@telegram-apps/sdk';

mainButton.mount(); // mainButton.isMounted() -> true
mainButton.mount();
mainButton.isMounted(); // true
```

```ts [Functions]
import {
mountMainButton,
isMainButtonMounted,
} from '@telegram-apps/sdk';
import { mountMainButton, isMainButtonMounted } from '@telegram-apps/sdk';

mountMainButton(); // isMainButtonMounted() -> true
mountMainButton();
isMainButtonMounted(); // true
```

:::
Expand All @@ -32,13 +31,15 @@ To unmount, use the `unmount` method:
::: code-group

```ts [Variable]
mainButton.unmount(); // mainButton.isMounted() -> false
mainButton.unmount();
mainButton.isMounted(); // false
```

```ts [Functions]
import { unmountMainButton } from '@telegram-apps/sdk';
import { unmountMainButton, isMainButtonMounted } from '@telegram-apps/sdk';

unmountMainButton(); // isMainButtonMounted() -> false
unmountMainButton();
isMainButtonMounted(); // false
```

:::
Expand Down

0 comments on commit 1fdcff0

Please sign in to comment.