fix(pdf): dynamic mark scaling #165
@ -428,9 +428,7 @@ export const DrawPDFFields = (props: Props) => {
|
|||||||
sx={{
|
sx={{
|
||||||
background: 'white'
|
background: 'white'
|
||||||
}}
|
}}
|
||||||
renderValue={(value) =>
|
renderValue={(value) => renderCounterpartValue(value)}
|
||||||
renderCounterpartValue(drawnField, value)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{users
|
{users
|
||||||
.filter((u) => u.role === UserRole.signer)
|
.filter((u) => u.role === UserRole.signer)
|
||||||
@ -491,14 +489,14 @@ export const DrawPDFFields = (props: Props) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderCounterpartValue = (drawnField: DrawnField, value: string) => {
|
const renderCounterpartValue = (value: string) => {
|
||||||
const user = users.find((u) => u.pubkey === npubToHex(value))
|
const user = users.find((u) => u.pubkey === npubToHex(value))
|
||||||
if (user) {
|
if (user) {
|
||||||
let displayValue = truncate(value, {
|
let displayValue = truncate(value, {
|
||||||
length: 16
|
length: 16
|
||||||
})
|
})
|
||||||
|
|
||||||
const metadata = props.metadata[value]
|
const metadata = props.metadata[user.pubkey]
|
||||||
|
|
||||||
if (metadata) {
|
if (metadata) {
|
||||||
displayValue = truncate(
|
displayValue = truncate(
|
||||||
@ -511,8 +509,8 @@ export const DrawPDFFields = (props: Props) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AvatarIconButton
|
<AvatarIconButton
|
||||||
src={props.metadata[drawnField.counterpart]?.picture}
|
src={props.metadata[user.pubkey]?.picture}
|
||||||
hexKey={npubToHex(drawnField.counterpart) || undefined}
|
hexKey={npubToHex(user.pubkey) || undefined}
|
||||||
sx={{
|
sx={{
|
||||||
padding: 0,
|
padding: 0,
|
||||||
marginRight: '6px',
|
marginRight: '6px',
|
||||||
|
Loading…
Reference in New Issue
Block a user