mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 09:12:02 +10:00
check if date field is in use
This commit is contained in:
@ -44,6 +44,8 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) =
|
|||||||
|
|
||||||
const [validateUninsertedFields, setValidateUninsertedFields] = useState(false);
|
const [validateUninsertedFields, setValidateUninsertedFields] = useState(false);
|
||||||
|
|
||||||
|
const hasDateField = fields.find((field) => field.type === 'DATE');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
formState: { isSubmitting },
|
formState: { isSubmitting },
|
||||||
@ -113,27 +115,29 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) =
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
{hasDateField && (
|
||||||
<Label htmlFor="date-format">Date Format</Label>
|
<div>
|
||||||
|
<Label htmlFor="date-format">Date Format</Label>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
setDateFormat(value);
|
setDateFormat(value);
|
||||||
}}
|
}}
|
||||||
defaultValue={dateFormat}
|
defaultValue={dateFormat}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="bg-background mt-2">
|
<SelectTrigger className="bg-background mt-2">
|
||||||
<SelectValue />
|
<SelectValue />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{DATE_FORMATS.map((format) => (
|
{DATE_FORMATS.map((format) => (
|
||||||
<SelectItem key={format.key} value={format.value}>
|
<SelectItem key={format.key} value={format.value}>
|
||||||
{format.label}
|
{format.label}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Label htmlFor="Signature">Signature</Label>
|
<Label htmlFor="Signature">Signature</Label>
|
||||||
|
|||||||
Reference in New Issue
Block a user