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"
const MAX_NR_ITEMS = 6
type PaymentCardProps = {
totalCostMessage: string
icon: React.ReactNode
@@ -119,12 +121,20 @@ function InnerPaymentOption({
handleOnIncrease={handleOnIncrease}
handleOnDecrease={handleOnDecrease}
disableDecrease={quantity <= 0}
disableIncrease={hasReachedMax}
disabledMessage={intl.formatMessage({
id: "myPages.myStay.ancillaries.reachedMaxPointsStepperMessage",
defaultMessage:
"Youve reached your points limit and cant add more items with points.",
})}
disableIncrease={hasReachedMax || quantity >= MAX_NR_ITEMS}
disabledMessage={
hasReachedMax
? intl.formatMessage({
id: "myPages.myStay.ancillaries.reachedMaxPointsStepperMessage",
defaultMessage:
"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>