mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added entry point for channel earn info section.
This commit is contained in:
parent
c66b5b2490
commit
9b0f3bedff
5 changed files with 10 additions and 0 deletions
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 }};
|
menuIconDiscussion: icon {{ "menu/discussion", menuIconColor }};
|
||||||
menuIconStats: icon {{ "menu/stats", menuIconColor }};
|
menuIconStats: icon {{ "menu/stats", menuIconColor }};
|
||||||
menuIconBoosts: icon {{ "menu/boosts", menuIconColor }};
|
menuIconBoosts: icon {{ "menu/boosts", menuIconColor }};
|
||||||
|
menuIconEarn: icon {{ "menu/earn", menuIconColor }};
|
||||||
menuIconCreatePoll: icon {{ "menu/create_poll", menuIconColor }};
|
menuIconCreatePoll: icon {{ "menu/create_poll", menuIconColor }};
|
||||||
menuIconQrCode: icon {{ "menu/qr_code", menuIconColor }};
|
menuIconQrCode: icon {{ "menu/qr_code", menuIconColor }};
|
||||||
menuIconExpand: icon {{ "menu/expand", 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_controller.h"
|
||||||
#include "info/info_memento.h"
|
#include "info/info_memento.h"
|
||||||
#include "info/channel_statistics/boosts/info_boosts_widget.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/profile/info_profile_values.h"
|
||||||
#include "info/statistics/info_statistics_widget.h"
|
#include "info/statistics/info_statistics_widget.h"
|
||||||
#include "info/stories/info_stories_widget.h"
|
#include "info/stories/info_stories_widget.h"
|
||||||
|
@ -1039,6 +1040,7 @@ void Filler::addViewStatistics() {
|
||||||
const auto peer = _peer;
|
const auto peer = _peer;
|
||||||
using Flag = ChannelDataFlag;
|
using Flag = ChannelDataFlag;
|
||||||
const auto canGetStats = (channel->flags() & Flag::CanGetStatistics);
|
const auto canGetStats = (channel->flags() & Flag::CanGetStatistics);
|
||||||
|
const auto canViewEarn = (channel->flags() & Flag::CanViewRevenue);
|
||||||
if (canGetStats) {
|
if (canGetStats) {
|
||||||
_addAction(tr::lng_stats_title(tr::now), [=] {
|
_addAction(tr::lng_stats_title(tr::now), [=] {
|
||||||
if (const auto strong = weak.get()) {
|
if (const auto strong = weak.get()) {
|
||||||
|
@ -1062,6 +1064,13 @@ void Filler::addViewStatistics() {
|
||||||
}
|
}
|
||||||
}, &st::menuIconBoosts);
|
}, &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…
Add table
Reference in a new issue