mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-24 17:26:58 +00:00
Added entry point for channel earn info section.
This commit is contained in:
parent
c66b5b2490
commit
9b0f3bedff
BIN
Telegram/Resources/icons/menu/earn.png
Normal file
BIN
Telegram/Resources/icons/menu/earn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 568 B |
BIN
Telegram/Resources/icons/menu/earn@2x.png
Normal file
BIN
Telegram/Resources/icons/menu/earn@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
Telegram/Resources/icons/menu/earn@3x.png
Normal file
BIN
Telegram/Resources/icons/menu/earn@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@ -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 }};
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user