fix: switch custom text to input rather than textarea

This commit is contained in:
Lucas Smith
2024-02-24 11:22:53 +00:00
parent a5e51e63a1
commit d34c862688
2 changed files with 7 additions and 8 deletions

View File

@ -11,8 +11,8 @@ import type { FieldWithSignature } from '@documenso/prisma/types/field-with-sign
import { trpc } from '@documenso/trpc/react'; import { trpc } from '@documenso/trpc/react';
import { Button } from '@documenso/ui/primitives/button'; import { Button } from '@documenso/ui/primitives/button';
import { Dialog, DialogContent, DialogFooter, DialogTitle } from '@documenso/ui/primitives/dialog'; import { Dialog, DialogContent, DialogFooter, DialogTitle } from '@documenso/ui/primitives/dialog';
import { Input } from '@documenso/ui/primitives/input';
import { Label } from '@documenso/ui/primitives/label'; import { Label } from '@documenso/ui/primitives/label';
import { Textarea } from '@documenso/ui/primitives/textarea';
import { useToast } from '@documenso/ui/primitives/use-toast'; import { useToast } from '@documenso/ui/primitives/use-toast';
import { SigningFieldContainer } from './signing-field-container'; import { SigningFieldContainer } from './signing-field-container';
@ -118,21 +118,21 @@ export const TextField = ({ field, recipient }: TextFieldProps) => {
<Dialog open={showCustomTextModal} onOpenChange={setShowCustomTextModal}> <Dialog open={showCustomTextModal} onOpenChange={setShowCustomTextModal}>
<DialogContent> <DialogContent>
<DialogTitle> <DialogTitle>
Enter a Text <span className="text-muted-foreground">({recipient.email})</span> Enter your Text <span className="text-muted-foreground">({recipient.email})</span>
</DialogTitle> </DialogTitle>
<div className=""> <div className="">
<Label htmlFor="custom-text">Custom Text</Label> <Label htmlFor="custom-text">Custom Text</Label>
<Textarea <Input
id="custom-text" id="custom-text"
className="border-border mt-2 h-44 w-full rounded-md border" className="border-border mt-2 w-full rounded-md border"
onChange={(e) => setLocalCustomText(e.target.value)} onChange={(e) => setLocalCustomText(e.target.value)}
/> />
</div> </div>
<DialogFooter> <DialogFooter>
<div className="flex w-full flex-1 flex-nowrap gap-4"> <div className="mt-4 flex w-full flex-1 flex-nowrap gap-4">
<Button <Button
type="button" type="button"
className="dark:bg-muted dark:hover:bg-muted/80 flex-1 bg-black/5 hover:bg-black/10" className="dark:bg-muted dark:hover:bg-muted/80 flex-1 bg-black/5 hover:bg-black/10"

View File

@ -23,7 +23,6 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '
import { Input } from '../input'; import { Input } from '../input';
import { SignaturePad } from '../signature-pad'; import { SignaturePad } from '../signature-pad';
import { useStep } from '../stepper'; import { useStep } from '../stepper';
import { Textarea } from '../textarea';
import type { TAddSignatureFormSchema } from './add-signature.types'; import type { TAddSignatureFormSchema } from './add-signature.types';
import { ZAddSignatureFormSchema } from './add-signature.types'; import { ZAddSignatureFormSchema } from './add-signature.types';
import { import {
@ -333,8 +332,8 @@ export const AddSignatureFormPartial = ({
<FormItem> <FormItem>
<FormLabel required={requireCustomText}>Custom Text</FormLabel> <FormLabel required={requireCustomText}>Custom Text</FormLabel>
<FormControl> <FormControl>
<Textarea <Input
className="bg-background h-44" className="bg-background"
{...field} {...field}
onChange={(value) => { onChange={(value) => {
onFormValueChange(FieldType.TEXT); onFormValueChange(FieldType.TEXT);