From 6e3bb1d322842607ac42cf46355082732f645730 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Fri, 8 Jul 2022 21:13:46 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20onboarding=20sample?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PHP Monitor.xcodeproj/project.pbxproj | 12 +++++ phpmon/Domain/SwiftUI/Menu/ServicesView.swift | 4 +- .../SwiftUI/Onboarding/OnboardingView.swift | 50 +++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 phpmon/Domain/SwiftUI/Onboarding/OnboardingView.swift diff --git a/PHP Monitor.xcodeproj/project.pbxproj b/PHP Monitor.xcodeproj/project.pbxproj index 332d8f2..18644f8 100644 --- a/PHP Monitor.xcodeproj/project.pbxproj +++ b/PHP Monitor.xcodeproj/project.pbxproj @@ -226,6 +226,7 @@ C4E0F7EE27BEBDA9007475F2 /* NSWindowExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4E0F7EC27BEBDA9007475F2 /* NSWindowExtension.swift */; }; C4E4404627C56F4700D225E1 /* ValetSite.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4E4404527C56F4700D225E1 /* ValetSite.swift */; }; C4E4404727C56F4700D225E1 /* ValetSite.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4E4404527C56F4700D225E1 /* ValetSite.swift */; }; + C4E9D2C02878B336008FFDAD /* OnboardingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4E9D2BF2878B336008FFDAD /* OnboardingView.swift */; }; C4EB53E528551F9B006F9937 /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4EB53E428551F9B006F9937 /* HeaderView.swift */; }; C4EB53E728553117006F9937 /* ArrayExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4EB53E628553117006F9937 /* ArrayExtension.swift */; }; C4EC1E73279DFCF40010F296 /* Events.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4EC1E72279DFCF40010F296 /* Events.swift */; }; @@ -420,6 +421,7 @@ C4E4404527C56F4700D225E1 /* ValetSite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValetSite.swift; sourceTree = ""; }; C4E713562570150F00007428 /* SECURITY.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = SECURITY.md; sourceTree = ""; }; C4E713572570151400007428 /* docs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = docs; sourceTree = ""; }; + C4E9D2BF2878B336008FFDAD /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = ""; }; C4EB53E428551F9B006F9937 /* HeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = ""; }; C4EB53E628553117006F9937 /* ArrayExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayExtension.swift; sourceTree = ""; }; C4EC1E72279DFCF40010F296 /* Events.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Events.swift; sourceTree = ""; }; @@ -1005,9 +1007,18 @@ path = Switcher; sourceTree = ""; }; + C4E9D2BE2878B32D008FFDAD /* Onboarding */ = { + isa = PBXGroup; + children = ( + C4E9D2BF2878B336008FFDAD /* OnboardingView.swift */, + ); + path = Onboarding; + sourceTree = ""; + }; C4EE55B027708BB2001DF387 /* SwiftUI */ = { isa = PBXGroup; children = ( + C4E9D2BE2878B32D008FFDAD /* Onboarding */, C4B609182853AAA700C95265 /* Domains */, C4B609172853AA9E00C95265 /* Menu */, C4B609162853AA9A00C95265 /* Common */, @@ -1228,6 +1239,7 @@ C41C02A927E61A65009F26CB /* ValetSite+Fake.swift in Sources */, C4C0E8DF27F88AEB002D32A9 /* FakeSiteScanner.swift in Sources */, C44264BE2850B86C007400F1 /* SwiftUIHelper.swift in Sources */, + C4E9D2C02878B336008FFDAD /* OnboardingView.swift in Sources */, C4F2E4372752F0870020E974 /* HomebrewDiagnostics.swift in Sources */, C4EB53E528551F9B006F9937 /* HeaderView.swift in Sources */, C40FE737282ABA4F00A302C2 /* AppVersion.swift in Sources */, diff --git a/phpmon/Domain/SwiftUI/Menu/ServicesView.swift b/phpmon/Domain/SwiftUI/Menu/ServicesView.swift index cfe8d5d..db87a04 100644 --- a/phpmon/Domain/SwiftUI/Menu/ServicesView.swift +++ b/phpmon/Domain/SwiftUI/Menu/ServicesView.swift @@ -56,7 +56,9 @@ struct ServicesView: View { }.frame(minWidth: 0, maxWidth: .infinity) } else { // Empty cell - VStack { EmptyView() }.frame(minWidth: 0, maxWidth: .infinity) + VStack { + EmptyView() + }.frame(minWidth: 0, maxWidth: .infinity) } } } diff --git a/phpmon/Domain/SwiftUI/Onboarding/OnboardingView.swift b/phpmon/Domain/SwiftUI/Onboarding/OnboardingView.swift new file mode 100644 index 0000000..1003b90 --- /dev/null +++ b/phpmon/Domain/SwiftUI/Onboarding/OnboardingView.swift @@ -0,0 +1,50 @@ +// +// OnboardingView.swift +// PHP Monitor +// +// Created by Nico Verbruggen on 08/07/2022. +// Copyright © 2022 Nico Verbruggen. All rights reserved. +// + +import SwiftUI + +struct OnboardingView: View { + var body: some View { + HStack(alignment: .top) { + Image(nsImage: NSApp.applicationIconImage) + .resizable() + .padding() + .frame(width: 120, height: 120) + VStack(alignment: .leading) { + Text("Welcome to PHP Monitor!") + .font(.title) + .bold() + .padding(.bottom, 5) + Text("If you're seeing this message, then the app has successfully started without any issues. That's honestly the hardest part — from now on I hope it's smooth sailing for you.") + .padding(.bottom) + VStack(alignment: .leading) { + Text("Switch PHP versions").font(.headline) + Text("Manage your domains").font(.headline) + Text("Domain-specific PHP version isolation").font(.headline) + Text("Find your configuration files").font(.headline) + } + Text("I hope you find the app as useful as I do. Enjoy, and if you can, please consider supporting the app. Thank you!") + .padding(.top) + .padding(.bottom) + VStack(alignment: .leading) { + Button("Get Started") { + // + } + } + }.frame(maxWidth: .infinity) + }.padding(20) + } +} + +struct OnboardingView_Previews: PreviewProvider { + static var previews: some View { + OnboardingView().frame( + width: 600 + ) + } +}