Merged in fix(STAY-151)-ancillary-limit (pull request #3412)

fix(STAY-151)-limit-ancillary-quantity

* fix(STAY-151)-limit-ancillary-quantity


Approved-by: Emma Zettervall
Approved-by: Linus Flood
This commit is contained in:
Matilda Landström
2026-01-12 08:31:38 +00:00
parent 68c1b3dc50
commit f7ee540912

View File

@@ -9,6 +9,8 @@ import { Typography } from "@scandic-hotels/design-system/Typography"
import styles from "./paymentOption.module.css" import styles from "./paymentOption.module.css"
const MAX_NR_ITEMS = 6
type PaymentCardProps = { type PaymentCardProps = {
totalCostMessage: string totalCostMessage: string
icon: React.ReactNode icon: React.ReactNode
@@ -119,12 +121,20 @@ function InnerPaymentOption({
handleOnIncrease={handleOnIncrease} handleOnIncrease={handleOnIncrease}
handleOnDecrease={handleOnDecrease} handleOnDecrease={handleOnDecrease}
disableDecrease={quantity <= 0} disableDecrease={quantity <= 0}
disableIncrease={hasReachedMax} disableIncrease={hasReachedMax || quantity >= MAX_NR_ITEMS}
disabledMessage={intl.formatMessage({ disabledMessage={
hasReachedMax
? intl.formatMessage({
id: "myPages.myStay.ancillaries.reachedMaxPointsStepperMessage", id: "myPages.myStay.ancillaries.reachedMaxPointsStepperMessage",
defaultMessage: defaultMessage:
"Youve reached your points limit and cant add more items with points.", "Youve reached your points limit and cant add more items with points.",
})} })
: intl.formatMessage({
id: "myPages.myStay.ancillaries.reachedMaxItemsStepperMessage",
defaultMessage:
"Maximum quantity reached for this item.",
})
}
/> />
)} )}
</div> </div>