Skip to content

Commit 53ee3b4

Browse files
authored
ui: onboarding styling and colors
1 parent 8db5186 commit 53ee3b4

File tree

10 files changed

+319
-160
lines changed

10 files changed

+319
-160
lines changed

LDKNodeMonday.xcodeproj/project.pbxproj

+31-13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
65875A932CCB9809000D3E70 /* LDKNode in Frameworks */ = {isa = PBXBuildFile; productRef = 65875A922CCB9809000D3E70 /* LDKNode */; };
11+
659EE6952CF8D4990064ED78 /* ImportWalletView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 659EE6942CF8D4990064ED78 /* ImportWalletView.swift */; };
12+
65A406632D070CBD00EA331E /* NetworkSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65A406622D070CBD00EA331E /* NetworkSettingsView.swift */; };
1013
AE00550E2B479EF000100797 /* OnboardingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE00550D2B479EF000100797 /* OnboardingView.swift */; };
1114
AE0055102B479F1100100797 /* OnboardingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE00550F2B479F1100100797 /* OnboardingViewModel.swift */; };
1215
AE0055122B47A65700100797 /* Color+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE0055112B47A65700100797 /* Color+Extensions.swift */; };
@@ -86,11 +89,12 @@
8689
AEE8FDDD29F855E700406DD9 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE8FDDC29F855E700406DD9 /* String+Extensions.swift */; };
8790
AEE8FDDF29F8579600406DD9 /* Date+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE8FDDE29F8579600406DD9 /* Date+Extensions.swift */; };
8891
AEF66F522BA4B11A00FA15F9 /* PaymentKind+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEF66F512BA4B11A00FA15F9 /* PaymentKind+Extensions.swift */; };
89-
AEFA825E2CC15C7C0095B0BA /* LDKNode in Frameworks */ = {isa = PBXBuildFile; productRef = AEFA825D2CC15C7C0095B0BA /* LDKNode */; };
9092
AEFAF2922A433F6F001128DF /* LightningPaymentStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEFAF2912A433F6F001128DF /* LightningPaymentStatus.swift */; };
9193
/* End PBXBuildFile section */
9294

9395
/* Begin PBXFileReference section */
96+
659EE6942CF8D4990064ED78 /* ImportWalletView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportWalletView.swift; sourceTree = "<group>"; };
97+
65A406622D070CBD00EA331E /* NetworkSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkSettingsView.swift; sourceTree = "<group>"; };
9498
AE00550D2B479EF000100797 /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = "<group>"; };
9599
AE00550F2B479F1100100797 /* OnboardingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingViewModel.swift; sourceTree = "<group>"; };
96100
AE0055112B47A65700100797 /* Color+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extensions.swift"; sourceTree = "<group>"; };
@@ -173,7 +177,7 @@
173177
isa = PBXFrameworksBuildPhase;
174178
buildActionMask = 2147483647;
175179
files = (
176-
AEFA825E2CC15C7C0095B0BA /* LDKNode in Frameworks */,
180+
65875A932CCB9809000D3E70 /* LDKNode in Frameworks */,
177181
AE060C382C051B59006724F1 /* LDKNode in Frameworks */,
178182
AE1D9BEC2B2A1FFD00620748 /* BitcoinUI in Frameworks */,
179183
AEE5B7652A09B1FC001E5E59 /* CodeScanner in Frameworks */,
@@ -296,9 +300,11 @@
296300
AE49E8772A253CBE002623E8 /* Home */ = {
297301
isa = PBXGroup;
298302
children = (
303+
65A406622D070CBD00EA331E /* NetworkSettingsView.swift */,
299304
AE00550D2B479EF000100797 /* OnboardingView.swift */,
300305
AE186B8D2A1540B700338463 /* StartView.swift */,
301306
AE4C15B12A1316D100AA8917 /* BitcoinView.swift */,
307+
659EE6942CF8D4990064ED78 /* ImportWalletView.swift */,
302308
AE551D402B8ECC2D0034B61E /* Payments */,
303309
AE551D412B8ECC390034B61E /* Send */,
304310
AE551D422B8ECC400034B61E /* Receive */,
@@ -548,7 +554,7 @@
548554
AE7C4A072B406D590061189D /* SimpleToast */,
549555
AE060C372C051B59006724F1 /* LDKNode */,
550556
AE80C2042C4AB5E4006E7193 /* LDKNode */,
551-
AEFA825D2CC15C7C0095B0BA /* LDKNode */,
557+
65875A922CCB9809000D3E70 /* LDKNode */,
552558
);
553559
productName = LDKNodeMonday;
554560
productReference = AE17E8D629A402E30058C9C9 /* LDKNodeMonday.app */;
@@ -583,7 +589,7 @@
583589
AE01C5AE2AB3BEED00F28C7E /* XCRemoteSwiftPackageReference "KeychainAccess" */,
584590
AE1D9BEA2B2A1FFD00620748 /* XCRemoteSwiftPackageReference "BitcoinUI" */,
585591
AE7C4A062B406D590061189D /* XCRemoteSwiftPackageReference "SimpleToast" */,
586-
AEFA825C2CC15C7C0095B0BA /* XCRemoteSwiftPackageReference "ldk-node" */,
592+
65875A912CCB9809000D3E70 /* XCRemoteSwiftPackageReference "ldk-node" */,
587593
);
588594
productRefGroup = AE17E8D729A402E30058C9C9 /* Products */;
589595
projectDirPath = "";
@@ -630,6 +636,7 @@
630636
AE49E8662A2537D5002623E8 /* PeerViewModel.swift in Sources */,
631637
AE33D3AE2C7BD0EE00AF562B /* URL+Extensions.swift in Sources */,
632638
AEBAA4942A01C6BD0042EA82 /* DisconnectView.swift in Sources */,
639+
65A406632D070CBD00EA331E /* NetworkSettingsView.swift in Sources */,
633640
AE49E8682A2537FB002623E8 /* DisconnectViewModel.swift in Sources */,
634641
AE94226A2A007D6C007E4F12 /* ChannelsListView.swift in Sources */,
635642
AEA057ED2B912FEA00DB1096 /* JITInvoiceView.swift in Sources */,
@@ -681,6 +688,7 @@
681688
AE4C15B22A1316D100AA8917 /* BitcoinView.swift in Sources */,
682689
AEE5B76A2A09C722001E5E59 /* Peer.swift in Sources */,
683690
AE49E84C2A24F96F002623E8 /* Constants.swift in Sources */,
691+
659EE6952CF8D4990064ED78 /* ImportWalletView.swift in Sources */,
684692
AE0BD4AC2B598C3F00B9901E /* UInt32+Extensions.swift in Sources */,
685693
);
686694
runOnlyForDeploymentPostprocessing = 0;
@@ -814,17 +822,18 @@
814822
CODE_SIGN_STYLE = Automatic;
815823
CURRENT_PROJECT_VERSION = 1;
816824
DEVELOPMENT_ASSET_PATHS = "\"LDKNodeMonday/Preview Content\"";
817-
DEVELOPMENT_TEAM = 9G6M658RKZ;
825+
DEVELOPMENT_TEAM = "";
818826
ENABLE_PREVIEWS = YES;
819827
GENERATE_INFOPLIST_FILE = YES;
820828
INFOPLIST_FILE = LDKNodeMonday/Info.plist;
821829
INFOPLIST_KEY_CFBundleDisplayName = Monday;
822-
INFOPLIST_KEY_NSCameraUsageDescription = "To scan QR codes.";
830+
INFOPLIST_KEY_NSCameraUsageDescription = "\"To scan QR codes.\"";
823831
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
824832
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
825833
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
826834
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
827835
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
836+
INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
828837
LD_RUNPATH_SEARCH_PATHS = (
829838
"$(inherited)",
830839
"@executable_path/Frameworks",
@@ -846,17 +855,18 @@
846855
CODE_SIGN_STYLE = Automatic;
847856
CURRENT_PROJECT_VERSION = 1;
848857
DEVELOPMENT_ASSET_PATHS = "\"LDKNodeMonday/Preview Content\"";
849-
DEVELOPMENT_TEAM = 9G6M658RKZ;
858+
DEVELOPMENT_TEAM = "";
850859
ENABLE_PREVIEWS = YES;
851860
GENERATE_INFOPLIST_FILE = YES;
852861
INFOPLIST_FILE = LDKNodeMonday/Info.plist;
853862
INFOPLIST_KEY_CFBundleDisplayName = Monday;
854-
INFOPLIST_KEY_NSCameraUsageDescription = "To scan QR codes.";
863+
INFOPLIST_KEY_NSCameraUsageDescription = "\"To scan QR codes.\"";
855864
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
856865
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
857866
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
858867
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
859868
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
869+
INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
860870
LD_RUNPATH_SEARCH_PATHS = (
861871
"$(inherited)",
862872
"@executable_path/Frameworks",
@@ -894,6 +904,14 @@
894904
/* End XCConfigurationList section */
895905

896906
/* Begin XCRemoteSwiftPackageReference section */
907+
65875A912CCB9809000D3E70 /* XCRemoteSwiftPackageReference "ldk-node" */ = {
908+
isa = XCRemoteSwiftPackageReference;
909+
repositoryURL = "https://github.com/lightningdevkit/ldk-node.git";
910+
requirement = {
911+
kind = exactVersion;
912+
version = 0.4.0;
913+
};
914+
};
897915
AE01C5AE2AB3BEED00F28C7E /* XCRemoteSwiftPackageReference "KeychainAccess" */ = {
898916
isa = XCRemoteSwiftPackageReference;
899917
repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess.git";
@@ -937,6 +955,11 @@
937955
/* End XCRemoteSwiftPackageReference section */
938956

939957
/* Begin XCSwiftPackageProductDependency section */
958+
65875A922CCB9809000D3E70 /* LDKNode */ = {
959+
isa = XCSwiftPackageProductDependency;
960+
package = 65875A912CCB9809000D3E70 /* XCRemoteSwiftPackageReference "ldk-node" */;
961+
productName = LDKNode;
962+
};
940963
AE01C5AF2AB3BEED00F28C7E /* KeychainAccess */ = {
941964
isa = XCSwiftPackageProductDependency;
942965
package = AE01C5AE2AB3BEED00F28C7E /* XCRemoteSwiftPackageReference "KeychainAccess" */;
@@ -969,11 +992,6 @@
969992
package = AEE5B7632A09B1FC001E5E59 /* XCRemoteSwiftPackageReference "CodeScanner" */;
970993
productName = CodeScanner;
971994
};
972-
AEFA825D2CC15C7C0095B0BA /* LDKNode */ = {
973-
isa = XCSwiftPackageProductDependency;
974-
package = AEFA825C2CC15C7C0095B0BA /* XCRemoteSwiftPackageReference "ldk-node" */;
975-
productName = LDKNode;
976-
};
977995
/* End XCSwiftPackageProductDependency section */
978996
};
979997
rootObject = AE17E8CE29A402E30058C9C9 /* Project object */;

LDKNodeMonday/Assets.xcassets/AccentColor.colorset/Contents.json

+14-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
"colors" : [
33
{
44
"color" : {
5-
"platform" : "universal",
6-
"reference" : "systemBlueColor"
5+
"color-space" : "display-p3",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.894",
9+
"green" : "0.188",
10+
"red" : "0.111"
11+
}
712
},
813
"idiom" : "universal"
914
},
@@ -15,8 +20,13 @@
1520
}
1621
],
1722
"color" : {
18-
"platform" : "universal",
19-
"reference" : "systemBlueColor"
23+
"color-space" : "display-p3",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0xCD",
27+
"green" : "0xF3",
28+
"red" : "0x77"
29+
}
2030
},
2131
"idiom" : "universal"
2232
}

LDKNodeMonday/Extensions/ChannelDetails+Extensions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extension ChannelDetails {
5353
}
5454
}
5555

56-
extension ChannelDetails: Hashable {
56+
extension ChannelDetails {
5757
public static func == (lhs: ChannelDetails, rhs: ChannelDetails) -> Bool {
5858
return lhs.channelId == rhs.channelId
5959
}

LDKNodeMonday/Info.plist

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
<key>ITSAppUsesNonExemptEncryption</key>
66
<false/>
77
<key>NSPasteboardUsageDescription</key>
8-
<string> &quot;To allow users to copy and paste text between the app and other apps&quot;</string>
9-
<key>NSCameraUsageDescription</key>
10-
<string>&quot;To scan QR codes.&quot;</string>
11-
<key>UISupportsDocumentBrowser</key>
12-
<true/>
8+
<string>To allow users to copy and paste text between the app and other apps</string>
139
</dict>
1410
</plist>

LDKNodeMonday/Service/Lightning Service/LightningNodeService.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class LightningNodeService {
2424
let storedNetworkString = try! keyService.getNetwork() ?? Network.signet.description
2525
let storedEsploraURL =
2626
try! keyService.getEsploraURL()
27-
?? Constants.Config.EsploraServerURLNetwork.Signet.mutiny
27+
?? EsploraServer.mutiny_signet.url
2828

2929
self.network = Network(stringValue: storedNetworkString) ?? .signet
3030
self.keyService = keyService

LDKNodeMonday/Utilities/Constants.swift

+40-16
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,27 @@ struct Constants {
1414

1515
struct EsploraServerURLNetwork {
1616
struct Bitcoin {
17-
static let blockstream = "https://blockstream.info/api"
18-
static let mempoolspace = "https://mempool.space/api"
1917
static let allValues = [
20-
blockstream,
21-
mempoolspace,
18+
EsploraServer.blockstream_bitcoin,
19+
EsploraServer.mempoolspace_bitcoin,
2220
]
2321
}
2422
struct Regtest {
25-
private static let local = "http://127.0.0.1:3002"
2623
static let allValues = [
27-
local
24+
EsploraServer.local_regtest
2825
]
2926
}
3027
struct Signet {
31-
static let bdk = "http://signet.bitcoindevkit.net"
32-
static let mutiny = "https://mutinynet.com/api"
3328
static let allValues = [
34-
mutiny,
35-
bdk,
29+
EsploraServer.mutiny_signet,
30+
EsploraServer.bdk_signet,
3631
]
3732
}
3833
struct Testnet {
39-
static let blockstream = "http://blockstream.info/testnet/api"
40-
static let kuutamo = "https://esplora.testnet.kuutamo.cloud"
41-
static let mempoolspace = "https://mempool.space/testnet/api"
4234
static let allValues = [
43-
blockstream,
44-
kuutamo,
45-
mempoolspace,
35+
EsploraServer.blockstream_testnet,
36+
EsploraServer.kuutamo_testnet,
37+
EsploraServer.mempoolspace_testnet,
4638
]
4739
}
4840
}
@@ -99,3 +91,35 @@ struct Constants {
9991
}
10092

10193
}
94+
95+
struct EsploraServer: Hashable {
96+
var name: String
97+
var url: String
98+
99+
static let blockstream_bitcoin = EsploraServer(
100+
name: "Blockstream",
101+
url: "https://blockstream.info/api"
102+
)
103+
static let mempoolspace_bitcoin = EsploraServer(
104+
name: "Mempool",
105+
url: "https://mempool.space/api"
106+
)
107+
108+
static let mutiny_signet = EsploraServer(name: "Mutiny", url: "https://mutinynet.com/api")
109+
static let bdk_signet = EsploraServer(name: "BDK", url: "http://signet.bitcoindevkit.net")
110+
111+
static let local_regtest = EsploraServer(name: "Local", url: "http://127.0.0.1:3002")
112+
113+
static let blockstream_testnet = EsploraServer(
114+
name: "Blockstream",
115+
url: "http://blockstream.info/testnet/api"
116+
)
117+
static let kuutamo_testnet = EsploraServer(
118+
name: "Kuutamo",
119+
url: "https://esplora.testnet.kuutamo.cloud"
120+
)
121+
static let mempoolspace_testnet = EsploraServer(
122+
name: "Mempool.space",
123+
url: "https://mempool.space/testnet/api"
124+
)
125+
}

LDKNodeMonday/View Model/Home/OnboardingViewModel.swift

+12-11
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ class OnboardingViewModel: ObservableObject {
2323
do {
2424
let networkString = selectedNetwork.description
2525
try KeyClient.live.saveNetwork(networkString)
26-
selectedURL = availableURLs.first ?? ""
27-
try KeyClient.live.saveEsploraURL(selectedURL)
26+
self.selectedEsploraServer =
27+
availableEsploraServers.first ?? EsploraServer(name: "", url: "")
28+
try KeyClient.live.saveEsploraURL(selectedEsploraServer.url)
2829
} catch {
2930
DispatchQueue.main.async {
3031
self.onboardingViewError = .init(
@@ -35,10 +36,11 @@ class OnboardingViewModel: ObservableObject {
3536
}
3637
}
3738
}
38-
@Published var selectedURL: String = "" {
39+
@Published var selectedEsploraServer: EsploraServer = EsploraServer.mutiny_signet
40+
{
3941
didSet {
4042
do {
41-
try KeyClient.live.saveEsploraURL(selectedURL)
43+
try KeyClient.live.saveEsploraURL(selectedEsploraServer.url)
4244
} catch {
4345
DispatchQueue.main.async {
4446
self.onboardingViewError = .init(
@@ -49,7 +51,7 @@ class OnboardingViewModel: ObservableObject {
4951
}
5052
}
5153
}
52-
var availableURLs: [String] {
54+
var availableEsploraServers: [EsploraServer] {
5355
switch selectedNetwork {
5456
case .bitcoin:
5557
return Constants.Config.EsploraServerURLNetwork.Bitcoin.allValues
@@ -80,13 +82,12 @@ class OnboardingViewModel: ObservableObject {
8082
do {
8183
if let networkString = try KeyClient.live.getNetwork() {
8284
self.selectedNetwork = Network(stringValue: networkString) ?? .signet
83-
} else {
84-
self.selectedNetwork = .signet
8585
}
8686
if let esploraURL = try KeyClient.live.getEsploraURL() {
87-
self.selectedURL = esploraURL
88-
} else {
89-
self.selectedURL = availableURLs.first ?? ""
87+
self.selectedEsploraServer =
88+
availableEsploraServers.first(where: {
89+
$0.url == esploraURL
90+
}) ?? EsploraServer.mutiny_signet
9091
}
9192
} catch {
9293
DispatchQueue.main.async {
@@ -104,7 +105,7 @@ class OnboardingViewModel: ObservableObject {
104105
let backupInfo = BackupInfo(mnemonic: seedPhrase)
105106
try KeyClient.live.saveBackupInfo(backupInfo)
106107
try KeyClient.live.saveNetwork(selectedNetwork.description)
107-
try KeyClient.live.saveEsploraURL(selectedURL)
108+
try KeyClient.live.saveEsploraURL(selectedEsploraServer.url)
108109
LightningNodeService.shared = LightningNodeService()
109110
DispatchQueue.main.async {
110111
self.isOnboarding = false

0 commit comments

Comments
 (0)