type: (nft:DataClientNFT, groups:Groups): { nft:DataClientNFT, groups:Groups },default: (nft:DataClientNFT, groups:Groups):Groups=> {// these assets are what will display next to the `nft`// feel free to sort them, or split them into new Groupsreturn { nft, groups };}// exfunctionyourOnPopulateFunction (...) {...}data-on-populate=yourOnPopulateFunction
Allows for sorting of the assets returned by the Data Client into specified groups, and allows for inspection of the core ERC6551 NFT as nft.
The assets can be returned as is, or modified in order to sort and regroup the NFTs.
You may also customize whether the NFTs in each group are selectable and the max selectableLimit of each group.
This data is updated as the user interacts with the widget, and returned into the on-call-to-action callback for your usage.
The backpack layout will automatically create a headline for each of the returnedGroups and break up the grid into sections based on said headline.
You may optional give selectedIndices an initial value in order to have the widget preselect those NFTs on initial render.
When both data-on-call-to-action and data-call-to-action-textare defined, a call to action button will appear in the top right of the UX with your specifed text inside of it.
When clicked, it will perform you call to action callback. The UX will disable while your callback executes asynchronously.
The data-only-owner-can-call-to-action option will cause a Connect Widget to appear, and cause the CTA button to disable unless the user is the owner of the ERC6551 NFT.
One example usage for this would be PFPs and 3D Avatars that could potentially execute a "Dress Up" call to action whenever the owner is done selecting NFTs from each Group to "wear", you can then modify the nft data before passing it back in order to show the updates!
/*! * Toastify js 1.12.0 * https://github.com/apvarun/toastify-js * @license MIT licensed * * Copyright (C) 2018 Varun A P */// Here are the defaults so you know what's already defined and what you might // want to override.// These are the little toast that show up in the top right during transefr tx..toastify {padding:12px 20px;color:#ffffff;display:inline-block;box-shadow:0 3px 6px -1pxrgba(0, 0, 0, 0.12), 0 10px 36px -4pxrgba(77, 96, 232, 0.3);position:fixed;opacity:0;transition:all 0.4scubic-bezier(0.215, 0.61, 0.355, 1);border-radius:2px;cursor:pointer;text-decoration:none;max-width:calc(50%- 20px);z-index:2147483647;}.toast-close {background:transparent;border:0;color:white;cursor:pointer;font-family:inherit;font-size:1em;opacity:0.4;padding:0 5px;}.toastify-rounded {border-radius:25px;}