chore: added placeholder to remirror (#686)

* chore: added placeholder to remirror

* fix: build error
This commit is contained in:
Aaryan Khandelwal 2023-04-03 18:14:50 +05:30 committed by GitHub
parent 3e08186d72
commit 35e40a7bec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 27 deletions

View file

@ -96,7 +96,7 @@ export const AddComment: React.FC = () => {
setValue("comment_json", jsonValue);
setValue("comment_html", htmlValue);
}}
// placeholder="Enter Your comment..."
placeholder="Enter your comment..."
/>
)}
/>
@ -104,7 +104,7 @@ export const AddComment: React.FC = () => {
<button
type="submit"
disabled={isSubmitting}
className="rounded-md bg-gray-300 p-2 px-4 text-sm text-black hover:bg-gray-300"
className="rounded-md bg-gray-300 p-2 px-4 text-sm text-black hover:bg-gray-300 mt-4"
>
{isSubmitting ? "Adding..." : "Comment"}
</button>

View file

@ -332,7 +332,7 @@ export const IssueForm: FC<IssueFormProps> = ({
}
onJSONChange={(jsonValue) => setValue("description", jsonValue)}
onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)}
placeholder="Description"
placeholder="Describe the issue..."
/>
)}
/>

View file

@ -315,9 +315,9 @@ export const SinglePageBlock: React.FC<Props> = ({ block, projectDetails }) => {
onJSONChange={(jsonValue) => setValue("description", jsonValue)}
onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)}
placeholder="Block description..."
customClassName="border border-transparent"
customClassName="border border-transparent text-sm"
noBorder
borderOnFocus
borderOnFocus={false}
/>
)}
/>

View file

@ -185,25 +185,23 @@ const RemirrorRichTextEditor: FC<IRemirrorRichTextEditor> = (props) => {
};
return (
<div className="mt-2 mb-4">
<div className="relative">
<Remirror
manager={manager}
initialContent={state}
classNames={[
`p-4 relative focus:outline-none rounded-md focus:border-gray-200 ${
noBorder ? "" : "border"
} ${borderOnFocus ? "focus:border" : ""} ${customClassName}`,
} ${borderOnFocus ? "focus:border" : "focus:border-0"} ${customClassName}`,
]}
editable={editable}
onBlur={() => {
onBlur(jsonValue, htmlValue);
}}
>
{/* {(!value || value === "" || value?.content?.[0]?.content === undefined) && (
<p className="pointer-events-none absolute top-[8.8rem] left-12 text-gray-300">
{placeholder || "Enter text..."}
</p>
)} */}
{(!value || value === "" || value?.content?.[0]?.content === undefined) && placeholder && (
<p className="absolute pointer-events-none top-4 left-4 text-gray-300">{placeholder}</p>
)}
<EditorComponent />
{imageLoader && (