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