Merged in fix/SW-2406-update-modal-ancillaries (pull request #1911)
fix(SW-2406): update modal for ancillaries * fix(SW-2406): update modal for ancillaries * fix(SW-2406): revert translations Approved-by: Niclas Edenvin Approved-by: Erik Tiekstra
This commit is contained in:
@@ -52,6 +52,7 @@ export interface AddAncillaryState {
|
||||
openModal: () => void
|
||||
closeModal: () => void
|
||||
prevStep: () => void
|
||||
prevStepMobile: () => void
|
||||
breakfastData: BreakfastData | null
|
||||
setBreakfastData: (breakfastData: BreakfastData | null) => void
|
||||
isBreakfast: boolean
|
||||
@@ -194,6 +195,23 @@ export const createAddAncillaryStore = (
|
||||
}
|
||||
})
|
||||
),
|
||||
prevStepMobile: () =>
|
||||
set(
|
||||
produce((state: AddAncillaryState) => {
|
||||
if (state.currentStep === AncillaryStepEnum.selectQuantity) {
|
||||
state.isOpen = false
|
||||
clearAncillarySessionData()
|
||||
state.selectedAncillary = null
|
||||
state.steps = steps
|
||||
} else {
|
||||
if (state.currentStep === AncillaryStepEnum.confirmation) {
|
||||
state.currentStep = AncillaryStepEnum.selectQuantity
|
||||
} else {
|
||||
state.currentStep = state.currentStep - 1
|
||||
}
|
||||
}
|
||||
})
|
||||
),
|
||||
selectAncillary: (ancillary) =>
|
||||
set(
|
||||
produce((state: AddAncillaryState) => {
|
||||
|
||||
Reference in New Issue
Block a user