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() {
|
export default function GuaranteeLateArrival() {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
|
||||||
const { checkInDate, checkInTime, guaranteeInfo, isCancelled } =
|
const { checkInDate, checkInTime, guaranteeInfo, isCancelled, priceType } =
|
||||||
useMyStayStore((state) => ({
|
useMyStayStore((state) => ({
|
||||||
checkInDate: state.bookedRoom.checkInDate,
|
checkInDate: state.bookedRoom.checkInDate,
|
||||||
checkInTime: state.hotel.hotelFacts.checkin.checkInTime,
|
checkInTime: state.hotel.hotelFacts.checkin.checkInTime,
|
||||||
guaranteeInfo: state.bookedRoom.guaranteeInfo,
|
guaranteeInfo: state.bookedRoom.guaranteeInfo,
|
||||||
isCancelled: state.bookedRoom.isCancelled,
|
isCancelled: state.bookedRoom.isCancelled,
|
||||||
|
priceType: state.bookedRoom.priceType,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
const isRewardNight = priceType === "points"
|
||||||
|
|
||||||
const guaranteeable =
|
const guaranteeable =
|
||||||
!guaranteeInfo && !isCancelled && !dateHasPassed(checkInDate, checkInTime)
|
!guaranteeInfo &&
|
||||||
|
!isCancelled &&
|
||||||
|
!dateHasPassed(checkInDate, checkInTime) &&
|
||||||
|
!isRewardNight
|
||||||
|
|
||||||
if (!guaranteeable) {
|
if (!guaranteeable) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -10,12 +10,16 @@ import styles from "./guaranteeInfo.module.css"
|
|||||||
|
|
||||||
export default function GuaranteeInfo() {
|
export default function GuaranteeInfo() {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const { allRoomsAreCancelled, guaranteeInfo } = useMyStayStore((state) => ({
|
const { allRoomsAreCancelled, guaranteeInfo, priceType } = useMyStayStore(
|
||||||
allRoomsAreCancelled: state.allRoomsAreCancelled,
|
(state) => ({
|
||||||
guaranteeInfo: state.bookedRoom.guaranteeInfo,
|
allRoomsAreCancelled: state.allRoomsAreCancelled,
|
||||||
}))
|
guaranteeInfo: state.bookedRoom.guaranteeInfo,
|
||||||
|
priceType: state.bookedRoom.priceType,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
if (allRoomsAreCancelled || !guaranteeInfo) {
|
const isRewardNight = priceType === "points"
|
||||||
|
if (allRoomsAreCancelled || (!guaranteeInfo && !isRewardNight)) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user