From 1ca1512898070e84eb07c3fb7284d2a97cc5ad74 Mon Sep 17 00:00:00 2001
From: EA <ealymbaev@gmail.com>
Date: Fri, 13 Sep 2024 17:47:26 +0600
Subject: [PATCH] Add app token link to main settings page

---
 .../project.pbxproj                           |   2 +-
 .../Icons/uwt_24.imageset/Contents.json       |  22 ++++++++++++++++
 .../Icons/uwt_24.imageset/uwt2@2x.png         | Bin 0 -> 868 bytes
 .../Icons/uwt_24.imageset/uwt2@3x.png         | Bin 0 -> 1219 bytes
 .../Core/Providers/AppConfig.swift            |   1 +
 .../Main/MainSettingsViewController.swift     |  24 +++++++++++++++++-
 .../en.lproj/Localizable.strings              |   1 +
 7 files changed, 48 insertions(+), 2 deletions(-)
 create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/Contents.json
 create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/uwt2@2x.png
 create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/uwt2@3x.png

diff --git a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj
index 2dc3834e51..034d22d00f 100644
--- a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj
+++ b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj
@@ -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" */ = {
diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/Contents.json b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/Contents.json
new file mode 100644
index 0000000000..5df1989624
--- /dev/null
+++ b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "uwt2@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "uwt2@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}
diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/uwt2@2x.png b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/uwt2@2x.png
new file mode 100644
index 0000000000000000000000000000000000000000..1ac94993bc4ae80e08a338c8ec24ca88583238cf
GIT binary patch
literal 868
zcmV-q1DpJbP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm00009a7bBm000&x
z000&x0ZCFM@Bjb+0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH0{KZqK~#7F?U_At
z(?Ar*|B^Aaa|3e%LPy62DCk0N;2St;m<a*A9ws3j_6gz}FmzOS(^2{c5hoxe5G?Ul
z5*bF?mG()pt(o{Yqc~ozEWLei-<N<bTkbX<R)mzNKj@>Ee!Z6RWCtt2M-8Nuy@Jy{
z%m10*_|QiU?x6z7gWn$k(IIMUF}xye&1fyhQXU6j!q&ied_DxaSLwqy#ef8vlOO{y
zVF@7R*~chaPEcSHHR#iEq3^-D$jO9KllereF0gW<L(+r*ZuaQD*JZOEHPD@}=izVJ
zO%|-2QUOwx?qcmk!o{2l1xPkkqnnk9Hm9?~`&$J_{IfU0#)(En@uolnq4x8AY@Rgc
zm@x{FM#lkKgEl3z7AzVFTVOg_y2ia=5x^5@A4Ah%P5?3=(GuIw(v$MN$POAb5DK)G
zPA(o91n?fBwdAt_g8;2GpMT^Q*R+ZIXfHWe>bp#;$p4vSfM#$KfJH$`ctratKqAQ4
zeC=uNB+*n4=o>P$5WS>7lk6xJ@iY3Em0ZjfAXgulyijQokzpT|VJC}0cEDsp3$Tdu
zc6Q30)Yfc|_dPpc65tYSbjs^)&w4J^))IVji)#>I$<#oM-ZOI-O(ZLiIVyR(P-RDq
zJ)KNfjZ1*o>vR`VzFH)|r#)4?+4pPI)&V(&2iZYeS7J&>)s(tV#|3p2^g^UVAsRrL
z1}$;mW`fq?8)J#3BGdhtaEkUYv$Y)yB5~{`xG`ZB1h&=JbZjS-Qa^=w`iu7Y3v8An
zDPJqw$xhLgN`3t%#2)qay~o%H;Z({u=S4G|TI1y3*WFswkQ+XER5r;m8~uF%c8XC4
zPwD2a(@Zd+qMF>RKg3GWX7koLx9Wg_Qu8lDJfnol(|J$R?+D1_MaT5;l5-JD01a*I
zg%Hm_(@O26f;51RIe!kMe5b&q*88m_$I<b^e^MbePJ`ug;_@QHMq{s8lctj|lD14N
uj6QB(v!;cTb_AC?<0Vs3*s^6yZT<qJ2<^RvP25cY0000<MNUMnLSTZ|SBAU*

literal 0
HcmV?d00001

diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/uwt2@3x.png b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/uwt_24.imageset/uwt2@3x.png
new file mode 100644
index 0000000000000000000000000000000000000000..e3d37fb9c3930256a98a66ad7c6bbba0674ae1a1
GIT binary patch
literal 1219
zcmV;!1U&nRP)<h;3K|Lk000e1NJLTq002k;002k`1^@s6RqeA!00009a7bBm001F4
z001F40Y#QEU;qFB0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH1XxK#K~#7F?VLe!
z(=Zf<pHrG{%L#B#K)Yjy!mxl<%Lxc4XuG7qL>Y$CUE341H)z?hftVe;h7;f$5SC2G
z7Eh52fr(^EmK??PH`BDWo!I*O^z`)fRDhP2mX?;5WhH_Dp!D!N0E_=U8l{vTY`}u)
zKoI;dj_g?dcom4!_XIrS`yO||1LC3C03gTjzPoWgqV!#gx7o)oc?phjDi8`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A}w9h_~K6jk_92({EG2pi&PWw=5zAERMj1%?1)LLOso
zCFfzlf@+I+wBLD(bF7cx2rnCMvCH9d%*t_n*2IO$hGI(O_>;jSVkLu@+WN`__!H*O
z9iRqg7WuZTi!~JmQ^DCuRR^qfH>eqr#$7=l)geU{8&9dm^ZqqOvAR1Ji<o>FDog4R
hrKP2%rKP1A{03qXcd*xPq+tL6002ovPDHLkV1hFJD}?|6

literal 0
HcmV?d00001

diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Providers/AppConfig.swift b/UnstoppableWallet/UnstoppableWallet/Core/Providers/AppConfig.swift
index c65ca262f6..9f3bfea206 100644
--- a/UnstoppableWallet/UnstoppableWallet/Core/Providers/AppConfig.swift
+++ b/UnstoppableWallet/UnstoppableWallet/Core/Providers/AppConfig.swift
@@ -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")!
diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift
index 10c6dde717..3c870a1e28 100644
--- a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift
+++ b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift
@@ -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(
@@ -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(
@@ -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",
diff --git a/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings
index dce9e1f65d..c5293128f7 100644
--- a/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings
+++ b/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings
@@ -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