Merged in fix/refactor-currency-display (pull request #3434)
fix(SW-3616): Handle EuroBonus point type everywhere * Add tests to formatPrice * formatPrice * More work replacing config with api points type * More work replacing config with api points type * More fixing with currency * maybe actually fixed it * Fix MyStay * Clean up * Fix comments * Merge branch 'master' into fix/refactor-currency-display * Fix calculateTotalPrice for EB points + SF points + cash Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
import { createContext, useContext } from "react"
|
||||
|
||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
|
||||
import type { BookingFlowConfig } from "./bookingFlowConfig"
|
||||
|
||||
type BookingFlowConfigContextData = BookingFlowConfig
|
||||
@@ -24,20 +22,6 @@ export const useBookingFlowConfig = (): BookingFlowConfigContextData => {
|
||||
return context
|
||||
}
|
||||
|
||||
export const useGetPointsCurrency = () => {
|
||||
const config = useBookingFlowConfig()
|
||||
|
||||
switch (config.variant) {
|
||||
case "scandic":
|
||||
return CurrencyEnum.POINTS
|
||||
case "partner-sas":
|
||||
return CurrencyEnum.EUROBONUS
|
||||
default:
|
||||
const _exhaustiveCheck: never = config.variant
|
||||
throw new Error(`Unknown variant: ${config.variant}`)
|
||||
}
|
||||
}
|
||||
|
||||
export function BookingFlowConfigContextProvider({
|
||||
children,
|
||||
config,
|
||||
|
||||
Reference in New Issue
Block a user