Merged in feature/SW-3515-join-scandic-friends-placeholder (pull request #2883)
feat(SW-3515): display placeholder for join scandic friends * feat(SW-3515): display placeholder for join scandic friends * add missing variant config Approved-by: Linus Flood
This commit is contained in:
@@ -17,6 +17,7 @@ import Caption from "@scandic-hotels/design-system/Caption"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Input as InputWithLabel } from "@scandic-hotels/design-system/Input"
|
||||
|
||||
import { useBookingFlowConfig } from "../../bookingFlowConfig/bookingFlowConfigContext"
|
||||
import { getErrorMessage } from "./errors"
|
||||
|
||||
import styles from "./input.module.css"
|
||||
@@ -51,6 +52,7 @@ const BookingFlowInput = forwardRef<HTMLInputElement, InputProps>(
|
||||
) {
|
||||
const intl = useIntl()
|
||||
const { control } = useFormContext()
|
||||
const config = useBookingFlowConfig()
|
||||
|
||||
return (
|
||||
<Controller
|
||||
@@ -96,7 +98,11 @@ const BookingFlowInput = forwardRef<HTMLInputElement, InputProps>(
|
||||
{fieldState.error && !hideError ? (
|
||||
<Caption className={styles.error} fontOnly>
|
||||
<MaterialIcon icon="info" color="Icon/Feedback/Error" />
|
||||
{getErrorMessage(intl, fieldState.error.message)}
|
||||
{getErrorMessage(
|
||||
intl,
|
||||
config.variant,
|
||||
fieldState.error.message
|
||||
)}
|
||||
</Caption>
|
||||
) : null}
|
||||
</TextField>
|
||||
|
||||
Reference in New Issue
Block a user