From e8b4a4c00d559ed5a11cb14f75fd11f13c6eeab9 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 1 Mar 2025 17:59:24 +0100 Subject: [PATCH] Modal Stars Balance Block: Support add stars button (#5624) --- src/components/modals/gift/GiftModal.tsx | 3 +- .../PaidReactionModal.module.scss | 8 +++++ .../modals/paidReaction/PaidReactionModal.tsx | 8 +++-- src/components/modals/stars/BalanceBlock.tsx | 34 +++++++++++++++---- .../stars/StarsBalanceModal.module.scss | 29 +++++++++++++++- 5 files changed, 72 insertions(+), 10 deletions(-) diff --git a/src/components/modals/gift/GiftModal.tsx b/src/components/modals/gift/GiftModal.tsx index 0ad13cb7e..f629fceb0 100644 --- a/src/components/modals/gift/GiftModal.tsx +++ b/src/components/modals/gift/GiftModal.tsx @@ -285,6 +285,7 @@ const PremiumGiftModal: FC = ({ isSlim contentClassName={styles.content} className={buildClassName(styles.modalDialog, styles.root)} + isLowStackPriority > - +
-
+
{sendAsPeersMenu} -
+
+ +
+ { +const BalanceBlock = ({ balance, className, withAddButton }: OwnProps) => { const lang = useLang(); + const { + openStarsBalanceModal, + } = getActions(); + return ( -
- {lang('StarsBalance')} -
- - {balance !== undefined ? formatStarsAmount(lang, balance) : '…'} +
+
+ {lang('StarsBalance')} +
+ + {balance !== undefined ? formatStarsAmount(lang, balance) : '…'} + {withAddButton && ( + openStarsBalanceModal({})} + > + + + )} +
); diff --git a/src/components/modals/stars/StarsBalanceModal.module.scss b/src/components/modals/stars/StarsBalanceModal.module.scss index 94f4014c9..702eb9753 100644 --- a/src/components/modals/stars/StarsBalanceModal.module.scss +++ b/src/components/modals/stars/StarsBalanceModal.module.scss @@ -128,7 +128,34 @@ z-index: 3; } -.balance { +.addStarsButton { + width: 1rem; + height: 1rem; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + + transition: opacity 0.15s; + opacity: 1; + + &:hover, + &:active { + opacity: 0.75; + } +} + +.addStarsIcon { + font-size: 0.75rem !important; +} + +.balanceBlock { + display: flex; + align-items: center; +} + +.balanceInfo { display: flex; flex-direction: column; align-items: flex-end;