@@ -22,74 +22,17 @@ struct POSFloatingControlView: View {
2222 self . _showSettings = showSettings
2323 }
2424
25+ private var isPOSSettingsEnabled : Bool {
26+ ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . pointOfSaleSettingsi1)
27+ }
28+
2529 var body : some View {
2630 HStack {
2731 Menu {
28- Button {
29- ServiceLocator . analytics. track ( . pointOfSaleExitMenuItemTapped)
30- showExitPOSModal = true
31- } label: {
32- Label (
33- title: { Text ( Localization . exitPointOfSale) } ,
34- icon: { Image ( systemName: " rectangle.portrait.and.arrow.forward " ) }
35- )
36- }
37- Button {
38- ServiceLocator . analytics. track ( . pointOfSaleGetSupportTapped)
39- showSupport = true
40- } label: {
41- Label (
42- title: { Text ( Localization . getSupport) } ,
43- icon: { Image ( systemName: " questionmark.circle " ) }
44- )
45- }
46- Button {
47- showDocumentation = true
48- ServiceLocator . analytics. track ( . pointOfSaleViewDocsTapped)
49- } label: {
50- Label (
51- title: { Text ( Localization . viewDocumentation) } ,
52- icon: { Image ( systemName: " info.circle " ) }
53- )
54- }
55- Button {
56- showProductRestrictionsModal = true
57- ServiceLocator . analytics. track ( . pointOfSaleSimpleProductsExplanationDialogShown)
58- } label: {
59- Label (
60- title: { Text ( Localization . productRestrictionsInfo) } ,
61- icon: { Image ( systemName: " magnifyingglass " ) } )
62- }
63- Button {
64- showBarcodeScanningModal = true
65- ServiceLocator . analytics. track ( . pointOfSaleBarcodeScanningMenuItemTapped)
66- } label: {
67- Label (
68- title: {
69- Text ( Localization . barcodeScanningSetup)
70- } ,
71- icon: { Image ( systemName: " barcode.viewfinder " ) } )
72- }
73- if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . pointOfSaleSettingsi1) {
74- Button {
75- showSettings = true
76- } label: {
77- Label (
78- title: { Text ( Localization . settings) } ,
79- icon: { Image ( systemName: " gearshape " ) }
80- )
81- }
82- }
83-
84- if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . pointOfSaleHistoricalOrdersi1) {
85- Button {
86- showOrders = true
87- } label: {
88- Label (
89- title: { Text ( Localization . orders) } ,
90- icon: { Image ( systemName: " text.document " ) }
91- )
92- }
32+ if isPOSSettingsEnabled {
33+ compactOptions ( )
34+ } else {
35+ completeOptions ( )
9336 }
9437 } label: {
9538 VStack {
@@ -129,6 +72,110 @@ struct POSFloatingControlView: View {
12972 }
13073}
13174
75+ private extension POSFloatingControlView {
76+ @ViewBuilder private func compactOptions( ) -> some View {
77+ Button {
78+ ServiceLocator . analytics. track ( . pointOfSaleExitMenuItemTapped)
79+ showExitPOSModal = true
80+ } label: {
81+ Label (
82+ title: { Text ( Localization . exitPointOfSale) } ,
83+ icon: { Image ( systemName: " rectangle.portrait.and.arrow.forward " ) }
84+ )
85+ }
86+ if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . pointOfSaleSettingsi1) {
87+ Button {
88+ showSettings = true
89+ } label: {
90+ Label (
91+ title: { Text ( Localization . settings) } ,
92+ icon: { Image ( systemName: " gearshape " ) }
93+ )
94+ }
95+ }
96+
97+ if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . pointOfSaleHistoricalOrdersi1) {
98+ Button {
99+ showOrders = true
100+ } label: {
101+ Label (
102+ title: { Text ( Localization . orders) } ,
103+ icon: { Image ( systemName: " text.document " ) }
104+ )
105+ }
106+ }
107+ }
108+
109+ @ViewBuilder private func completeOptions( ) -> some View {
110+ Button {
111+ ServiceLocator . analytics. track ( . pointOfSaleExitMenuItemTapped)
112+ showExitPOSModal = true
113+ } label: {
114+ Label (
115+ title: { Text ( Localization . exitPointOfSale) } ,
116+ icon: { Image ( systemName: " rectangle.portrait.and.arrow.forward " ) }
117+ )
118+ }
119+ Button {
120+ ServiceLocator . analytics. track ( . pointOfSaleGetSupportTapped)
121+ showSupport = true
122+ } label: {
123+ Label (
124+ title: { Text ( Localization . getSupport) } ,
125+ icon: { Image ( systemName: " questionmark.circle " ) }
126+ )
127+ }
128+ Button {
129+ showDocumentation = true
130+ ServiceLocator . analytics. track ( . pointOfSaleViewDocsTapped)
131+ } label: {
132+ Label (
133+ title: { Text ( Localization . viewDocumentation) } ,
134+ icon: { Image ( systemName: " info.circle " ) }
135+ )
136+ }
137+ Button {
138+ showProductRestrictionsModal = true
139+ ServiceLocator . analytics. track ( . pointOfSaleSimpleProductsExplanationDialogShown)
140+ } label: {
141+ Label (
142+ title: { Text ( Localization . productRestrictionsInfo) } ,
143+ icon: { Image ( systemName: " magnifyingglass " ) } )
144+ }
145+ Button {
146+ showBarcodeScanningModal = true
147+ ServiceLocator . analytics. track ( . pointOfSaleBarcodeScanningMenuItemTapped)
148+ } label: {
149+ Label (
150+ title: {
151+ Text ( Localization . barcodeScanningSetup)
152+ } ,
153+ icon: { Image ( systemName: " barcode.viewfinder " ) } )
154+ }
155+ if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . pointOfSaleSettingsi1) {
156+ Button {
157+ showSettings = true
158+ } label: {
159+ Label (
160+ title: { Text ( Localization . settings) } ,
161+ icon: { Image ( systemName: " gearshape " ) }
162+ )
163+ }
164+ }
165+
166+ if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . pointOfSaleHistoricalOrdersi1) {
167+ Button {
168+ showOrders = true
169+ } label: {
170+ Label (
171+ title: { Text ( Localization . orders) } ,
172+ icon: { Image ( systemName: " text.document " ) }
173+ )
174+ }
175+ }
176+ }
177+ }
178+
132179private extension POSFloatingControlView {
133180 var backgroundColor : Color {
134181 switch backgroundAppearance {
0 commit comments