[WEB-735] chore: added a custom placeholder prop to all the editors (#4194)

* chore: added a custom placeholder prop to all the editors

* chore: inbox issue create modal placeholder
This commit is contained in:
Aaryan Khandelwal
2024-04-15 20:00:02 +05:30
committed by GitHub
parent 77b323f562
commit abce0ed946
14 changed files with 102 additions and 80 deletions

View File

@@ -19,6 +19,7 @@ export type IssueDescriptionInputProps = {
initialValue: string | undefined;
disabled?: boolean;
issueOperations: TIssueOperations;
placeholder?: string | ((isFocused: boolean) => string);
setIsSubmitting: (initialValue: "submitting" | "submitted" | "saved") => void;
swrIssueDescription: string | null | undefined;
};
@@ -33,6 +34,7 @@ export const IssueDescriptionInput: FC<IssueDescriptionInputProps> = observer((p
initialValue,
issueOperations,
setIsSubmitting,
placeholder,
} = props;
const { handleSubmit, reset, control } = useForm<TIssue>({
@@ -103,6 +105,14 @@ export const IssueDescriptionInput: FC<IssueDescriptionInputProps> = observer((p
onChange(description_html);
debouncedFormSave();
}}
placeholder={
placeholder
? placeholder
: (isFocused) => {
if (isFocused) return "Press '/' for commands...";
else return "Click to add description";
}
}
/>
) : (
<RichTextReadOnlyEditor