Skip to content

Commit

Permalink
Add app token link to main settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Sep 13, 2024
1 parent a2d6cc5 commit 482dd88
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12835,7 +12835,7 @@
repositoryURL = "https://github.com/horizontalsystems/TonKit.Swift";
requirement = {
kind = exactVersion;
version = 1.0.7;
version = 1.0.8;
};
};
6BF66DD82BA1A73300963242 /* XCRemoteSwiftPackageReference "ObjectMapper" */ = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum AppConfig {
static let appGitHubRepository = "unstoppable-wallet-ios"
static let appTwitterAccount = "unstoppablebyhs"
static let appTelegramAccount = "unstoppable_announcements"
static let appTokenTelegramAccount = "BeUnstoppable_bot"
static let mempoolSpaceUrl = "https://mempool.space"
static let guidesIndexUrl = URL(string: "https://raw.githubusercontent.com/horizontalsystems/blockchain-crypto-guides/v1.2/index.json")!
static let faqIndexUrl = URL(string: "https://raw.githubusercontent.com/horizontalsystems/unstoppable-wallet-website/master/src/faq.json")!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ class MainSettingsViewController: ThemeViewController {
stat(page: .settings, event: .open(page: .donate))
}

private func onTokenTapped() {
UrlManager.open(url: "https://t.me/\(AppConfig.appTokenTelegramAccount)")
}

private var accountRows: [RowProtocol] {
[
StaticRow(
Expand Down Expand Up @@ -453,6 +457,23 @@ class MainSettingsViewController: ThemeViewController {
]
}

private var tokenRows: [RowProtocol] {
[
tableView.universalRow48(
id: "token",
image: .local(UIImage(named: "uwt_24")?.withTintColor(.themeJacob)),
title: .body("settings.get_your_tokens".localized),
accessoryType: .disclosure,
autoDeselect: true,
isFirst: true,
isLast: true,
action: { [weak self] in
self?.onTokenTapped()
}
),
]
}

private var footerRows: [RowProtocol] {
[
StaticRow(
Expand Down Expand Up @@ -522,7 +543,8 @@ class MainSettingsViewController: ThemeViewController {
extension MainSettingsViewController: SectionsDataSource {
func buildSections() -> [SectionProtocol] {
var sections: [SectionProtocol] = [
Section(id: "account", headerState: .margin(height: AppConfig.donateEnabled ? .margin32 : .margin12), rows: accountRows),
Section(id: "token", headerState: .margin(height: AppConfig.donateEnabled ? .margin32 : .margin12), rows: tokenRows),
Section(id: "account", headerState: .margin(height: .margin32), rows: accountRows),
Section(id: "appearance_settings", headerState: .margin(height: .margin32), footerState: .margin(height: .margin24), rows: appearanceRows),
Section(
id: "social",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,7 @@
"settings.contact_us" = "Contact Us";
"settings.social_networks.label" = "Be Unstoppable";
"settings.social_networks.footer" = "Learn and master crypto via exclusive videos. Get to know us informally. Be the first to see things we work on.";
"settings.get_your_tokens" = "Get Your Tokens";

// Settings -> Base Currency

Expand Down

0 comments on commit 482dd88

Please sign in to comment.