diff --git a/secant.xcodeproj/project.pbxproj b/secant.xcodeproj/project.pbxproj index 13fec80..9c3a98c 100644 --- a/secant.xcodeproj/project.pbxproj +++ b/secant.xcodeproj/project.pbxproj @@ -15,12 +15,36 @@ 0D1922F426BDE5F200052649 /* MnemonicSeedPhraseHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1922F326BDE5F200052649 /* MnemonicSeedPhraseHandling.swift */; }; 0D1922F626BDE74500052649 /* KeyStoring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1922F526BDE74500052649 /* KeyStoring.swift */; }; 0D1922F826BDEB3500052649 /* MockServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1922F726BDEB3500052649 /* MockServices.swift */; }; + 0D2ACE8026C2C67100D62E3C /* Zboto.otf in Resources */ = {isa = PBXBuildFile; fileRef = 0D2ACE7F26C2C67100D62E3C /* Zboto.otf */; }; + 0D2ACE8326C2C8B400D62E3C /* SwiftUI+secant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D2ACE8226C2C8B400D62E3C /* SwiftUI+secant.swift */; }; + 0D32281926C5864B00262533 /* ProfileScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32281726C5864B00262533 /* ProfileScreen.swift */; }; + 0D32281A26C5864B00262533 /* ProfileScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32281826C5864B00262533 /* ProfileScreenViewModel.swift */; }; + 0D32281E26C5867D00262533 /* ScanQrScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32281C26C5867D00262533 /* ScanQrScreen.swift */; }; + 0D32281F26C5867D00262533 /* ScanQrScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32281D26C5867D00262533 /* ScanQrScreenViewModel.swift */; }; + 0D32282326C586A800262533 /* HistoryScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32282126C586A800262533 /* HistoryScreen.swift */; }; + 0D32282426C586A800262533 /* HistoryScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32282226C586A800262533 /* HistoryScreenViewModel.swift */; }; + 0D32282826C586E000262533 /* RequestZcashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32282626C586E000262533 /* RequestZcashScreen.swift */; }; + 0D32282926C586E000262533 /* RequestZcashScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32282726C586E000262533 /* RequestZcashScreenViewModel.swift */; }; + 0D32282D26C5870B00262533 /* SendScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32282B26C5870B00262533 /* SendScreen.swift */; }; + 0D32282E26C5870B00262533 /* SendScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32282C26C5870B00262533 /* SendScreenViewModel.swift */; }; + 0D32283226C5877A00262533 /* BalanceScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32283026C5877A00262533 /* BalanceScreen.swift */; }; + 0D32283326C5877A00262533 /* BalanceScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32283126C5877A00262533 /* BalanceScreenViewModel.swift */; }; 0D4E7A0926B364170058B01E /* SecantApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4E7A0826B364170058B01E /* SecantApp.swift */; }; 0D4E7A0B26B364170058B01E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4E7A0A26B364170058B01E /* ContentView.swift */; }; 0D4E7A0D26B364180058B01E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0D4E7A0C26B364180058B01E /* Assets.xcassets */; }; 0D4E7A1026B364180058B01E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0D4E7A0F26B364180058B01E /* Preview Assets.xcassets */; }; 0D4E7A1B26B364180058B01E /* secantTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4E7A1A26B364180058B01E /* secantTests.swift */; }; 0D4E7A2626B364180058B01E /* secantUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4E7A2526B364180058B01E /* secantUITests.swift */; }; + 0DA13C8F26C15D1D00E3B610 /* WelcomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13C8D26C15D1D00E3B610 /* WelcomeScreen.swift */; }; + 0DA13C9026C15D1D00E3B610 /* WelcomeScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13C8E26C15D1D00E3B610 /* WelcomeScreenViewModel.swift */; }; + 0DA13C9326C15E2F00E3B610 /* PlainButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13C9226C15E2F00E3B610 /* PlainButton.swift */; }; + 0DA13C9726C186FF00E3B610 /* RestoreWalletScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13C9526C186FF00E3B610 /* RestoreWalletScreen.swift */; }; + 0DA13C9826C186FF00E3B610 /* RestoreWalletScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13C9626C186FF00E3B610 /* RestoreWalletScreenViewModel.swift */; }; + 0DA13C9C26C1942100E3B610 /* BackupWalletScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13C9A26C1942100E3B610 /* BackupWalletScreen.swift */; }; + 0DA13C9D26C1942100E3B610 /* BackupWalletScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13C9B26C1942100E3B610 /* BackupWalletScreenViewModel.swift */; }; + 0DA13CA126C1955600E3B610 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13C9F26C1955600E3B610 /* HomeScreen.swift */; }; + 0DA13CA226C1955600E3B610 /* HomeScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13CA026C1955600E3B610 /* HomeScreenViewModel.swift */; }; + 0DA13CA526C1963000E3B610 /* Balance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA13CA426C1963000E3B610 /* Balance.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -49,7 +73,21 @@ 0D1922F326BDE5F200052649 /* MnemonicSeedPhraseHandling.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MnemonicSeedPhraseHandling.swift; sourceTree = ""; }; 0D1922F526BDE74500052649 /* KeyStoring.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyStoring.swift; sourceTree = ""; }; 0D1922F726BDEB3500052649 /* MockServices.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockServices.swift; sourceTree = ""; }; - 0D4E7A0526B364170058B01E /* secant.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = secant.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0D2ACE7F26C2C67100D62E3C /* Zboto.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Zboto.otf; sourceTree = ""; }; + 0D2ACE8226C2C8B400D62E3C /* SwiftUI+secant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SwiftUI+secant.swift"; sourceTree = ""; }; + 0D32281726C5864B00262533 /* ProfileScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileScreen.swift; sourceTree = ""; }; + 0D32281826C5864B00262533 /* ProfileScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileScreenViewModel.swift; sourceTree = ""; }; + 0D32281C26C5867D00262533 /* ScanQrScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanQrScreen.swift; sourceTree = ""; }; + 0D32281D26C5867D00262533 /* ScanQrScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanQrScreenViewModel.swift; sourceTree = ""; }; + 0D32282126C586A800262533 /* HistoryScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryScreen.swift; sourceTree = ""; }; + 0D32282226C586A800262533 /* HistoryScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryScreenViewModel.swift; sourceTree = ""; }; + 0D32282626C586E000262533 /* RequestZcashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestZcashScreen.swift; sourceTree = ""; }; + 0D32282726C586E000262533 /* RequestZcashScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestZcashScreenViewModel.swift; sourceTree = ""; }; + 0D32282B26C5870B00262533 /* SendScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendScreen.swift; sourceTree = ""; }; + 0D32282C26C5870B00262533 /* SendScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendScreenViewModel.swift; sourceTree = ""; }; + 0D32283026C5877A00262533 /* BalanceScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceScreen.swift; sourceTree = ""; }; + 0D32283126C5877A00262533 /* BalanceScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceScreenViewModel.swift; sourceTree = ""; }; + 0D4E7A0526B364170058B01E /* secant-testnet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "secant-testnet.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 0D4E7A0826B364170058B01E /* SecantApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecantApp.swift; sourceTree = ""; }; 0D4E7A0A26B364170058B01E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 0D4E7A0C26B364180058B01E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -61,6 +99,16 @@ 0D4E7A2126B364180058B01E /* secantUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = secantUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 0D4E7A2526B364180058B01E /* secantUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = secantUITests.swift; sourceTree = ""; }; 0D4E7A2726B364180058B01E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0DA13C8D26C15D1D00E3B610 /* WelcomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeScreen.swift; sourceTree = ""; }; + 0DA13C8E26C15D1D00E3B610 /* WelcomeScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeScreenViewModel.swift; sourceTree = ""; }; + 0DA13C9226C15E2F00E3B610 /* PlainButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlainButton.swift; sourceTree = ""; }; + 0DA13C9526C186FF00E3B610 /* RestoreWalletScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoreWalletScreen.swift; sourceTree = ""; }; + 0DA13C9626C186FF00E3B610 /* RestoreWalletScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoreWalletScreenViewModel.swift; sourceTree = ""; }; + 0DA13C9A26C1942100E3B610 /* BackupWalletScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackupWalletScreen.swift; sourceTree = ""; }; + 0DA13C9B26C1942100E3B610 /* BackupWalletScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackupWalletScreenViewModel.swift; sourceTree = ""; }; + 0DA13C9F26C1955600E3B610 /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreen.swift; sourceTree = ""; }; + 0DA13CA026C1955600E3B610 /* HomeScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreenViewModel.swift; sourceTree = ""; }; + 0DA13CA426C1963000E3B610 /* Balance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Balance.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -118,6 +166,16 @@ 0D1922EB26BDD9A500052649 /* Screens */ = { isa = PBXGroup; children = ( + 0D32282F26C5874B00262533 /* Balance */, + 0D32282A26C586E700262533 /* Send ZEC */, + 0D32282526C586C600262533 /* Request ZEC */, + 0D32282026C5868F00262533 /* History */, + 0D32281B26C5865900262533 /* Scan */, + 0D32281526C5862400262533 /* Profile */, + 0DA13C9E26C1953F00E3B610 /* Home */, + 0DA13C9926C193FE00E3B610 /* Backup Wallet */, + 0DA13C9426C186B100E3B610 /* Restore Wallet */, + 0DA13C8C26C15CBE00E3B610 /* Welcome Screen */, ); path = Screens; sourceTree = ""; @@ -131,6 +189,76 @@ path = Stubs; sourceTree = ""; }; + 0D2ACE7E26C2C65E00D62E3C /* Fonts */ = { + isa = PBXGroup; + children = ( + 0D2ACE7F26C2C67100D62E3C /* Zboto.otf */, + ); + path = Fonts; + sourceTree = ""; + }; + 0D2ACE8126C2C71100D62E3C /* Utilities */ = { + isa = PBXGroup; + children = ( + 0D2ACE8226C2C8B400D62E3C /* SwiftUI+secant.swift */, + ); + path = Utilities; + sourceTree = ""; + }; + 0D32281526C5862400262533 /* Profile */ = { + isa = PBXGroup; + children = ( + 0D32281726C5864B00262533 /* ProfileScreen.swift */, + 0D32281826C5864B00262533 /* ProfileScreenViewModel.swift */, + ); + path = Profile; + sourceTree = ""; + }; + 0D32281B26C5865900262533 /* Scan */ = { + isa = PBXGroup; + children = ( + 0D32281C26C5867D00262533 /* ScanQrScreen.swift */, + 0D32281D26C5867D00262533 /* ScanQrScreenViewModel.swift */, + ); + path = Scan; + sourceTree = ""; + }; + 0D32282026C5868F00262533 /* History */ = { + isa = PBXGroup; + children = ( + 0D32282126C586A800262533 /* HistoryScreen.swift */, + 0D32282226C586A800262533 /* HistoryScreenViewModel.swift */, + ); + path = History; + sourceTree = ""; + }; + 0D32282526C586C600262533 /* Request ZEC */ = { + isa = PBXGroup; + children = ( + 0D32282626C586E000262533 /* RequestZcashScreen.swift */, + 0D32282726C586E000262533 /* RequestZcashScreenViewModel.swift */, + ); + path = "Request ZEC"; + sourceTree = ""; + }; + 0D32282A26C586E700262533 /* Send ZEC */ = { + isa = PBXGroup; + children = ( + 0D32282B26C5870B00262533 /* SendScreen.swift */, + 0D32282C26C5870B00262533 /* SendScreenViewModel.swift */, + ); + path = "Send ZEC"; + sourceTree = ""; + }; + 0D32282F26C5874B00262533 /* Balance */ = { + isa = PBXGroup; + children = ( + 0D32283026C5877A00262533 /* BalanceScreen.swift */, + 0D32283126C5877A00262533 /* BalanceScreenViewModel.swift */, + ); + path = Balance; + sourceTree = ""; + }; 0D4E79FC26B364170058B01E = { isa = PBXGroup; children = ( @@ -144,7 +272,7 @@ 0D4E7A0626B364170058B01E /* Products */ = { isa = PBXGroup; children = ( - 0D4E7A0526B364170058B01E /* secant.app */, + 0D4E7A0526B364170058B01E /* secant-testnet.app */, 0D4E7A1626B364180058B01E /* secantTests.xctest */, 0D4E7A2126B364180058B01E /* secantUITests.xctest */, ); @@ -154,6 +282,10 @@ 0D4E7A0726B364170058B01E /* secant */ = { isa = PBXGroup; children = ( + 0D2ACE8126C2C71100D62E3C /* Utilities */, + 0D2ACE7E26C2C65E00D62E3C /* Fonts */, + 0DA13CA326C1960A00E3B610 /* Models */, + 0DA13C9126C15E1900E3B610 /* UI Components */, 0D1922F026BDE27D00052649 /* Stubs */, 0D1922EB26BDD9A500052649 /* Screens */, 0D1922E826BDD95000052649 /* Base */, @@ -194,12 +326,64 @@ path = secantUITests; sourceTree = ""; }; + 0DA13C8C26C15CBE00E3B610 /* Welcome Screen */ = { + isa = PBXGroup; + children = ( + 0DA13C8D26C15D1D00E3B610 /* WelcomeScreen.swift */, + 0DA13C8E26C15D1D00E3B610 /* WelcomeScreenViewModel.swift */, + ); + path = "Welcome Screen"; + sourceTree = ""; + }; + 0DA13C9126C15E1900E3B610 /* UI Components */ = { + isa = PBXGroup; + children = ( + 0DA13C9226C15E2F00E3B610 /* PlainButton.swift */, + ); + path = "UI Components"; + sourceTree = ""; + }; + 0DA13C9426C186B100E3B610 /* Restore Wallet */ = { + isa = PBXGroup; + children = ( + 0DA13C9526C186FF00E3B610 /* RestoreWalletScreen.swift */, + 0DA13C9626C186FF00E3B610 /* RestoreWalletScreenViewModel.swift */, + ); + path = "Restore Wallet"; + sourceTree = ""; + }; + 0DA13C9926C193FE00E3B610 /* Backup Wallet */ = { + isa = PBXGroup; + children = ( + 0DA13C9A26C1942100E3B610 /* BackupWalletScreen.swift */, + 0DA13C9B26C1942100E3B610 /* BackupWalletScreenViewModel.swift */, + ); + path = "Backup Wallet"; + sourceTree = ""; + }; + 0DA13C9E26C1953F00E3B610 /* Home */ = { + isa = PBXGroup; + children = ( + 0DA13C9F26C1955600E3B610 /* HomeScreen.swift */, + 0DA13CA026C1955600E3B610 /* HomeScreenViewModel.swift */, + ); + path = Home; + sourceTree = ""; + }; + 0DA13CA326C1960A00E3B610 /* Models */ = { + isa = PBXGroup; + children = ( + 0DA13CA426C1963000E3B610 /* Balance.swift */, + ); + path = Models; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 0D4E7A0426B364170058B01E /* secant */ = { + 0D4E7A0426B364170058B01E /* secant-testnet */ = { isa = PBXNativeTarget; - buildConfigurationList = 0D4E7A2A26B364180058B01E /* Build configuration list for PBXNativeTarget "secant" */; + buildConfigurationList = 0D4E7A2A26B364180058B01E /* Build configuration list for PBXNativeTarget "secant-testnet" */; buildPhases = ( 0D4E7A0126B364170058B01E /* Sources */, 0D4E7A0226B364170058B01E /* Frameworks */, @@ -209,9 +393,9 @@ ); dependencies = ( ); - name = secant; + name = "secant-testnet"; productName = secant; - productReference = 0D4E7A0526B364170058B01E /* secant.app */; + productReference = 0D4E7A0526B364170058B01E /* secant-testnet.app */; productType = "com.apple.product-type.application"; }; 0D4E7A1526B364180058B01E /* secantTests */ = { @@ -285,7 +469,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 0D4E7A0426B364170058B01E /* secant */, + 0D4E7A0426B364170058B01E /* secant-testnet */, 0D4E7A1526B364180058B01E /* secantTests */, 0D4E7A2026B364180058B01E /* secantUITests */, ); @@ -299,6 +483,7 @@ files = ( 0D4E7A1026B364180058B01E /* Preview Assets.xcassets in Resources */, 0D4E7A0D26B364180058B01E /* Assets.xcassets in Resources */, + 0D2ACE8026C2C67100D62E3C /* Zboto.otf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -323,16 +508,39 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 0D32281F26C5867D00262533 /* ScanQrScreenViewModel.swift in Sources */, + 0D32282E26C5870B00262533 /* SendScreenViewModel.swift in Sources */, + 0D32282D26C5870B00262533 /* SendScreen.swift in Sources */, 0D1922ED26BDE0C600052649 /* AppRouter.swift in Sources */, 0D1922F226BDE29300052649 /* ZcashSDKStubs.swift in Sources */, + 0DA13C9D26C1942100E3B610 /* BackupWalletScreenViewModel.swift in Sources */, + 0D32281E26C5867D00262533 /* ScanQrScreen.swift in Sources */, + 0DA13C9C26C1942100E3B610 /* BackupWalletScreen.swift in Sources */, + 0DA13C9826C186FF00E3B610 /* RestoreWalletScreenViewModel.swift in Sources */, 0D1922EF26BDE1A300052649 /* Services.swift in Sources */, + 0D32283326C5877A00262533 /* BalanceScreenViewModel.swift in Sources */, + 0D32282326C586A800262533 /* HistoryScreen.swift in Sources */, + 0DA13CA526C1963000E3B610 /* Balance.swift in Sources */, 0D1922F826BDEB3500052649 /* MockServices.swift in Sources */, 0D4E7A0B26B364170058B01E /* ContentView.swift in Sources */, 0D1922F426BDE5F200052649 /* MnemonicSeedPhraseHandling.swift in Sources */, 0D170A7226BC802800EB6A46 /* Router.swift in Sources */, + 0DA13C9726C186FF00E3B610 /* RestoreWalletScreen.swift in Sources */, 0D1922F626BDE74500052649 /* KeyStoring.swift in Sources */, 0D1922EA26BDD96A00052649 /* ViewModel.swift in Sources */, 0D4E7A0926B364170058B01E /* SecantApp.swift in Sources */, + 0D32281A26C5864B00262533 /* ProfileScreenViewModel.swift in Sources */, + 0DA13CA126C1955600E3B610 /* HomeScreen.swift in Sources */, + 0DA13C9026C15D1D00E3B610 /* WelcomeScreenViewModel.swift in Sources */, + 0DA13C8F26C15D1D00E3B610 /* WelcomeScreen.swift in Sources */, + 0DA13C9326C15E2F00E3B610 /* PlainButton.swift in Sources */, + 0D32282826C586E000262533 /* RequestZcashScreen.swift in Sources */, + 0D32283226C5877A00262533 /* BalanceScreen.swift in Sources */, + 0DA13CA226C1955600E3B610 /* HomeScreenViewModel.swift in Sources */, + 0D32282926C586E000262533 /* RequestZcashScreenViewModel.swift in Sources */, + 0D2ACE8326C2C8B400D62E3C /* SwiftUI+secant.swift in Sources */, + 0D32281926C5864B00262533 /* ProfileScreen.swift in Sources */, + 0D32282426C586A800262533 /* HistoryScreenViewModel.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -357,12 +565,12 @@ /* Begin PBXTargetDependency section */ 0D4E7A1826B364180058B01E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 0D4E7A0426B364170058B01E /* secant */; + target = 0D4E7A0426B364170058B01E /* secant-testnet */; targetProxy = 0D4E7A1726B364180058B01E /* PBXContainerItemProxy */; }; 0D4E7A2326B364180058B01E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 0D4E7A0426B364170058B01E /* secant */; + target = 0D4E7A0426B364170058B01E /* secant-testnet */; targetProxy = 0D4E7A2226B364180058B01E /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -491,6 +699,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"secant/Preview Content\""; + DEVELOPMENT_TEAM = RLPRR8CPQG; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = secant/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -498,7 +707,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = co.electriccoin.secant; + PRODUCT_BUNDLE_IDENTIFIER = "co.electriccoin.secant-testnet"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -512,6 +721,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"secant/Preview Content\""; + DEVELOPMENT_TEAM = RLPRR8CPQG; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = secant/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -519,7 +729,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = co.electriccoin.secant; + PRODUCT_BUNDLE_IDENTIFIER = "co.electriccoin.secant-testnet"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -618,7 +828,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 0D4E7A2A26B364180058B01E /* Build configuration list for PBXNativeTarget "secant" */ = { + 0D4E7A2A26B364180058B01E /* Build configuration list for PBXNativeTarget "secant-testnet" */ = { isa = XCConfigurationList; buildConfigurations = ( 0D4E7A2B26B364180058B01E /* Debug */, diff --git a/secant/Fonts/Zboto.otf b/secant/Fonts/Zboto.otf new file mode 100644 index 0000000..e963a36 Binary files /dev/null and b/secant/Fonts/Zboto.otf differ diff --git a/secant/Info.plist b/secant/Info.plist index efc211a..2de9528 100644 --- a/secant/Info.plist +++ b/secant/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Secant Testnet CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -20,6 +22,10 @@ 1 LSRequiresIPhoneOS + UIAppFonts + + Zboto.otf + UIApplicationSceneManifest UIApplicationSupportsMultipleScenes @@ -27,6 +33,12 @@ UIApplicationSupportsIndirectInputEvents + UIBackgroundModes + + fetch + processing + remote-notification + UILaunchScreen UIRequiredDeviceCapabilities diff --git a/secant/Models/Balance.swift b/secant/Models/Balance.swift new file mode 100644 index 0000000..62b65b8 --- /dev/null +++ b/secant/Models/Balance.swift @@ -0,0 +1,101 @@ +// +// Balance.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import Foundation +/** + Funds Expressed in Zatoshis + */ +protocol Funds { + /** + Confirmed, spendable funds + */ + var confirmed: Int64 { get } + /** + Unconfirmed, not yet spendable funds. + */ + var unconfirmed: Int64 { get } + + /** + Represents a null value of Funds with Zero confirmed and Zero unconfirmed funds. + */ + static var noFunds: Funds { get} +} + +/** + Wallet Balance that condenses transpant, Sapling and Orchard funds + */ +protocol WalletBalance { + /** + Transparent funds. This is the sum of the UTXOs of the user found at a given time + */ + var transaparent: Funds { get } + /** + Funds on the Sapling shielded pool for a given user. + */ + var sapling: Funds { get } + /** + Funds on the Orchard shielded pool for a given user. + */ + var orchard: Funds { get } + /** + The sum of all confirmed funds, transparent, sapling and orchard funds (calculated) + */ + var totalAvailableBalance: Int64 { get } + + /** + the sum of all unconfirmed funds: transparent, sapling, and orchard funds (calculated + */ + var totalUnconfirmedBalance: Int64 { get } + + + /** + the sum of all funds confirmed and unconfirmed of all pools (transparent, sapling and orchard). + */ + var totalBalance: Int64 { get } + + /** + represents a the value of Zero funds. + */ + static var nullBalance: WalletBalance { get } +} + + +/** + Concrete Wallet Balance. + */ +struct Balance: WalletBalance { + var transaparent: Funds + var sapling: Funds + var orchard: Funds +} + +struct ZcashFunds: Funds { + static var noFunds: Funds { + ZcashFunds(confirmed: 0, unconfirmed: 0) + } + var confirmed: Int64 + var unconfirmed: Int64 + +} + +extension WalletBalance { + static var nullBalance: WalletBalance { + Balance(transaparent: ZcashFunds.noFunds, sapling: ZcashFunds.noFunds, orchard: ZcashFunds.noFunds) + } + + var totalAvailableBalance: Int64 { + transaparent.confirmed + sapling.confirmed + orchard.confirmed + } + + var totalUnconfirmedBalance: Int64 { + transaparent.unconfirmed + sapling.unconfirmed + orchard.unconfirmed + } + + var totalBalance: Int64 { + totalAvailableBalance + totalUnconfirmedBalance + } +} diff --git a/secant/Screens/Backup Wallet/BackupWalletScreen.swift b/secant/Screens/Backup Wallet/BackupWalletScreen.swift new file mode 100644 index 0000000..ce9c172 --- /dev/null +++ b/secant/Screens/Backup Wallet/BackupWalletScreen.swift @@ -0,0 +1,27 @@ +// +// BackupWalletScreen.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import SwiftUI + +protocol BackupWalletScreenRouter: AnyObject { +} + +struct BackupWalletScreen: View { + @State var router: BackupWalletScreenRouter? + + @ObservedObject var viewModel: BackupWalletScreenViewModel + + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct BackupWalletScreenPreviews: PreviewProvider { + static var previews: some View { + BackupWalletScreen(viewModel: BackupWalletScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/Backup Wallet/BackupWalletScreenViewModel.swift b/secant/Screens/Backup Wallet/BackupWalletScreenViewModel.swift new file mode 100644 index 0000000..000ae11 --- /dev/null +++ b/secant/Screens/Backup Wallet/BackupWalletScreenViewModel.swift @@ -0,0 +1,13 @@ +// +// BackupWalletScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import Foundation +import Combine + +class BackupWalletScreenViewModel: BaseViewModel, ObservableObject { + +} diff --git a/secant/Screens/Balance/BalanceScreen.swift b/secant/Screens/Balance/BalanceScreen.swift new file mode 100644 index 0000000..0f9f9f7 --- /dev/null +++ b/secant/Screens/Balance/BalanceScreen.swift @@ -0,0 +1,27 @@ +// +// BalanceScreenScreen.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import SwiftUI + +protocol BalanceScreenRouter: AnyObject { +} + +struct BalanceScreen: View { + @State var router: BalanceScreenRouter? + + @ObservedObject var viewModel: BalanceScreenViewModel + + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct BalanceScreenPreviews: PreviewProvider { + static var previews: some View { + BalanceScreen(viewModel: BalanceScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/Balance/BalanceScreenViewModel.swift b/secant/Screens/Balance/BalanceScreenViewModel.swift new file mode 100644 index 0000000..3c1ffc7 --- /dev/null +++ b/secant/Screens/Balance/BalanceScreenViewModel.swift @@ -0,0 +1,13 @@ +// +// BalanceScreenScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import Foundation +import Combine + +class BalanceScreenViewModel: BaseViewModel, ObservableObject { + +} diff --git a/secant/Screens/History/HistoryScreen.swift b/secant/Screens/History/HistoryScreen.swift new file mode 100644 index 0000000..6aed7a2 --- /dev/null +++ b/secant/Screens/History/HistoryScreen.swift @@ -0,0 +1,27 @@ +// +// HistoryScreen.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import SwiftUI + +protocol HistoryScreenRouter: AnyObject { +} + +struct HistoryScreen: View { + @State var router: HistoryScreenRouter? + + @ObservedObject var viewModel: HistoryScreenViewModel + + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct HistoryScreenPreviews: PreviewProvider { + static var previews: some View { + HistoryScreen(viewModel: HistoryScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/History/HistoryScreenViewModel.swift b/secant/Screens/History/HistoryScreenViewModel.swift new file mode 100644 index 0000000..07a01d7 --- /dev/null +++ b/secant/Screens/History/HistoryScreenViewModel.swift @@ -0,0 +1,13 @@ +// +// HistoryScreenScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import Foundation +import Combine + +class HistoryScreenViewModel: BaseViewModel, ObservableObject { + +} diff --git a/secant/Screens/Home/HomeScreen.swift b/secant/Screens/Home/HomeScreen.swift new file mode 100644 index 0000000..7406b3d --- /dev/null +++ b/secant/Screens/Home/HomeScreen.swift @@ -0,0 +1,87 @@ +// +// HomeScreen.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import SwiftUI + +protocol HomeScreenRouter: AnyObject { + func homeScreenScanQrScreen() -> ScanQrScreen + func homeScreenProfileScreen() -> ProfileScreen + func homeScreenHistoryScreen() -> HistoryScreen + func homeScreenBalanceScreen() -> BalanceScreen + func homeScreenRequestScreen() -> RequestZcashScreen + func homeScreenSendScreen() -> SendScreen +} + +struct HomeScreen: View { + @State var router: HomeScreenRouter? + + @ObservedObject var viewModel: HomeScreenViewModel + + var body: some View { + VStack { + Text("Hello, World!") + sendButton + requestButton + historyButton + } + .padding(.horizontal, 30) + .navigationBarTitle("", displayMode: .inline) + .navigationBarItems( + leading: qrCodeButton, + trailing: profileButton) + } + + @ViewBuilder var qrCodeButton: some View { + Button(action: {}, label: { + Image(systemName: "qrcode.viewfinder") + .frame(width: 20, height: 20, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) + }) + .contentShape(Circle()) + + } + + @ViewBuilder var profileButton: some View { + Button(action: {}, label: { + Image(systemName: "person.crop.circle") + .frame(width: 20, height: 20, alignment: .center) + }) + .contentShape(Circle()) + } + + @ViewBuilder var requestButton: some View { + Button(action: {}, label: { + Text("Request ZEC") + }) + .buttonStyle(PlainButton()) + } + + @ViewBuilder var sendButton: some View { + Button(action: {}, label: { + Text("Send ZEC") + }) + .buttonStyle(PlainButton()) + } + + @ViewBuilder var historyButton: some View { + Button(action: {}, label: { + Text("History") + }) + .buttonStyle(PlainButton(style: .light)) + } +} + +struct HomeScreenPreviews: PreviewProvider { + static var previews: some View { + NavigationView { + HomeScreen(viewModel: HomeScreenViewModel.mockWithValues(services: MockServices(), status: .offline, balance: mockBalance, fiatConversion: 1.12453)) + } + } + + static var mockBalance: WalletBalance { + Balance(transaparent: ZcashFunds.noFunds, sapling: ZcashFunds(confirmed: 123456790, unconfirmed: 0), orchard: ZcashFunds(confirmed: 0, unconfirmed: 0)) + } +} diff --git a/secant/Screens/Home/HomeScreenViewModel.swift b/secant/Screens/Home/HomeScreenViewModel.swift new file mode 100644 index 0000000..8da629b --- /dev/null +++ b/secant/Screens/Home/HomeScreenViewModel.swift @@ -0,0 +1,37 @@ +// +// HomeScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import Foundation +import Combine + +class HomeScreenViewModel: BaseViewModel, ObservableObject { + enum Status { + case syncing(progress: Float) + case offline + case error(error: Error) + } + + @Published var balance: WalletBalance = Balance.nullBalance + + @Published var fiatConversion: Decimal = 0 + + @Published var status = Status.offline + +} + +extension HomeScreenViewModel { + static func mockWithValues(services: Services, + status: Status, + balance: WalletBalance, + fiatConversion: Decimal) -> HomeScreenViewModel { + let vm = HomeScreenViewModel(services: services) + vm.status = status + vm.balance = balance + vm.fiatConversion = fiatConversion + return vm + } +} diff --git a/secant/Screens/Profile/ProfileScreen.swift b/secant/Screens/Profile/ProfileScreen.swift new file mode 100644 index 0000000..eb5ff1a --- /dev/null +++ b/secant/Screens/Profile/ProfileScreen.swift @@ -0,0 +1,27 @@ +// +// ProfileScreenScreen.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import SwiftUI + +protocol ProfileScreenRouter: AnyObject { +} + +struct ProfileScreen: View { + @State var router: ProfileScreenRouter? + + @ObservedObject var viewModel: ProfileScreenViewModel + + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct ProfileScreenPreviews: PreviewProvider { + static var previews: some View { + ProfileScreen(viewModel: ProfileScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/Profile/ProfileScreenViewModel.swift b/secant/Screens/Profile/ProfileScreenViewModel.swift new file mode 100644 index 0000000..c5bdd0d --- /dev/null +++ b/secant/Screens/Profile/ProfileScreenViewModel.swift @@ -0,0 +1,13 @@ +// +// ProfileScreenScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import Foundation +import Combine + +class ProfileScreenViewModel: BaseViewModel, ObservableObject { + +} diff --git a/secant/Screens/Request ZEC/RequestZcashScreen.swift b/secant/Screens/Request ZEC/RequestZcashScreen.swift new file mode 100644 index 0000000..1686722 --- /dev/null +++ b/secant/Screens/Request ZEC/RequestZcashScreen.swift @@ -0,0 +1,27 @@ +// +// RequestZcashScreen.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import SwiftUI + +protocol RequestZcashScreenRouter: AnyObject { +} + +struct RequestZcashScreen: View { + @State var router: RequestZcashScreenRouter? + + @ObservedObject var viewModel: RequestZcashScreenViewModel + + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct RequestZcashScreenPreviews: PreviewProvider { + static var previews: some View { + RequestZcashScreen(viewModel: RequestZcashScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/Request ZEC/RequestZcashScreenViewModel.swift b/secant/Screens/Request ZEC/RequestZcashScreenViewModel.swift new file mode 100644 index 0000000..1e62f43 --- /dev/null +++ b/secant/Screens/Request ZEC/RequestZcashScreenViewModel.swift @@ -0,0 +1,13 @@ +// +// RequestZcashScreenScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import Foundation +import Combine + +class RequestZcashScreenViewModel: BaseViewModel, ObservableObject { + +} diff --git a/secant/Screens/Restore Wallet/RestoreWalletScreen.swift b/secant/Screens/Restore Wallet/RestoreWalletScreen.swift new file mode 100644 index 0000000..5da48ea --- /dev/null +++ b/secant/Screens/Restore Wallet/RestoreWalletScreen.swift @@ -0,0 +1,39 @@ +// +// RestoreWalletScreen.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import SwiftUI + +protocol RestoreWalletScreenRouter: AnyObject { +} + +struct RestoreWalletScreen: View { + @State var router: RestoreWalletScreenRouter? + + @ObservedObject var viewModel: RestoreWalletScreenViewModel + + var body: some View { + VStack { + Text("Enter Seed Phrase") + + TextEditor(text: $viewModel.seedText) + + Button(action: {}, label: { + Text("Restore Seed Phrase") + }) + .buttonStyle(PlainButton()) + } + .padding(.horizontal, 30) + .padding(.vertical) + .navigationBarTitle(Text("Restore Wallet"), displayMode: .inline) + } +} + +struct RestoreWalletScreenPreviews: PreviewProvider { + static var previews: some View { + RestoreWalletScreen(viewModel: RestoreWalletScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/Restore Wallet/RestoreWalletScreenViewModel.swift b/secant/Screens/Restore Wallet/RestoreWalletScreenViewModel.swift new file mode 100644 index 0000000..7b8f6c4 --- /dev/null +++ b/secant/Screens/Restore Wallet/RestoreWalletScreenViewModel.swift @@ -0,0 +1,16 @@ +// +// RestoreWalletScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import Foundation +import Combine + +class RestoreWalletScreenViewModel: BaseViewModel, ObservableObject { + + @Published var seedText: String = "" + + func restore() {} +} diff --git a/secant/Screens/Scan/ScanQrScreen.swift b/secant/Screens/Scan/ScanQrScreen.swift new file mode 100644 index 0000000..fa75f08 --- /dev/null +++ b/secant/Screens/Scan/ScanQrScreen.swift @@ -0,0 +1,27 @@ +// +// ScanQrScreenScreen.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import SwiftUI + +protocol ScanQrScreenRouter: AnyObject { +} + +struct ScanQrScreen: View { + @State var router: ScanQrScreenRouter? + + @ObservedObject var viewModel: ScanQrScreenViewModel + + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct ScanQrScreenScreenPreviews: PreviewProvider { + static var previews: some View { + ScanQrScreen(viewModel: ScanQrScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/Scan/ScanQrScreenViewModel.swift b/secant/Screens/Scan/ScanQrScreenViewModel.swift new file mode 100644 index 0000000..51f956c --- /dev/null +++ b/secant/Screens/Scan/ScanQrScreenViewModel.swift @@ -0,0 +1,13 @@ +// +// ScanQrScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import Foundation +import Combine + +class ScanQrScreenViewModel: BaseViewModel, ObservableObject { + +} diff --git a/secant/Screens/Send ZEC/SendScreen.swift b/secant/Screens/Send ZEC/SendScreen.swift new file mode 100644 index 0000000..4f4a0e1 --- /dev/null +++ b/secant/Screens/Send ZEC/SendScreen.swift @@ -0,0 +1,27 @@ +// +// SendScreenScreen.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import SwiftUI + +protocol SendScreenRouter: AnyObject { +} + +struct SendScreen: View { + @State var router: SendScreenRouter? + + @ObservedObject var viewModel: SendScreenViewModel + + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct SendScreenScreenPreviews: PreviewProvider { + static var previews: some View { + SendScreen(viewModel: SendScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/Send ZEC/SendScreenViewModel.swift b/secant/Screens/Send ZEC/SendScreenViewModel.swift new file mode 100644 index 0000000..852621d --- /dev/null +++ b/secant/Screens/Send ZEC/SendScreenViewModel.swift @@ -0,0 +1,13 @@ +// +// SendScreenScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/12/21. +// + +import Foundation +import Combine + +class SendScreenViewModel: BaseViewModel, ObservableObject { + +} diff --git a/secant/Screens/Welcome Screen/WelcomeScreen.swift b/secant/Screens/Welcome Screen/WelcomeScreen.swift new file mode 100644 index 0000000..c9dae8b --- /dev/null +++ b/secant/Screens/Welcome Screen/WelcomeScreen.swift @@ -0,0 +1,50 @@ +// +// CreateNewWalletScreen.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import SwiftUI + +protocol WelcomeScreenRouter: AnyObject { + +} + +struct WelcomeScreen: View { + @State var router: WelcomeScreenRouter? + + @ObservedObject var viewModel: WelcomeScreenViewModel + + var body: some View { + VStack { + + Spacer() + Text("Welcome and Onboarding") + Spacer() + + VStack(alignment: .center, spacing: 16) { + Button(action: { + self.viewModel.restoreWallet() + }, label: { + Text("RESTORE WALLET") + }) + .buttonStyle(PlainButton()) + + Button(action: { + self.viewModel.createNew() + }, label: { + Text("CREATE NEW WALLET") + }) + .buttonStyle(PlainButton()) + } + } + .padding() + } +} + +struct CreateNewWalletScreenPreviews: PreviewProvider { + static var previews: some View { + WelcomeScreen(viewModel: WelcomeScreenViewModel(services: MockServices())) + } +} diff --git a/secant/Screens/Welcome Screen/WelcomeScreenViewModel.swift b/secant/Screens/Welcome Screen/WelcomeScreenViewModel.swift new file mode 100644 index 0000000..169b477 --- /dev/null +++ b/secant/Screens/Welcome Screen/WelcomeScreenViewModel.swift @@ -0,0 +1,15 @@ +// +// CreateNewWalletScreenViewModel.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import Foundation +import Combine + +class WelcomeScreenViewModel: BaseViewModel, ObservableObject { + + func createNew() {} + func restoreWallet() {} +} diff --git a/secant/SecantApp.swift b/secant/SecantApp.swift index eb73db6..7a63e93 100644 --- a/secant/SecantApp.swift +++ b/secant/SecantApp.swift @@ -10,7 +10,7 @@ import SwiftUI @main struct SecantApp: App { - @StateObject var appRouter = AppRouter(services: MockAppServices()) + @StateObject var appRouter = AppRouter(services: MockServices()) var body: some Scene { WindowGroup { appRouter.rootView() diff --git a/secant/Stubs/MockServices.swift b/secant/Stubs/MockServices.swift index d761717..d518dd3 100644 --- a/secant/Stubs/MockServices.swift +++ b/secant/Stubs/MockServices.swift @@ -7,7 +7,7 @@ import Foundation -class MockAppServices: Services { +class MockServices: Services { init(){} var networkProvider: ZcashNetworkProvider { MockNetworkProvider() diff --git a/secant/UI Components/PlainButton.swift b/secant/UI Components/PlainButton.swift new file mode 100644 index 0000000..af45fee --- /dev/null +++ b/secant/UI Components/PlainButton.swift @@ -0,0 +1,62 @@ +// +// PlainButton.swift +// secant +// +// Created by Francisco Gindre on 8/9/21. +// + +import SwiftUI + +struct PlainButton: ButtonStyle { + enum Theme { + case light + case bold + } + + var style = Theme.bold + + func makeBody(configuration: Configuration) -> some View { + configuration.label + .foregroundColor(style.foregroundColor) + .padding() + .frame(minWidth: 0, maxWidth: .infinity, minHeight: 48, maxHeight: 48) + .background(style.background) + } +} + +struct PlainButton_Previews: PreviewProvider { + static var previews: some View { + VStack { + Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: { + /*@START_MENU_TOKEN@*/Text("Button")/*@END_MENU_TOKEN@*/ + }) + .buttonStyle(PlainButton()) + + Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: { + /*@START_MENU_TOKEN@*/Text("Button")/*@END_MENU_TOKEN@*/ + }) + .buttonStyle(PlainButton(style: .bold)) + } + .padding(.horizontal, 30) + } +} + +extension PlainButton.Theme { + var background: some View { + switch self { + case .bold: + return Color.black + default: + return Color.white + } + } + + var foregroundColor: Color { + switch self { + case .bold: + return Color.white + default: + return Color.black + } + } +} diff --git a/secant/Utilities/SwiftUI+secant.swift b/secant/Utilities/SwiftUI+secant.swift new file mode 100644 index 0000000..1c7002c --- /dev/null +++ b/secant/Utilities/SwiftUI+secant.swift @@ -0,0 +1,16 @@ +// +// SwiftUI+secant.swift +// secant +// +// Created by Francisco Gindre on 8/10/21. +// + +import Foundation +import SwiftUI + + +extension Font { + static func zboto(_ size: CGFloat) -> Font { + Font.custom("Zboto", size: size) + } +}