Added entry point for channel earn info section.

This commit is contained in:
23rd 2024-03-27 21:32:42 +03:00 committed by John Preston
parent c66b5b2490
commit 9b0f3bedff
5 changed files with 10 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -53,6 +53,7 @@ menuIconManage: icon {{ "menu/manage", menuIconColor }};
menuIconDiscussion: icon {{ "menu/discussion", menuIconColor }};
menuIconStats: icon {{ "menu/stats", menuIconColor }};
menuIconBoosts: icon {{ "menu/boosts", menuIconColor }};
menuIconEarn: icon {{ "menu/earn", menuIconColor }};
menuIconCreatePoll: icon {{ "menu/create_poll", menuIconColor }};
menuIconQrCode: icon {{ "menu/qr_code", menuIconColor }};
menuIconExpand: icon {{ "menu/expand", menuIconColor }};

View File

@ -64,6 +64,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/info_controller.h"
#include "info/info_memento.h"
#include "info/channel_statistics/boosts/info_boosts_widget.h"
#include "info/channel_statistics/earn/info_earn_widget.h"
#include "info/profile/info_profile_values.h"
#include "info/statistics/info_statistics_widget.h"
#include "info/stories/info_stories_widget.h"
@ -1039,6 +1040,7 @@ void Filler::addViewStatistics() {
const auto peer = _peer;
using Flag = ChannelDataFlag;
const auto canGetStats = (channel->flags() & Flag::CanGetStatistics);
const auto canViewEarn = (channel->flags() & Flag::CanViewRevenue);
if (canGetStats) {
_addAction(tr::lng_stats_title(tr::now), [=] {
if (const auto strong = weak.get()) {
@ -1062,6 +1064,13 @@ void Filler::addViewStatistics() {
}
}, &st::menuIconBoosts);
}
if (canViewEarn) {
_addAction(tr::lng_channel_earn_title(tr::now), [=] {
if (const auto strong = weak.get()) {
controller->showSection(Info::ChannelEarn::Make(peer));
}
}, &st::menuIconEarn);
}
}
}