Improved phrases in top bar from box for giveaway creation with credits.

This commit is contained in:
23rd 2024-08-31 10:16:25 +03:00 committed by John Preston
parent 5196982c98
commit 1e8e660133
2 changed files with 16 additions and 5 deletions

View file

@ -2747,6 +2747,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_giveaway_new_title" = "Boosts via Gifts";
"lng_giveaway_new_about" = "Get more boosts for your channel by gifting Premium to your subscribers.";
"lng_giveaway_new_about_group" = "Get more boosts for your group by gifting Premium to your subscribers.";
"lng_giveaway_credits_new_about" = "Get more boosts and subscribers for your channel by giving away prizes.";
"lng_giveaway_credits_new_about_group" = "Get more boosts and members for your group by giving away prizes.";
"lng_giveaway_create_option" = "Create Giveaway";
"lng_giveaway_create_subtitle" = "winners are chosen randomly";
"lng_giveaway_award_option" = "Award Specific Users";

View file

@ -113,7 +113,7 @@ void AddPremiumTopBarWithDefaultTitleBar(
not_null<Ui::GenericBox*> box,
rpl::producer<> showFinished,
rpl::producer<QString> titleText,
bool group) {
rpl::producer<TextWithEntities> subtitleText) {
struct State final {
Ui::Animations::Simple animation;
Ui::Text::String title;
@ -200,9 +200,7 @@ void AddPremiumTopBarWithDefaultTitleBar(
Ui::Premium::TopBarDescriptor{
.clickContextOther = nullptr,
.title = tr::lng_giveaway_new_title(),
.about = (group
? tr::lng_giveaway_new_about_group
: tr::lng_giveaway_new_about)(Ui::Text::RichLangValue),
.about = std::move(subtitleText),
.light = true,
.optimizeMinistars = false,
});
@ -323,7 +321,18 @@ void CreateGiveawayBox(
hideSpecificUsersOn(),
tr::lng_giveaway_start(),
tr::lng_giveaway_award()),
peer->isMegagroup());
rpl::conditional(
isPrepaidCredits
? rpl::single(true)
: state->typeValue.value() | rpl::map(
rpl::mappers::_1 == GiveawayType::Credits),
(peer->isMegagroup()
? tr::lng_giveaway_credits_new_about_group()
: tr::lng_giveaway_credits_new_about()),
(peer->isMegagroup()
? tr::lng_giveaway_new_about_group()
: tr::lng_giveaway_new_about())
) | rpl::map(Ui::Text::RichLangValue));
{
const auto &padding = st::giveawayGiftCodeCoverDividerPadding;
Ui::AddSkip(box->verticalLayout(), padding.bottom());