mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
Compare commits
1 Commits
v1.13.1
...
fix/font-s
| Author | SHA1 | Date | |
|---|---|---|---|
| fbbb0289c3 |
@ -157,6 +157,7 @@ export const DocumentSigningDateField = ({
|
||||
'!text-right': parsedFieldMeta?.textAlign === 'right',
|
||||
},
|
||||
)}
|
||||
style={{ fontSize: `${parsedFieldMeta?.fontSize}px` }}
|
||||
>
|
||||
{localDateString}
|
||||
</p>
|
||||
|
||||
@ -132,7 +132,10 @@ export const DocumentSigningEmailField = ({
|
||||
)}
|
||||
|
||||
{field.inserted && (
|
||||
<DocumentSigningFieldsInserted textAlign={parsedFieldMeta?.textAlign}>
|
||||
<DocumentSigningFieldsInserted
|
||||
textAlign={parsedFieldMeta?.textAlign}
|
||||
fontSize={parsedFieldMeta?.fontSize}
|
||||
>
|
||||
{field.customText}
|
||||
</DocumentSigningFieldsInserted>
|
||||
)}
|
||||
|
||||
@ -27,14 +27,20 @@ type DocumentSigningFieldsInsertedProps = {
|
||||
* Defaults to left.
|
||||
*/
|
||||
textAlign?: 'left' | 'center' | 'right';
|
||||
|
||||
/**
|
||||
* The font size of the field in pixels.
|
||||
*/
|
||||
fontSize?: number;
|
||||
};
|
||||
|
||||
export const DocumentSigningFieldsInserted = ({
|
||||
children,
|
||||
textAlign = 'left',
|
||||
fontSize,
|
||||
}: DocumentSigningFieldsInsertedProps) => {
|
||||
return (
|
||||
<div className="flex h-full w-full items-center overflow-hidden">
|
||||
<div className="flex h-full w-full items-center overflow-visible">
|
||||
<p
|
||||
className={cn(
|
||||
'text-foreground w-full whitespace-pre-wrap text-left text-[clamp(0.425rem,25cqw,0.825rem)] duration-200',
|
||||
@ -43,6 +49,7 @@ export const DocumentSigningFieldsInserted = ({
|
||||
'!text-right': textAlign === 'right',
|
||||
},
|
||||
)}
|
||||
style={{ fontSize: `${fontSize}px` }}
|
||||
>
|
||||
{children}
|
||||
</p>
|
||||
|
||||
@ -139,7 +139,10 @@ export const DocumentSigningInitialsField = ({
|
||||
)}
|
||||
|
||||
{field.inserted && (
|
||||
<DocumentSigningFieldsInserted textAlign={parsedFieldMeta?.textAlign}>
|
||||
<DocumentSigningFieldsInserted
|
||||
textAlign={parsedFieldMeta?.textAlign}
|
||||
fontSize={parsedFieldMeta?.fontSize}
|
||||
>
|
||||
{field.customText}
|
||||
</DocumentSigningFieldsInserted>
|
||||
)}
|
||||
|
||||
@ -178,7 +178,10 @@ export const DocumentSigningNameField = ({
|
||||
)}
|
||||
|
||||
{field.inserted && (
|
||||
<DocumentSigningFieldsInserted textAlign={parsedFieldMeta?.textAlign}>
|
||||
<DocumentSigningFieldsInserted
|
||||
textAlign={parsedFieldMeta?.textAlign}
|
||||
fontSize={parsedFieldMeta?.fontSize}
|
||||
>
|
||||
{field.customText}
|
||||
</DocumentSigningFieldsInserted>
|
||||
)}
|
||||
|
||||
@ -253,7 +253,10 @@ export const DocumentSigningNumberField = ({
|
||||
)}
|
||||
|
||||
{field.inserted && (
|
||||
<DocumentSigningFieldsInserted textAlign={parsedFieldMeta?.textAlign}>
|
||||
<DocumentSigningFieldsInserted
|
||||
textAlign={parsedFieldMeta?.textAlign}
|
||||
fontSize={parsedFieldMeta?.fontSize}
|
||||
>
|
||||
{field.customText}
|
||||
</DocumentSigningFieldsInserted>
|
||||
)}
|
||||
|
||||
@ -250,7 +250,10 @@ export const DocumentSigningTextField = ({
|
||||
)}
|
||||
|
||||
{field.inserted && (
|
||||
<DocumentSigningFieldsInserted textAlign={parsedFieldMeta?.textAlign}>
|
||||
<DocumentSigningFieldsInserted
|
||||
textAlign={parsedFieldMeta?.textAlign}
|
||||
fontSize={parsedFieldMeta?.fontSize}
|
||||
>
|
||||
{field.customText}
|
||||
</DocumentSigningFieldsInserted>
|
||||
)}
|
||||
|
||||
@ -188,9 +188,11 @@ export const FieldContent = ({ field, documentMeta }: FieldIconProps) => {
|
||||
}
|
||||
|
||||
const textAlign = fieldMeta && 'textAlign' in fieldMeta ? fieldMeta.textAlign : 'left';
|
||||
const fontSize = fieldMeta && 'fontSize' in fieldMeta ? fieldMeta.fontSize : undefined;
|
||||
const fontSizeStyle = fontSize ? { fontSize: `${fontSize}px` } : {};
|
||||
|
||||
return (
|
||||
<div className="flex h-full w-full items-center overflow-hidden">
|
||||
<div className="overflow-visibile flex h-full w-full items-center">
|
||||
<p
|
||||
className={cn(
|
||||
'text-foreground w-full whitespace-pre-wrap text-left text-[clamp(0.07rem,25cqw,0.825rem)] duration-200',
|
||||
@ -200,6 +202,7 @@ export const FieldContent = ({ field, documentMeta }: FieldIconProps) => {
|
||||
'font-signature text-[clamp(0.07rem,25cqw,1.125rem)]': isSignatureField,
|
||||
},
|
||||
)}
|
||||
style={fontSizeStyle}
|
||||
>
|
||||
{textToDisplay || labelToDisplay}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user