fix: page block padding fix (#1034)

This commit is contained in:
Anmol Singh Bhatia 2023-05-11 18:41:13 +05:30 committed by GitHub
parent 1329145173
commit 9cb3794dde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View File

@ -95,10 +95,11 @@ export const CreateBlock = () => {
name="name"
placeholder="Title"
register={register}
className="min-h-10 block max-h-24 w-full resize-none overflow-hidden border-none bg-transparent px-1 py-1 text-sm font-medium"
className="min-h-[20px] block max-h-24 w-full resize-none overflow-hidden border-none bg-transparent px-1 py-1 text-sm font-medium"
role="textbox"
onKeyDown={handleKeyDown}
maxLength={255}
noPadding
/>
</div>

View File

@ -408,7 +408,8 @@ export const SinglePageBlock: React.FC<Props> = ({ block, projectDetails, index
<TextArea
name="blockName"
value={block.name}
className="min-h-5 block w-full resize-none overflow-hidden border-none bg-transparent px-0 py-0 text-sm text-brand-base"
className="min-h-[20px] block w-full resize-none overflow-hidden border-none bg-transparent text-sm text-brand-base"
noPadding
/>
</div>
{block?.description_stripped.length > 0 && (

View File

@ -32,6 +32,7 @@ export const TextArea: React.FC<Props> = ({
disabled,
error,
validations,
noPadding = false,
onChange,
...rest
}) => {
@ -65,7 +66,9 @@ export const TextArea: React.FC<Props> = ({
onChange && onChange(e);
setTextareaValue(e.target.value);
}}
className={`no-scrollbar w-full bg-transparent px-3 py-2 outline-none ${
className={`no-scrollbar w-full bg-transparent ${
noPadding ? "" : "px-3 py-2"
} outline-none ${
mode === "primary"
? "rounded-md border border-brand-base"
: mode === "transparent"

View File

@ -9,4 +9,5 @@ export interface Props extends React.ComponentPropsWithoutRef<"textarea"> {
mode?: "primary" | "transparent" | "secondary" | "disabled";
validations?: RegisterOptions;
error?: FieldError | Merge<FieldError, FieldErrorsImpl<any>>;
noPadding?: boolean;
}