From e8302b134e915698b223c0639ec1b2f5566f613e Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sun, 20 Oct 2024 18:53:58 +0200 Subject: [PATCH] Telegram Stars: Fix bugs in Stars Gifting Modal (#5046) --- .../main/premium/StarsGiftModal.module.scss | 1 - .../main/premium/StarsGiftModal.tsx | 20 +++++++------------ .../modals/stars/StarTopupOptionList.tsx | 4 +--- .../stars/StarsBalanceModal.module.scss | 6 ++++-- .../modals/stars/StarsBalanceModal.tsx | 1 + src/components/payment/PaymentModal.scss | 6 +++++- src/components/ui/TabList.tsx | 4 +++- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/main/premium/StarsGiftModal.module.scss b/src/components/main/premium/StarsGiftModal.module.scss index e0a863189..ed16e46db 100644 --- a/src/components/main/premium/StarsGiftModal.module.scss +++ b/src/components/main/premium/StarsGiftModal.module.scss @@ -9,7 +9,6 @@ } .root :global(.modal-dialog) { - height: min(calc(55vh + 41px + 193px), 90vh); max-width: 26.25rem; overflow: hidden; } diff --git a/src/components/main/premium/StarsGiftModal.tsx b/src/components/main/premium/StarsGiftModal.tsx index e61c4486e..ed5692a9a 100644 --- a/src/components/main/premium/StarsGiftModal.tsx +++ b/src/components/main/premium/StarsGiftModal.tsx @@ -130,18 +130,7 @@ const StarsGiftModal: FC = ({ return user ? oldLang('GiftStarsTitle') : oldLang('Star.List.GetStars'); } - function renderStarOptionList() { - return ( - - ); - } - const bottomText = useMemo(() => { - if (!isOpen) return undefined; - const text = oldLang('lng_credits_summary_options_about'); const parts = text.split('{link}'); return [ @@ -149,7 +138,7 @@ const StarsGiftModal: FC = ({ , parts[1], ]; - }, [isOpen, oldLang]); + }, [oldLang]); return ( = ({ ) : oldLang('Stars.Purchase.GetStarsInfo')}

- {renderStarOptionList()} + {starsGiftOptions && ( + + )}
{bottomText}
diff --git a/src/components/modals/stars/StarTopupOptionList.tsx b/src/components/modals/stars/StarTopupOptionList.tsx index c165ab6ea..47b8757ca 100644 --- a/src/components/modals/stars/StarTopupOptionList.tsx +++ b/src/components/modals/stars/StarTopupOptionList.tsx @@ -53,9 +53,7 @@ const StarTopupOptionList: FC = ({ }, [isActive]); const [renderingOptions, canExtend] = useMemo(() => { - if (!options) { - return [undefined, false]; - } + if (!options) return [undefined, false]; const maxOption = options.reduce((max, option) => ( max.stars > option.stars ? max : option diff --git a/src/components/modals/stars/StarsBalanceModal.module.scss b/src/components/modals/stars/StarsBalanceModal.module.scss index 943e28487..a8701f993 100644 --- a/src/components/modals/stars/StarsBalanceModal.module.scss +++ b/src/components/modals/stars/StarsBalanceModal.module.scss @@ -38,8 +38,9 @@ position: relative; @include mixins.adapt-padding-to-scrollbar(0.5rem); - @include mixins.side-panel-section; + + border-bottom: 0; } .sectionTitle { @@ -148,7 +149,7 @@ .starButton { grid-column: 1/-1; - gap: 1rem; + gap: 0.5rem; margin-top: 0.5rem; } @@ -218,6 +219,7 @@ --border-radius-messages-small: 0; top: 3.5rem; + padding-inline: 0; } .disclaimer { diff --git a/src/components/modals/stars/StarsBalanceModal.tsx b/src/components/modals/stars/StarsBalanceModal.tsx index db43095b8..bba9e5089 100644 --- a/src/components/modals/stars/StarsBalanceModal.tsx +++ b/src/components/modals/stars/StarsBalanceModal.tsx @@ -253,6 +253,7 @@ const StarsBalanceModal = ({
void; contextRootElementSelector?: string; }; @@ -40,7 +41,7 @@ const SCROLL_DURATION = IS_IOS ? 450 : IS_ANDROID ? 400 : 300; const TabList: FC = ({ tabs, areFolders, activeTab, onSwitchTab, - contextRootElementSelector, className, + contextRootElementSelector, className, tabClassName, }) => { // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); @@ -94,6 +95,7 @@ const TabList: FC = ({ clickArg={i} contextActions={tab.contextActions} contextRootElementSelector={contextRootElementSelector} + className={tabClassName} /> ))}