diff --git a/wulkanowy.xcodeproj/project.pbxproj b/wulkanowy.xcodeproj/project.pbxproj index d37f6f0..a43548e 100644 --- a/wulkanowy.xcodeproj/project.pbxproj +++ b/wulkanowy.xcodeproj/project.pbxproj @@ -9,10 +9,12 @@ /* Begin PBXBuildFile section */ 5C478F3525DC742100ABEFB7 /* VulcanStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C478F3425DC742100ABEFB7 /* VulcanStore.swift */; }; 5C9B6F4925D6C08D00C3F5F5 /* Sdk in Frameworks */ = {isa = PBXBuildFile; productRef = 5C9B6F4825D6C08D00C3F5F5 /* Sdk */; }; + 5CC2EAA525E516F100B6183E /* Dashboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CC2EAA425E516F100B6183E /* Dashboard.swift */; }; + 5CC2EAAE25E526B500B6183E /* navigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CC2EAAD25E526B500B6183E /* navigation.swift */; }; 5CCAE31625DA4CDD00D87580 /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = 5CCAE31525DA4CDD00D87580 /* OpenSSL */; }; 5CEA516B25D540B900DB45BD /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5CEA516D25D540B900DB45BD /* Localizable.strings */; }; F4C6D9082544E17400F8903A /* wulkanowyApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4C6D9072544E17400F8903A /* wulkanowyApp.swift */; }; - F4C6D90A2544E17400F8903A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4C6D9092544E17400F8903A /* ContentView.swift */; }; + F4C6D90A2544E17400F8903A /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4C6D9092544E17400F8903A /* LoginView.swift */; }; F4C6D90C2544E17500F8903A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4C6D90B2544E17500F8903A /* Assets.xcassets */; }; F4C6D90F2544E17500F8903A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4C6D90E2544E17500F8903A /* Preview Assets.xcassets */; }; F4C6D91A2544E17500F8903A /* wulkanowyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4C6D9192544E17500F8903A /* wulkanowyTests.swift */; }; @@ -63,11 +65,13 @@ 5C478F3425DC742100ABEFB7 /* VulcanStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VulcanStore.swift; sourceTree = ""; }; 5C9B6E4925D6ADFB00C3F5F5 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; 5C9B6F4525D6C06D00C3F5F5 /* Sdk */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Sdk; sourceTree = ""; }; + 5CC2EAA425E516F100B6183E /* Dashboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dashboard.swift; sourceTree = ""; }; + 5CC2EAAD25E526B500B6183E /* navigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = navigation.swift; sourceTree = ""; }; 5CEA516C25D540B900DB45BD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 5CF81BD725D9D44400B12C4C /* pl-PL */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pl-PL"; path = "pl-PL.lproj/Localizable.strings"; sourceTree = ""; }; F4C6D9042544E17400F8903A /* wulkanowy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = wulkanowy.app; sourceTree = BUILT_PRODUCTS_DIR; }; F4C6D9072544E17400F8903A /* wulkanowyApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = wulkanowyApp.swift; sourceTree = ""; }; - F4C6D9092544E17400F8903A /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + F4C6D9092544E17400F8903A /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = ""; }; F4C6D90B2544E17500F8903A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; F4C6D90E2544E17500F8903A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; F4C6D9102544E17500F8903A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -106,6 +110,40 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 5C1B848625E1B6740074F29D /* App */ = { + isa = PBXGroup; + children = ( + F4C6D9072544E17400F8903A /* wulkanowyApp.swift */, + ); + path = App; + sourceTree = ""; + }; + 5C1B848925E1B6910074F29D /* Views */ = { + isa = PBXGroup; + children = ( + 5CC2EAAC25E5269E00B6183E /* Navigation */, + 5CC2EAA325E516DD00B6183E /* Content */, + 5C1B849F25E1B7A30074F29D /* Login */, + ); + path = Views; + sourceTree = ""; + }; + 5C1B848E25E1B6FA0074F29D /* Resources */ = { + isa = PBXGroup; + children = ( + 5CEA516D25D540B900DB45BD /* Localizable.strings */, + ); + path = Resources; + sourceTree = ""; + }; + 5C1B849F25E1B7A30074F29D /* Login */ = { + isa = PBXGroup; + children = ( + F4C6D9092544E17400F8903A /* LoginView.swift */, + ); + path = Login; + sourceTree = ""; + }; 5C9B6E4825D6ADFB00C3F5F5 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -114,6 +152,22 @@ name = Frameworks; sourceTree = ""; }; + 5CC2EAA325E516DD00B6183E /* Content */ = { + isa = PBXGroup; + children = ( + 5CC2EAA425E516F100B6183E /* Dashboard.swift */, + ); + path = Content; + sourceTree = ""; + }; + 5CC2EAAC25E5269E00B6183E /* Navigation */ = { + isa = PBXGroup; + children = ( + 5CC2EAAD25E526B500B6183E /* navigation.swift */, + ); + path = Navigation; + sourceTree = ""; + }; F4C6D8FB2544E17300F8903A = { isa = PBXGroup; children = ( @@ -139,12 +193,12 @@ F4C6D9062544E17400F8903A /* wulkanowy */ = { isa = PBXGroup; children = ( - F4C6D9072544E17400F8903A /* wulkanowyApp.swift */, - F4C6D9092544E17400F8903A /* ContentView.swift */, + 5C1B848E25E1B6FA0074F29D /* Resources */, + 5C1B848925E1B6910074F29D /* Views */, + 5C1B848625E1B6740074F29D /* App */, F4C6D90B2544E17500F8903A /* Assets.xcassets */, F4C6D9102544E17500F8903A /* Info.plist */, F4C6D90D2544E17500F8903A /* Preview Content */, - 5CEA516D25D540B900DB45BD /* Localizable.strings */, 5C478F3425DC742100ABEFB7 /* VulcanStore.swift */, ); path = wulkanowy; @@ -317,7 +371,9 @@ buildActionMask = 2147483647; files = ( 5C478F3525DC742100ABEFB7 /* VulcanStore.swift in Sources */, - F4C6D90A2544E17400F8903A /* ContentView.swift in Sources */, + F4C6D90A2544E17400F8903A /* LoginView.swift in Sources */, + 5CC2EAAE25E526B500B6183E /* navigation.swift in Sources */, + 5CC2EAA525E516F100B6183E /* Dashboard.swift in Sources */, F4C6D9082544E17400F8903A /* wulkanowyApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/wulkanowy/.DS_Store b/wulkanowy/.DS_Store index 9230ab7..4624469 100644 Binary files a/wulkanowy/.DS_Store and b/wulkanowy/.DS_Store differ diff --git a/wulkanowy/wulkanowyApp.swift b/wulkanowy/App/wulkanowyApp.swift similarity index 87% rename from wulkanowy/wulkanowyApp.swift rename to wulkanowy/App/wulkanowyApp.swift index f9719d9..6f4f4be 100644 --- a/wulkanowy/wulkanowyApp.swift +++ b/wulkanowy/App/wulkanowyApp.swift @@ -13,7 +13,7 @@ import Combine struct wulkanowyApp: App { var body: some Scene { WindowGroup { - ContentView() + NavigationBarView() } } } diff --git a/wulkanowy/en.lproj/Localizable.strings b/wulkanowy/Resources/en.lproj/Localizable.strings similarity index 100% rename from wulkanowy/en.lproj/Localizable.strings rename to wulkanowy/Resources/en.lproj/Localizable.strings diff --git a/wulkanowy/pl-PL.lproj/Localizable.strings b/wulkanowy/Resources/pl-PL.lproj/Localizable.strings similarity index 100% rename from wulkanowy/pl-PL.lproj/Localizable.strings rename to wulkanowy/Resources/pl-PL.lproj/Localizable.strings diff --git a/wulkanowy/Views/Content/Dashboard.swift b/wulkanowy/Views/Content/Dashboard.swift new file mode 100644 index 0000000..c270d9b --- /dev/null +++ b/wulkanowy/Views/Content/Dashboard.swift @@ -0,0 +1,34 @@ +// +// Dashboard.swift +// wulkanowy +// +// Created by Tomasz on 23/02/2021. +// + +import SwiftUI + +struct DashboardView: View { + var body: some View { + NavigationView { + VStack { + Text("You are not logged in") + NavigationLink(destination: LoginView()) { + Text("Log in") + } + + } + } + } +} + + + +struct DashboardView_Previews: PreviewProvider { + static var previews: some View { + Group { + DashboardView() + } + .preferredColorScheme(.dark) + } +} + diff --git a/wulkanowy/ContentView.swift b/wulkanowy/Views/Login/LoginView.swift similarity index 95% rename from wulkanowy/ContentView.swift rename to wulkanowy/Views/Login/LoginView.swift index 26d5711..b3a8c41 100644 --- a/wulkanowy/ContentView.swift +++ b/wulkanowy/Views/Login/LoginView.swift @@ -14,7 +14,7 @@ enum AvailableEndpoints: String, CaseIterable { } -struct ContentView: View { +struct LoginView: View { @StateObject var vulcan: VulcanStore = VulcanStore.shared @@ -26,6 +26,7 @@ struct ContentView: View { @State private var clicked: Bool = false @State private var buttonValue = String(format: NSLocalizedString("loginButton", comment: "loginButton")) @State private var loginStatus: String = "" + @State private var willMoveToNextScreen = false let cellHeight: CGFloat = 55 let cornerRadius: CGFloat = 12 @@ -54,7 +55,7 @@ struct ContentView: View { } } else { print("success") - buttonValue = String(format: NSLocalizedString("success", comment: "loginButton")) + } } @@ -116,8 +117,6 @@ struct ContentView: View { .font(.largeTitle) .fontWeight(.semibold) } - .padding(.top, 50) - .padding(.bottom, -50) Spacer() @@ -182,16 +181,16 @@ struct ContentView: View { .frame(maxWidth: .infinity) .background(Color.accentColor.opacity(0.1)) .cornerRadius(cornerRadius) + Spacer() } .padding() } } - -struct ContentView_Previews: PreviewProvider { +struct LoginView_Previews: PreviewProvider { static var previews: some View { Group { - ContentView() + LoginView() } .preferredColorScheme(.dark) } diff --git a/wulkanowy/Views/Navigation/navigation.swift b/wulkanowy/Views/Navigation/navigation.swift new file mode 100644 index 0000000..dfd3696 --- /dev/null +++ b/wulkanowy/Views/Navigation/navigation.swift @@ -0,0 +1,31 @@ +// +// navigation.swift +// wulkanowy +// +// Created by Tomasz on 23/02/2021. +// + +import SwiftUI + +struct NavigationBarView: View { + var body: some View { + TabView { + DashboardView() + .tabItem { + Label("Grades", systemImage: "rosette") + .accessibility(label: Text("Grades")) + } + } + } +} + + +struct NavigationBarView_Previews: PreviewProvider { + static var previews: some View { + Group { + NavigationBarView() + } + .preferredColorScheme(.dark) + } +} +