Merged in fix/SW-2402-hide-gla-rewardNight (pull request #1983)
fix(SW-2042): hide guarantee late arrival on my stay for rewardNight * fix(SW-2042): hide guarantee late arrival on my stay for rewardNight Approved-by: Niclas Edenvin
This commit is contained in:
@@ -16,16 +16,22 @@ import styles from "./guarantee.module.css"
|
||||
export default function GuaranteeLateArrival() {
|
||||
const intl = useIntl()
|
||||
|
||||
const { checkInDate, checkInTime, guaranteeInfo, isCancelled } =
|
||||
const { checkInDate, checkInTime, guaranteeInfo, isCancelled, priceType } =
|
||||
useMyStayStore((state) => ({
|
||||
checkInDate: state.bookedRoom.checkInDate,
|
||||
checkInTime: state.hotel.hotelFacts.checkin.checkInTime,
|
||||
guaranteeInfo: state.bookedRoom.guaranteeInfo,
|
||||
isCancelled: state.bookedRoom.isCancelled,
|
||||
priceType: state.bookedRoom.priceType,
|
||||
}))
|
||||
|
||||
const isRewardNight = priceType === "points"
|
||||
|
||||
const guaranteeable =
|
||||
!guaranteeInfo && !isCancelled && !dateHasPassed(checkInDate, checkInTime)
|
||||
!guaranteeInfo &&
|
||||
!isCancelled &&
|
||||
!dateHasPassed(checkInDate, checkInTime) &&
|
||||
!isRewardNight
|
||||
|
||||
if (!guaranteeable) {
|
||||
return null
|
||||
|
||||
@@ -10,12 +10,16 @@ import styles from "./guaranteeInfo.module.css"
|
||||
|
||||
export default function GuaranteeInfo() {
|
||||
const intl = useIntl()
|
||||
const { allRoomsAreCancelled, guaranteeInfo } = useMyStayStore((state) => ({
|
||||
allRoomsAreCancelled: state.allRoomsAreCancelled,
|
||||
guaranteeInfo: state.bookedRoom.guaranteeInfo,
|
||||
}))
|
||||
const { allRoomsAreCancelled, guaranteeInfo, priceType } = useMyStayStore(
|
||||
(state) => ({
|
||||
allRoomsAreCancelled: state.allRoomsAreCancelled,
|
||||
guaranteeInfo: state.bookedRoom.guaranteeInfo,
|
||||
priceType: state.bookedRoom.priceType,
|
||||
})
|
||||
)
|
||||
|
||||
if (allRoomsAreCancelled || !guaranteeInfo) {
|
||||
const isRewardNight = priceType === "points"
|
||||
if (allRoomsAreCancelled || (!guaranteeInfo && !isRewardNight)) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user