@@ -25,18 +25,10 @@ struct POSFloatingControlView: View {
2525 self . _showSettings = showSettings
2626 }
2727
28- private var isPOSSettingsEnabled : Bool {
29- featureFlags. isFeatureFlagEnabled ( . pointOfSaleSettingsi1)
30- }
31-
3228 var body : some View {
3329 HStack {
3430 Menu {
35- if isPOSSettingsEnabled {
36- compactOptions ( )
37- } else {
38- completeOptions ( )
39- }
31+ menuOptions ( )
4032 } label: {
4133 VStack {
4234 Spacer ( )
@@ -76,7 +68,7 @@ struct POSFloatingControlView: View {
7668}
7769
7870private extension POSFloatingControlView {
79- @ViewBuilder private func compactOptions ( ) -> some View {
71+ @ViewBuilder private func menuOptions ( ) -> some View {
8072 Button {
8173 analytics. track ( . pointOfSaleExitMenuItemTapped)
8274 showExitPOSModal = true
@@ -86,87 +78,15 @@ private extension POSFloatingControlView {
8678 icon: { Image ( systemName: " rectangle.portrait.and.arrow.forward " ) }
8779 )
8880 }
89- if featureFlags. isFeatureFlagEnabled ( . pointOfSaleSettingsi1) {
90- Button {
91- analytics. track ( . pointOfSaleSettingsMenuItemTapped)
92- showSettings = true
93- } label: {
94- Label (
95- title: { Text ( Localization . settings) } ,
96- icon: { Image ( systemName: " gearshape " ) }
97- )
98- }
99- }
100-
101- if featureFlags. isFeatureFlagEnabled ( . pointOfSaleHistoricalOrdersi1) {
102- Button {
103- analytics. track ( event: WooAnalyticsEvent . PointOfSale. ordersMenuItemTapped ( ) )
104- showOrders = true
105- } label: {
106- Label (
107- title: { Text ( Localization . orders) } ,
108- icon: { Image ( systemName: " text.document " ) }
109- )
110- }
111- }
112- }
113-
114- @ViewBuilder private func completeOptions( ) -> some View {
11581 Button {
116- analytics. track ( . pointOfSaleExitMenuItemTapped )
117- showExitPOSModal = true
82+ analytics. track ( . pointOfSaleSettingsMenuItemTapped )
83+ showSettings = true
11884 } label: {
11985 Label (
120- title: { Text ( Localization . exitPointOfSale ) } ,
121- icon: { Image ( systemName: " rectangle.portrait.and.arrow.forward " ) }
86+ title: { Text ( Localization . settings ) } ,
87+ icon: { Image ( systemName: " gearshape " ) }
12288 )
12389 }
124- Button {
125- analytics. track ( . pointOfSaleGetSupportTapped)
126- showSupport = true
127- } label: {
128- Label (
129- title: { Text ( Localization . getSupport) } ,
130- icon: { Image ( systemName: " questionmark.circle " ) }
131- )
132- }
133- Button {
134- showDocumentation = true
135- analytics. track ( . pointOfSaleViewDocsTapped)
136- } label: {
137- Label (
138- title: { Text ( Localization . viewDocumentation) } ,
139- icon: { Image ( systemName: " info.circle " ) }
140- )
141- }
142- Button {
143- showProductRestrictionsModal = true
144- analytics. track ( . pointOfSaleSimpleProductsExplanationDialogShown)
145- } label: {
146- Label (
147- title: { Text ( Localization . productRestrictionsInfo) } ,
148- icon: { Image ( systemName: " magnifyingglass " ) } )
149- }
150- Button {
151- showBarcodeScanningModal = true
152- analytics. track ( . pointOfSaleBarcodeScanningMenuItemTapped)
153- } label: {
154- Label (
155- title: {
156- Text ( Localization . barcodeScanningSetup)
157- } ,
158- icon: { Image ( systemName: " barcode.viewfinder " ) } )
159- }
160- if featureFlags. isFeatureFlagEnabled ( . pointOfSaleSettingsi1) {
161- Button {
162- showSettings = true
163- } label: {
164- Label (
165- title: { Text ( Localization . settings) } ,
166- icon: { Image ( systemName: " gearshape " ) }
167- )
168- }
169- }
17090
17191 if featureFlags. isFeatureFlagEnabled ( . pointOfSaleHistoricalOrdersi1) {
17292 Button {
@@ -228,31 +148,6 @@ private extension POSFloatingControlView {
228148 " The action is confirmed in a modal. "
229149 )
230150
231- static let getSupport = NSLocalizedString (
232- " pointOfSale.floatingButtons.getSupport.button.title " ,
233- value: " Get Support " ,
234- comment: " The title of the menu button to get support for Point of Sale, shown in a popover menu. "
235- )
236-
237- static let viewDocumentation = NSLocalizedString (
238- " pointOfSale.floatingButtons.viewDocumentation.button.title " ,
239- value: " Documentation " ,
240- comment: " The title of the menu button to read Point of Sale documentation, shown in a popover menu. "
241- )
242-
243- static let productRestrictionsInfo = NSLocalizedString (
244- " pointOfSale.floatingButtons.productRestrictionsInfo.button.title " ,
245- value: " Where are my products? " ,
246- comment: " The title of the menu button to view product restrictions info, shown in a popover menu. " +
247- " We only show simple and variable products in POS, this shows a modal to help explain that limitation. "
248- )
249-
250- static let barcodeScanningSetup = NSLocalizedString (
251- " pointOfSale.floatingButtons.barcodeScanningSetup.button.title " ,
252- value: " Initial barcode scanner setup " ,
253- comment: " The title of the menu button to start a barcode scanner setup flow. "
254- )
255-
256151 static let settings = NSLocalizedString (
257152 " pointOfSale.floatingButtons.settings.button.title " ,
258153 value: " Settings " ,
0 commit comments