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 && (

View File

@ -272,7 +272,8 @@ const SinglePage: NextPage<UserAuth> = (props) => {
key={label.id}
className="group flex items-center gap-1 rounded-2xl border px-2 py-0.5 text-xs"
style={{
backgroundColor: `${label?.color && label.color !== "" ? label.color : "#000000"
backgroundColor: `${
label?.color && label.color !== "" ? label.color : "#000000"
}20`,
}}
>
@ -341,7 +342,8 @@ const SinglePage: NextPage<UserAuth> = (props) => {
<>
<Popover.Button
type="button"
className={`group inline-flex items-center outline-none ${open ? "text-gray-900" : "text-gray-500"
className={`group inline-flex items-center outline-none ${
open ? "text-gray-900" : "text-gray-500"
}`}
>
{watch("color") && watch("color") !== "" ? (
@ -418,7 +420,7 @@ const SinglePage: NextPage<UserAuth> = (props) => {
)}
<button
type="button"
className="flex items-center gap-1 rounded bg-gray-100 px-2.5 py-1 text-xs hover:bg-gray-200"
className="flex items-center gap-1 rounded bg-gray-100 px-2.5 py-1 text-xs hover:bg-gray-200 mt-4"
onClick={createPageBlock}
disabled={isAddingBlock}
>