Skip to content

Commit ff587e1

Browse files
committed
Move welcome view to new file
1 parent 5e405e7 commit ff587e1

File tree

4 files changed

+46
-41
lines changed

4 files changed

+46
-41
lines changed

WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetupFlow.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -112,28 +112,6 @@ class PointOfSaleBarcodeScannerSetupFlow {
112112
}
113113
}
114114

115-
// MARK: - Button Customizations
116-
@available(iOS 17.0, *)
117-
struct PointOfSaleBarcodeScannerWelcomeButtonCustomization: PointOfSaleBarcodeScannerButtonCustomization {
118-
func customizeButtons(for flow: PointOfSaleBarcodeScannerSetupFlow) -> PointOfSaleFlowButtonConfiguration {
119-
return PointOfSaleFlowButtonConfiguration(
120-
primaryButton: PointOfSaleFlowButtonConfiguration.ButtonConfig(
121-
title: Localization.doneButtonTitle,
122-
action: { flow.nextStep() }
123-
),
124-
secondaryButton: nil
125-
)
126-
}
127-
128-
private enum Localization {
129-
static let doneButtonTitle = NSLocalizedString(
130-
"pos.barcodeScannerSetup.done.button.title",
131-
value: "Done",
132-
comment: "Title for the done button in barcode scanner setup navigation"
133-
)
134-
}
135-
}
136-
137115
// MARK: - Private Localization Extension
138116
@available(iOS 17.0, *)
139117
private extension PointOfSaleBarcodeScannerSetupFlow {
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import SwiftUI
2+
3+
// TODO: Remove this view when all flows are complete
4+
struct PointOfSaleBarcodeScannerWelcomeView: View {
5+
let title: String
6+
7+
var body: some View {
8+
VStack(spacing: POSSpacing.medium) {
9+
Text(title)
10+
.font(.posBodyLargeBold)
11+
.foregroundColor(.posOnSurface)
12+
13+
Text("TODO: Implement \(title) setup flow")
14+
.font(.posBodyMediumRegular())
15+
.foregroundColor(.posOnSurfaceVariantHighest)
16+
.multilineTextAlignment(.center)
17+
}
18+
.frame(maxWidth: .infinity, maxHeight: .infinity)
19+
}
20+
}
21+
22+
// MARK: - Button Customizations
23+
@available(iOS 17.0, *)
24+
struct PointOfSaleBarcodeScannerWelcomeButtonCustomization: PointOfSaleBarcodeScannerButtonCustomization {
25+
func customizeButtons(for flow: PointOfSaleBarcodeScannerSetupFlow) -> PointOfSaleFlowButtonConfiguration {
26+
return PointOfSaleFlowButtonConfiguration(
27+
primaryButton: PointOfSaleFlowButtonConfiguration.ButtonConfig(
28+
title: Localization.doneButtonTitle,
29+
action: { flow.nextStep() }
30+
),
31+
secondaryButton: nil
32+
)
33+
}
34+
35+
private enum Localization {
36+
static let doneButtonTitle = NSLocalizedString(
37+
"pos.barcodeScannerSetup.done.button.title",
38+
value: "Done",
39+
comment: "Title for the done button in barcode scanner setup navigation"
40+
)
41+
}
42+
}

WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetupViews.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,6 @@ struct PointOfSaleBarcodeScannerOptionView: View {
5656
}
5757
}
5858

59-
// MARK: - Step Views
60-
struct PointOfSaleBarcodeScannerWelcomeView: View {
61-
let title: String
62-
63-
var body: some View {
64-
VStack(spacing: POSSpacing.medium) {
65-
Text(title)
66-
.font(.posBodyLargeBold)
67-
.foregroundColor(.posOnSurface)
68-
69-
Text("TODO: Implement \(title) setup flow")
70-
.font(.posBodyMediumRegular())
71-
.foregroundColor(.posOnSurfaceVariantHighest)
72-
.multilineTextAlignment(.center)
73-
}
74-
.frame(maxWidth: .infinity, maxHeight: .infinity)
75-
}
76-
}
77-
7859
// MARK: - Private Localization Extensions
7960
private extension PointOfSaleBarcodeScannerSetupSelectionView {
8061
enum Localization {

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@
886886
2088784B2D96E98000F7AE03 /* PointOfSaleCardPresentPaymentConnectingLocationPreAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2088784A2D96E98000F7AE03 /* PointOfSaleCardPresentPaymentConnectingLocationPreAlertView.swift */; };
887887
2088784D2D96EA3900F7AE03 /* PointOfSaleCardPresentPaymentConnectingLocationPreAlertViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2088784C2D96EA3900F7AE03 /* PointOfSaleCardPresentPaymentConnectingLocationPreAlertViewModel.swift */; };
888888
20897C9E2D4A68C5008AD16C /* PointOfSaleUnsupportedWidthView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20897C9D2D4A68C5008AD16C /* PointOfSaleUnsupportedWidthView.swift */; };
889+
208C0F0A2E1FAC1900FE619E /* PointOfSaleBarcodeScannerSetupStepViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 208C0F092E1FAC1900FE619E /* PointOfSaleBarcodeScannerSetupStepViews.swift */; };
889890
209566252D4CF00100977124 /* PointOfSalePaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 209566242D4CF00100977124 /* PointOfSalePaymentMethod.swift */; };
890891
209AD3D02AC1EDDA00825D76 /* WooPaymentsPayoutsCurrencyOverviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 209AD3CF2AC1EDDA00825D76 /* WooPaymentsPayoutsCurrencyOverviewViewModel.swift */; };
891892
209AD3D22AC1EDF600825D76 /* WooPaymentsPayoutsCurrencyOverviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 209AD3D12AC1EDF600825D76 /* WooPaymentsPayoutsCurrencyOverviewView.swift */; };
@@ -4057,6 +4058,7 @@
40574058
2088784A2D96E98000F7AE03 /* PointOfSaleCardPresentPaymentConnectingLocationPreAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointOfSaleCardPresentPaymentConnectingLocationPreAlertView.swift; sourceTree = "<group>"; };
40584059
2088784C2D96EA3900F7AE03 /* PointOfSaleCardPresentPaymentConnectingLocationPreAlertViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointOfSaleCardPresentPaymentConnectingLocationPreAlertViewModel.swift; sourceTree = "<group>"; };
40594060
20897C9D2D4A68C5008AD16C /* PointOfSaleUnsupportedWidthView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointOfSaleUnsupportedWidthView.swift; sourceTree = "<group>"; };
4061+
208C0F092E1FAC1900FE619E /* PointOfSaleBarcodeScannerSetupStepViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointOfSaleBarcodeScannerSetupStepViews.swift; sourceTree = "<group>"; };
40604062
209566242D4CF00100977124 /* PointOfSalePaymentMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointOfSalePaymentMethod.swift; sourceTree = "<group>"; };
40614063
209AD3CF2AC1EDDA00825D76 /* WooPaymentsPayoutsCurrencyOverviewViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WooPaymentsPayoutsCurrencyOverviewViewModel.swift; sourceTree = "<group>"; };
40624064
209AD3D12AC1EDF600825D76 /* WooPaymentsPayoutsCurrencyOverviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WooPaymentsPayoutsCurrencyOverviewView.swift; sourceTree = "<group>"; };
@@ -8310,6 +8312,7 @@
83108312
20C3DB1F2E1E69CF00CF7D3B /* PointOfSaleBarcodeScannerSetupFlowManager.swift */,
83118313
20C3DB202E1E69CF00CF7D3B /* PointOfSaleBarcodeScannerSetupModels.swift */,
83128314
20C3DB212E1E69CF00CF7D3B /* PointOfSaleBarcodeScannerSetupViews.swift */,
8315+
208C0F092E1FAC1900FE619E /* PointOfSaleBarcodeScannerSetupStepViews.swift */,
83138316
20C3DB282E1E6FBA00CF7D3B /* PointOfSaleFlowButtonsView.swift */,
83148317
);
83158318
path = "Barcode Scanner Setup";
@@ -15239,6 +15242,7 @@
1523915242
03E471CA293E0A30001A58AD /* CardPresentModalTapToPayConfigurationProgress.swift in Sources */,
1524015243
31AD0B1126E9575F000B6391 /* CardPresentModalConnectingFailed.swift in Sources */,
1524115244
576EA39425264C9B00AFC0B3 /* RefundConfirmationViewModel.swift in Sources */,
15245+
208C0F0A2E1FAC1900FE619E /* PointOfSaleBarcodeScannerSetupStepViews.swift in Sources */,
1524215246
02ED3D272C23315400ED6F3E /* PointOfSaleCardPresentPaymentReaderUpdateFailedView.swift in Sources */,
1524315247
01BD77482C58D19C00147191 /* PointOfSaleCardPresentPaymentCancelledOnReaderMessageView.swift in Sources */,
1524415248
DEC51B00276AEE91009F3DF4 /* SystemStatusReportViewModel.swift in Sources */,

0 commit comments

Comments
 (0)