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"
|
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:
|
||||||
"You’ve reached your points limit and can’t add more items with points.",
|
"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>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user