Skip to content

Commit

Permalink
docs(sdk): add shine effect information in Main Button
Browse files Browse the repository at this point in the history
heyqbnk committed Oct 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d759840 commit 1905781
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/docs/packages/telegram-apps-sdk/2-x/components/main-button.md
Original file line number Diff line number Diff line change
@@ -52,21 +52,24 @@ unmountMainButton(); // isMainButtonMounted() -> false
To update the button properties, use the `setParams` method. It accepts an object with optional
properties, each responsible for its own button trait.

In turn, calling this method updates such signals as `backgroundColor`,`isVisible`, `isEnabled`,
`isLoaderVisible`, `state`, `textColor` and `text`.
In turn, calling this method updates such signals
as `backgroundColor`, `hasShineEffect`, `isVisible`, `isEnabled`, `isLoaderVisible`, `state`, `textColor`
and `text`.

::: code-group

```ts [Variable]
mainButton.setParams({
backgroundColor: '#000000',
hasShineEffect: true,
isEnabled: true,
isLoaderVisible: true,
isVisible: true,
text: 'My text',
textColor: '#ffffff'
});
mainButton.backgroundColor(); // '#000000'
mainButton.hasShineEffect(); // true
mainButton.isEnabled(); // true
mainButton.isLoaderVisible(); // true
mainButton.isVisible(); // true
@@ -76,6 +79,7 @@ mainButton.textColor(); // '#ffffff'
mainButton.state();
// {
// backgroundColor: '#000000',
// hasShineEffect: true,
// isActive: true,
// isLoaderVisible: true,
// isVisible: true,
@@ -88,6 +92,7 @@ mainButton.state();
import {
setMainButtonParams,
mainButtonBackgroundColor,
mainButtonHasShineEffect,
isMainButtonVisible,
isMainButtonEnabled,
isMainButtonLoaderVisible,
@@ -98,13 +103,15 @@ import {

setMainButtonParams({
backgroundColor: '#000000',
hasShineEffect: true,
isEnabled: true,
isLoaderVisible: true,
isVisible: true,
text: 'My text',
textColor: '#ffffff'
});
mainButtonBackgroundColor(); // '#000000'
mainButtonHasShineEffect(); // true
isMainButtonEnabled(); // true
isMainButtonLoaderVisible(); // true
isMainButtonVisible(); // true
@@ -114,6 +121,7 @@ mainButtonTextColor(); // '#ffffff'
mainButtonState();
// {
// backgroundColor: '#000000',
// hasShineEffect: true,
// isActive: true,
// isLoaderVisible: true,
// isVisible: true,

0 comments on commit 1905781

Please sign in to comment.