diff --git a/src/app/components/EditorDescriptionInput.tsx b/src/app/components/EditorDescriptionInput.tsx index e4314e0..101f374 100644 --- a/src/app/components/EditorDescriptionInput.tsx +++ b/src/app/components/EditorDescriptionInput.tsx @@ -1,14 +1,14 @@ +import { Input, TextArea } from "design-react-kit"; +import { get } from "lodash"; import { FieldPathByValue, useController, useFormContext, } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import PublicCode, { Description } from "../contents/publiccode"; -import { get } from "lodash"; -import { displayName } from "../../i18n"; -import { Input, TextArea } from "design-react-kit"; import { RequiredDeep } from "type-fest"; +import { displayName } from "../../i18n"; +import PublicCode, { Description } from "../contents/publiccode"; type Props = { fieldName: T; @@ -47,6 +47,7 @@ export default function EditorInput< value={(value as string) || ""} innerRef={ref} label={`${label}${extraLangInfo}${required ? " *" : ""}${deprecated ? ` - ${t(`editor.form.deprecatedField`)}` : ""}`} + placeholder={label} infoText={description} valid={get(errors, `description.${lang}.${fieldName}`) && false} validationText={get(errors, `description.${lang}.${fieldName}.message`)} diff --git a/src/app/components/EditorInput.tsx b/src/app/components/EditorInput.tsx index aed76c6..631e34d 100644 --- a/src/app/components/EditorInput.tsx +++ b/src/app/components/EditorInput.tsx @@ -1,13 +1,13 @@ +import { Input, TextArea } from "design-react-kit"; +import { get } from "lodash"; import { FieldPathByValue, useController, useFormContext, } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import PublicCode, { PublicCodeWithDeprecatedFields } from "../contents/publiccode"; -import { get } from "lodash"; -import { Input, TextArea } from "design-react-kit"; import { RequiredDeep } from "type-fest"; +import PublicCode, { PublicCodeWithDeprecatedFields } from "../contents/publiccode"; type Props = { fieldName: T; @@ -44,6 +44,7 @@ export default function EditorInput< value={value || ""} innerRef={ref} label={`${label}${required ? " *" : ""}${deprecated ? ` - ${t(`editor.form.deprecatedField`)}` : ""}`} + placeholder={label} infoText={description} valid={get(errors, fieldName) && false} validationText={get(errors, `${fieldName}.message`)}