Skip to content

Commit

Permalink
refactor(renderer): metadata tweaks (#273)
Browse files Browse the repository at this point in the history
* refactor(renderer): update banner logic + update custom description

* fix: add missing bracket

* fix: lint
  • Loading branch information
0xble authored and arr00 committed Aug 28, 2023
1 parent aeb0d7d commit a16f445
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contracts/renderers/PartyNFTRenderer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,12 @@ contract PartyNFTRenderer is RendererBase {
: metadata.collectionExternalURL,
'", "image":"',
bytes(metadata.image).length == 0 ? image : metadata.image,
'", "banner":"',
bytes(metadata.banner).length == 0 ? banner : metadata.banner,
// Determine which banner to render.
bytes(metadata.banner).length == 0
? bytes(metadata.image).length == 0 // No custom banner and no custom image, use the default Party banner.
? string.concat('", "banner":"', banner) // No custom banner but custom image, do not include banner in metadata.
: ""
: string.concat('", "banner":"', metadata.banner), // Custom banner, use it.
'"}'
)
)
Expand Down Expand Up @@ -196,7 +200,7 @@ contract PartyNFTRenderer is RendererBase {
: string.concat(
metadata.description,
// Append default description.
" ",
"\n\n",
generateDescription(
PartyGovernanceNFT(address(this)).name(),
tokenId
Expand Down

0 comments on commit a16f445

Please sign in to comment.