Skip to content

Commit

Permalink
Bugfix FXIOS-7301 Fix swiftlint build errors on main (#24259)
Browse files Browse the repository at this point in the history
* Fix closure length violation in Focus.

* Fix to properly swiftlint ignore nimbus generated files in Focus.
  • Loading branch information
ih-codes authored Jan 20, 2025
1 parent d7594e0 commit 01943c8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
- Package.swift
- firefox-ios/Build/Intermediates.noindex/Client.build/Fennec-iphoneos/WidgetKitExtension.build/DerivedSources/IntentDefinitionGenerated/WidgetIntents/*
# Focus specific
- Blockzilla/Generated/
- focus-ios/Blockzilla/Generated
- focus-ios-tests/tools/Localizations

included:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,17 @@ public struct ShowMeHowOnboardingView: View {
NavigationView {
ScrollView {
VStack(alignment: .leading, spacing: .verticalSpacing) {
HStack(alignment: .top, spacing: .horizontalSpacing) {
Image.stepOneImage
.resizable()
.frame(width: .iconSize, height: .iconSize)
.foregroundColor(.gray)
Text(config.subtitleStep1)
.font(.body16)
.multilineTextAlignment(.leading)
}
OnboardingInstructionLabel(image: Image.stepOneImage, label: config.subtitleStep1)
VStack(alignment: .leading, spacing: .horizontalSpacing) {
HStack(alignment: .top, spacing: .horizontalSpacing) {
Image.stepTwoImage
.resizable()
.frame(width: .iconSize, height: .iconSize)
.foregroundColor(.gray)
Text(config.subtitleStep2)
.font(.body16)
.multilineTextAlignment(.leading)
}
OnboardingInstructionLabel(image: Image.stepTwoImage, label: config.subtitleStep2)
HStack {
Spacer()
Image.jiggleModeImage
Spacer()
}
}
VStack(alignment: .leading, spacing: .horizontalSpacing) {
HStack(alignment: .top, spacing: .horizontalSpacing) {
Image.stepThreeImage
.resizable()
.frame(width: .iconSize, height: .iconSize)
.foregroundColor(.gray)
Text(config.subtitleStep3)
.font(.body16)
.multilineTextAlignment(.leading)
}
OnboardingInstructionLabel(image: Image.stepThreeImage, label: config.subtitleStep3)
HStack {
Spacer()
OnboardingSearchWidgetView(title: config.widgetText, padding: true, background: true)
Expand All @@ -77,6 +53,28 @@ public struct ShowMeHowOnboardingView: View {
}
}

public struct OnboardingInstructionLabel: View {
private let image: Image
private let label: String

public init(image: Image, label: String) {
self.image = image
self.label = label
}

public var body: some View {
HStack(alignment: .top, spacing: .horizontalSpacing) {
image
.resizable()
.frame(width: .iconSize, height: .iconSize)
.foregroundColor(.gray)
Text(label)
.font(.body16)
.multilineTextAlignment(.leading)
}
}
}

public struct ShowMeHowOnboardingViewConfig {
let title: String
let subtitleStep1: String
Expand Down

0 comments on commit 01943c8

Please sign in to comment.