mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
feat: add custom font sizes to fields (#1376)
Adds custom font sizes to fields https://github.com/user-attachments/assets/1473a4d7-8dc6-4ead-acf5-dd78be7782a0
This commit is contained in:
@ -1,8 +1,4 @@
|
||||
interface TextFieldMeta {
|
||||
characterLimit?: number;
|
||||
readOnly?: boolean;
|
||||
required?: boolean;
|
||||
}
|
||||
import type { TTextFieldMeta as TextFieldMeta } from '../types/field-meta';
|
||||
|
||||
export const validateTextField = (
|
||||
value: string,
|
||||
@ -11,7 +7,7 @@ export const validateTextField = (
|
||||
): string[] => {
|
||||
const errors = [];
|
||||
|
||||
const { characterLimit, readOnly, required } = fieldMeta;
|
||||
const { characterLimit, readOnly, required, fontSize } = fieldMeta;
|
||||
|
||||
if (required && !value && isSigningPage) {
|
||||
errors.push('Value is required');
|
||||
@ -29,5 +25,9 @@ export const validateTextField = (
|
||||
errors.push('A field cannot be both read-only and required');
|
||||
}
|
||||
|
||||
if (fontSize && (fontSize < 8 || fontSize > 96)) {
|
||||
errors.push('Font size must be between 8 and 96.');
|
||||
}
|
||||
|
||||
return errors;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user