Skip to content

Commit

Permalink
fix(locksmith): not showing even logo on images because format unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
julien51 committed Apr 24, 2024
1 parent 7da9661 commit ec53b64
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
1 change: 0 additions & 1 deletion locksmith/.op.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ STORAGE_ACCESS_KEY_ID=op://secrets/cloudflare/storage-access-key-id-prod
STORAGE_SECRET_ACCESS_KEY=op://secrets/cloudflare/storage-secret-access-key-prod
STORAGE_PUBLIC_HOST=op://secrets/cloudflare/storage-public-host-prod
LOGTAIL=op://secrets/logtail/logtail-prod
WEDLOCKS=op://secrets/wedlocks/private-key
PURCHASER_CREDENTIALS=op://secrets/purchaser/credentials-prod
ON_HEROKU=true
GITCOIN_API_KEY=op://secrets/gitcoin/api-key
Expand Down
1 change: 0 additions & 1 deletion locksmith/.op.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ STORAGE_ACCESS_KEY_ID=op://secrets/cloudflare/storage-access-key-id-staging
STORAGE_SECRET_ACCESS_KEY=op://secrets/cloudflare/storage-secret-access-key-staging
STORAGE_PUBLIC_HOST=op://secrets/cloudflare/storage-public-host-staging
LOGTAIL=op://secrets/logtail/logtail-staging
WEDLOCKS=op://secrets/wedlocks/private-key
PURCHASER_CREDENTIALS=op://secrets/purchaser/credentials-staging
ON_HEROKU=true
GITCOIN_API_KEY=op://secrets/gitcoin/api-key
Expand Down
2 changes: 1 addition & 1 deletion locksmith/src/operations/stripeOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export const stripeConnection = async (
try {
account = await stripe.accounts.retrieve(stripeAccount)
} catch (error) {
console.error(error)
logger.error(error)
}
return account
}
Expand Down
11 changes: 6 additions & 5 deletions locksmith/src/utils/ticket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ export const createTicket = async ({
)

const email = metadata?.userMetadata?.protected?.email
const imageURL: string =
metadata?.image ||
`${config.services.locksmith}/lock/${lockAddress}/icon?id=${tokenId}`
const iconURL = await imageUrlToBase64(imageURL, lockAddress)
// Disabled because if the image is too big, this breaks satori (it broke for Farcon)
// const imageURL: string =
// // metadata?.image ||
// `${config.services.locksmith}/lock/${lockAddress}/icon?id=${tokenId}`
// const iconURL = await imageUrlToBase64(imageURL, lockAddress)

const ticket = await satori(
<div
Expand All @@ -73,7 +74,7 @@ export const createTicket = async ({
}}
>
<Ticket
iconURL={iconURL}
// iconURL={iconURL}
title={metadata?.name || name}
email={email}
id={tokenId}
Expand Down
22 changes: 12 additions & 10 deletions packages/ui/lib/components/Ticket/Ticket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,22 @@ export function Ticket({
padding: '24px 0',
}}
>
<img
width={64}
height={64}
style={{
borderRadius: '6px',
}}
src={iconURL}
alt={title}
/>
{iconURL && (
<img
width={64}
height={64}
style={{
borderRadius: '6px',
}}
src={iconURL}
alt={title}
/>
)}
<div
style={{
lineHeight: '34px',
fontSize: '24px',
paddingLeft: '24px',
paddingLeft: iconURL ? '24px' : '0px',
fontWeight: 700,
}}
>
Expand Down

0 comments on commit ec53b64

Please sign in to comment.