mirror of
https://github.com/hexastack/hexabot
synced 2025-01-22 10:35:37 +00:00
fix: apply feedback update
This commit is contained in:
parent
bc5d6d3303
commit
fddaafc0e1
@ -53,12 +53,14 @@ interface ContentFieldInput {
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
idx: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ContentFieldInput: React.FC<ContentFieldInput> = ({
|
const ContentFieldInput: React.FC<ContentFieldInput> = ({
|
||||||
contentField: contentField,
|
contentField: contentField,
|
||||||
field,
|
field,
|
||||||
errors,
|
errors,
|
||||||
|
idx,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslate();
|
const { t } = useTranslate();
|
||||||
|
|
||||||
@ -68,7 +70,7 @@ const ContentFieldInput: React.FC<ContentFieldInput> = ({
|
|||||||
case ContentFieldType.URL:
|
case ContentFieldType.URL:
|
||||||
return (
|
return (
|
||||||
<Input
|
<Input
|
||||||
autoFocus
|
autoFocus={idx === 0}
|
||||||
multiline={contentField.type === ContentFieldType.TEXTAREA}
|
multiline={contentField.type === ContentFieldType.TEXTAREA}
|
||||||
rows={contentField.type === ContentFieldType.TEXTAREA ? 5 : 1}
|
rows={contentField.type === ContentFieldType.TEXTAREA ? 5 : 1}
|
||||||
label={t(`label.${contentField.name}`, {
|
label={t(`label.${contentField.name}`, {
|
||||||
@ -226,7 +228,7 @@ export const ContentDialog: FC<ContentDialogProps> = ({
|
|||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<ContentContainer>
|
<ContentContainer>
|
||||||
{(contentType?.fields || []).map((contentField) => (
|
{(contentType?.fields || []).map((contentField, index) => (
|
||||||
<ContentItem key={contentField.name}>
|
<ContentItem key={contentField.name}>
|
||||||
<Controller
|
<Controller
|
||||||
name={contentField.name}
|
name={contentField.name}
|
||||||
@ -249,6 +251,7 @@ export const ContentDialog: FC<ContentDialogProps> = ({
|
|||||||
contentField={contentField}
|
contentField={contentField}
|
||||||
field={field}
|
field={field}
|
||||||
errors={errors}
|
errors={errors}
|
||||||
|
idx={index}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user