@@ -8,15 +8,18 @@ struct POSFloatingControlView: View {
88 @Binding private var showExitPOSModal : Bool
99 @Binding private var showSupport : Bool
1010 @Binding private var showDocumentation : Bool
11+ @Binding private var showSettings : Bool
1112 @State private var showProductRestrictionsModal : Bool = false
1213 @State private var showBarcodeScanningModal : Bool = false
1314
1415 init ( showExitPOSModal: Binding < Bool > ,
1516 showSupport: Binding < Bool > ,
16- showDocumentation: Binding < Bool > ) {
17+ showDocumentation: Binding < Bool > ,
18+ showSettings: Binding < Bool > ) {
1719 self . _showExitPOSModal = showExitPOSModal
1820 self . _showSupport = showSupport
1921 self . _showDocumentation = showDocumentation
22+ self . _showSettings = showSettings
2023 }
2124
2225 var body : some View {
@@ -73,6 +76,16 @@ struct POSFloatingControlView: View {
7376 icon: { Image ( systemName: " barcode.viewfinder " ) } )
7477 }
7578 }
79+ if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . pointOfSaleSettingsi1) {
80+ Button {
81+ showSettings = true
82+ } label: {
83+ Label (
84+ title: { Text ( Localization . settings) } ,
85+ icon: { Image ( systemName: " gearshape " ) }
86+ )
87+ }
88+ }
7689 } label: {
7790 VStack {
7891 Spacer ( )
@@ -185,14 +198,23 @@ private extension POSFloatingControlView {
185198 value: " Initial barcode scanner setup " ,
186199 comment: " The title of the menu button to start a barcode scanner setup flow. "
187200 )
201+
202+ static let settings = NSLocalizedString (
203+ " pointOfSale.floatingButtons.settings.button.title " ,
204+ value: " Settings " ,
205+ comment: " The title of the menu button to access Point of Sale settings. "
206+ )
188207 }
189208}
190209
191210#if DEBUG
192211
193212@available ( iOS 17 . 0 , * )
194213#Preview( " Reader Disconnected " ) {
195- POSFloatingControlView ( showExitPOSModal: . constant( false ) , showSupport: . constant( false ) , showDocumentation: . constant( false ) )
214+ POSFloatingControlView ( showExitPOSModal: . constant( false ) ,
215+ showSupport: . constant( false ) ,
216+ showDocumentation: . constant( false ) ,
217+ showSettings: . constant( false ) )
196218 . environment ( \. posBackgroundAppearance, . primary)
197219 . environment ( POSPreviewHelpers . makePreviewAggregateModel ( ) )
198220}
@@ -204,14 +226,20 @@ private extension POSFloatingControlView {
204226 let posModel = POSPreviewHelpers . makePreviewAggregateModel (
205227 cardPresentPaymentService: paymentService
206228 )
207- return POSFloatingControlView ( showExitPOSModal: . constant( false ) , showSupport: . constant( false ) , showDocumentation: . constant( false ) )
229+ return POSFloatingControlView ( showExitPOSModal: . constant( false ) ,
230+ showSupport: . constant( false ) ,
231+ showDocumentation: . constant( false ) ,
232+ showSettings: . constant( false ) )
208233 . environment ( \. posBackgroundAppearance, . primary)
209234 . environment ( posModel)
210235}
211236
212237@available ( iOS 17 . 0 , * )
213238#Preview( " Secondary/disabled Background " ) {
214- POSFloatingControlView ( showExitPOSModal: . constant( false ) , showSupport: . constant( false ) , showDocumentation: . constant( false ) )
239+ POSFloatingControlView ( showExitPOSModal: . constant( false ) ,
240+ showSupport: . constant( false ) ,
241+ showDocumentation: . constant( false ) ,
242+ showSettings: . constant( false ) )
215243 . environment ( \. posBackgroundAppearance, . secondary)
216244 . environment ( POSPreviewHelpers . makePreviewAggregateModel ( ) )
217245}
0 commit comments