1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

👌 Tweak onboarding for Valet-less users

This commit is contained in:
2023-02-26 22:50:55 +01:00
parent 47d921547f
commit d679c7e75c
2 changed files with 45 additions and 28 deletions

View File

@ -12,30 +12,36 @@ struct OnboardingTextItem: View {
@State var icon: String
@State var title: String
@State var description: String
@State var unavailable: Bool = false
var body: some View {
ZStack {
HStack(alignment: .top, spacing: 5) {
Image(systemName: icon)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 24, height: 24)
.foregroundColor(Color.appPrimary)
.foregroundColor(unavailable ? .gray : Color.appPrimary)
.padding(.trailing, 10)
.opacity(self.unavailable ? 0.2 : 1)
VStack(alignment: .leading, spacing: 4) {
Text(title.localizedForSwiftUI)
.font(.system(size: 14))
.lineLimit(3)
.opacity(self.unavailable ? 0.5 : 1)
Text(description.localizedForSwiftUI)
.foregroundColor(Color.secondary)
.font(.system(size: 13))
.lineLimit(4)
.fixedSize(horizontal: false, vertical: true)
.frame(minWidth: 0, maxWidth: 800, alignment: .leading)
.opacity(self.unavailable ? 0.5 : 1)
}
}
.padding()
.overlay(RoundedRectangle(cornerRadius: 5)
.stroke(Color.gray.opacity(0.3), lineWidth: 1))
.stroke(Color.gray.opacity(self.unavailable ? 0.1 : 0.3), lineWidth: 1))
}
}
}
@ -53,7 +59,11 @@ struct OnboardingView: View {
.font(.title)
.bold()
.padding(.bottom, 5)
Text("onboarding.explore".localized)
Text(
Valet.installed
? "onboarding.explore".localized
: "onboarding.explore.lite".localized
)
.padding(.bottom)
.padding(.trailing)
}
@ -72,17 +82,20 @@ struct OnboardingView: View {
OnboardingTextItem(
icon: "checkmark.circle.fill",
title: "onboarding.tour.services.title",
description: "onboarding.tour.services"
description: "onboarding.tour.services",
unavailable: !Valet.installed
)
OnboardingTextItem(
icon: "list.bullet.circle.fill",
title: "onboarding.tour.domains.title",
description: "onboarding.tour.domains"
description: "onboarding.tour.domains",
unavailable: !Valet.installed
)
OnboardingTextItem(
icon: "pin.circle.fill",
title: "onboarding.tour.isolation.title",
description: "onboarding.tour.isolation"
description: "onboarding.tour.isolation",
unavailable: !Valet.installed
)
}
}.padding()
@ -111,6 +124,8 @@ struct OnboardingView: View {
Button("onboarding.tour.close".localized) {
App.shared.onboardingWindowController?.close()
}
.padding(.bottom, 5)
.padding(.top, 10)
}
}
.padding(.leading)
@ -123,7 +138,6 @@ struct OnboardingView_Previews: PreviewProvider {
static var previews: some View {
Group {
OnboardingView()
OnboardingView().preferredColorScheme(.dark)
}
}
}

View File

@ -678,14 +678,17 @@ When files like these are missing, it's recommended to reinstall the appropriate
"onboarding.title" = "Welcome Tour";
"onboarding.welcome" = "Welcome to PHP Monitor!";
"onboarding.explore" = "Congrats, you now have access to PHP Monitor's entire suite of functionality. You can learn more about some of the features that PHP Monitor has to offer on this screen.";
"onboarding.explore.lite" = "Congrats, you now have access to a subset of PHP Monitor's features. Please note that some features are currently disabled because Laravel Valet is not installed (or disabled.)";
"onboarding.tour.menu_bar.title" = "Power In Your Menu Bar";
"onboarding.tour.menu_bar" = "PHP Monitor lives in your menu bar. From this menu, you can access most of PHP Monitor's key functionality, including switching the globally linked PHP version, locating config files, and much more.";
"onboarding.tour.faq_hint" = "I recommend that you check out the [README](https://github.com/nicoverbruggen/phpmon/blob/main/README.md) on GitHub: it contains a comprehensive FAQ with various tips and common questions and answers.";
"onboarding.tour.faq_hint" = "**Questions? Unsure why features are unavailable?**
I recommend that you check out the [README](https://github.com/nicoverbruggen/phpmon/blob/main/README.md) on GitHub: it contains a comprehensive FAQ with various tips and common questions and answers.";
"onboarding.tour.services.title" = "Manage Homebrew Services";
"onboarding.tour.services" = "Once you click on the menu bar item, you can see at a glance based on the checkmarks or crosses if all of the Homebrew services are up and running. You can also click on a service to quickly toggle it.";
"onboarding.tour.domains.title" = "Manage Domains";
"onboarding.tour.domains" = "By opening the Domains window via the menu bar item, you can view which domains are linked and parked, as well as active nginx proxies.";
"onboarding.tour.isolation.title" = "Isolate Domains";
"onboarding.tour.isolation" = "If you have Valet 3 installed, you can even use domain isolation by right-clicking on a given domain in the Domains window. This allows you to pick a specific version of PHP to use for that domain, and that domain only.";
"onboarding.tour.feature_unavailable" = "This feature is currently unavailable and requires Laravel Valet to be installed.";
"onboarding.tour.once" = "You will only see the Welcome Tour once. You can re-open the Welcome Tour later via the menu bar icon (available in the menu, under First Aid & Services).";
"onboarding.tour.close" = "Close Tour";