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:
@@ -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:
|
||||
"You’ve reached your points limit and can’t add more items with points.",
|
||||
})}
|
||||
disableIncrease={hasReachedMax || quantity >= MAX_NR_ITEMS}
|
||||
disabledMessage={
|
||||
hasReachedMax
|
||||
? intl.formatMessage({
|
||||
id: "myPages.myStay.ancillaries.reachedMaxPointsStepperMessage",
|
||||
defaultMessage:
|
||||
"You’ve reached your points limit and can’t add more items with points.",
|
||||
})
|
||||
: intl.formatMessage({
|
||||
id: "myPages.myStay.ancillaries.reachedMaxItemsStepperMessage",
|
||||
defaultMessage:
|
||||
"Maximum quantity reached for this item.",
|
||||
})
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user