Merged in feat/BOOK-644-gla-reward-night (pull request #3500)
fix(BOOK-644): update ui reward night gla * fix(BOOK-644): update ut reward night gla Approved-by: Erik Tiekstra Approved-by: Matilda Landström
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { useFormContext } from "react-hook-form"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import Checkbox from "@scandic-hotels/design-system/Form/Checkbox"
|
||||
import { ErrorMessage } from "@scandic-hotels/design-system/Form/ErrorMessage"
|
||||
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { useBookingFlowConfig } from "../../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||
import useLang from "../../../../hooks/useLang"
|
||||
import { paymentError } from "../schema"
|
||||
|
||||
import styles from "./termsAndConditions.module.css"
|
||||
|
||||
@@ -19,24 +20,22 @@ export default function TermsAndConditions({
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
const { routes } = useBookingFlowConfig()
|
||||
const {
|
||||
formState: { errors },
|
||||
} = useFormContext()
|
||||
|
||||
return (
|
||||
<div className={styles.termsAndConditions}>
|
||||
<Checkbox
|
||||
name="termsAndConditions"
|
||||
registerOptions={{ required: true }}
|
||||
errorCodeMessages={{
|
||||
[paymentError.TERMS_REQUIRED]: intl.formatMessage({
|
||||
id: "common.mustAcceptTermsError",
|
||||
defaultMessage: "You must accept the terms and conditions",
|
||||
}),
|
||||
}}
|
||||
hideError
|
||||
>
|
||||
<Typography variant="Body/Supporting text (caption)/smBold">
|
||||
<span>
|
||||
{intl.formatMessage({
|
||||
id: "booking.acceptBookingTerms",
|
||||
defaultMessage: "I accept the booking and cancellation terms",
|
||||
defaultMessage: "I accept the booking and cancellation terms.",
|
||||
})}
|
||||
</span>
|
||||
</Typography>
|
||||
@@ -46,9 +45,9 @@ export default function TermsAndConditions({
|
||||
{isFlexBookingTerms
|
||||
? intl.formatMessage(
|
||||
{
|
||||
id: "enterDetails.payment.flexBookingTermsAndConditions",
|
||||
id: "enterDetails.paymentStep.flexBookingTermsAndConditions",
|
||||
defaultMessage:
|
||||
"I accept the terms for this booking and the general <termsAndConditionsLink>Booking & Cancellation Terms</termsAndConditionsLink>, and understand that Scandic will process my personal data for this booking in accordance with <privacyPolicyLink>Scandic's Privacy policy</privacyPolicyLink>.",
|
||||
"To complete your booking, please accept the general <termsAndConditionsLink>Booking & Cancellation Terms</termsAndConditionsLink>, and acknowledge that your data will be processed in accordance with Scandic's <privacyPolicyLink>Privacy policy</privacyPolicyLink>.",
|
||||
},
|
||||
{
|
||||
termsAndConditionsLink: (str) => (
|
||||
@@ -108,6 +107,14 @@ export default function TermsAndConditions({
|
||||
)}
|
||||
</p>
|
||||
</Typography>
|
||||
<ErrorMessage
|
||||
name="termsAndConditions"
|
||||
errors={errors}
|
||||
messageLabel={intl.formatMessage({
|
||||
id: "common.mustAcceptTermsError",
|
||||
defaultMessage: "You must accept the terms and conditions",
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user