diff --git a/packages/elements-react/src/theme/default/components/form/index.tsx b/packages/elements-react/src/theme/default/components/form/index.tsx index c487d398..ea7605c9 100644 --- a/packages/elements-react/src/theme/default/components/form/index.tsx +++ b/packages/elements-react/src/theme/default/components/form/index.tsx @@ -5,6 +5,7 @@ import { PropsWithChildren } from "react" import { cn } from "../../utils/cn" import { useIntl } from "react-intl" import { + messageTestId, OryFormRootProps, uiTextToFormattedMessage, useOryFlow, @@ -52,11 +53,12 @@ export function DefaultMessage({ message }: OryMessageContentProps) { const intl = useIntl() return ( {uiTextToFormattedMessage(message, intl)} diff --git a/packages/elements-react/src/theme/default/components/form/label.tsx b/packages/elements-react/src/theme/default/components/form/label.tsx index 2c4a873e..1454e7fb 100644 --- a/packages/elements-react/src/theme/default/components/form/label.tsx +++ b/packages/elements-react/src/theme/default/components/form/label.tsx @@ -6,10 +6,10 @@ import { OryNodeLabelProps, messageTestId, uiTextToFormattedMessage, + useComponents, useOryFlow, } from "@ory/elements-react" import { useIntl } from "react-intl" -import { cn } from "../../utils/cn" export function DefaultLabel({ node, @@ -19,6 +19,7 @@ export function DefaultLabel({ }: OryNodeLabelProps) { const intl = useIntl() const label = getNodeLabel(node) + const { Message } = useComponents() const { config, flowType, flow } = useOryFlow() const isPassword = attributes.type === "password" @@ -70,17 +71,7 @@ export function DefaultLabel({ )} {children} {node.messages.map((message) => ( - - {uiTextToFormattedMessage(message, intl)} - + ))} )