Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFT Tags #128

Open
affiliatepayday opened this issue Oct 10, 2021 · 0 comments
Open

NFT Tags #128

affiliatepayday opened this issue Oct 10, 2021 · 0 comments

Comments

@affiliatepayday
Copy link

affiliatepayday commented Oct 10, 2021

Not sure if there was a better way to do this, or if this will help anyone else... but I have added some code to add tags NFT on NFT assets and on NFT issue asset pages of the explorer.

This was added to src/js/components/Dictionary/Dictionary.view.js directly before the render().

    componentDidMount(){
        var qtf = document.querySelector(".dictionary .dictionary-pair:nth-child(8) .dictionary-pair-value") !== null;
        var dtf = document.querySelector(".dictionary .dictionary-pair:nth-child(9) .dictionary-pair-value") !== null;
        var rtf = document.querySelector(".dictionary .dictionary-pair:nth-child(11) .dictionary-pair-value") !== null;
        if (qtf && dtf && rtf) {
            var quan = document.querySelector(".dictionary .dictionary-pair:nth-child(8) .dictionary-pair-value").innerHTML
            var quant = quan.charAt(0);
            var quanti = quan.charAt(1)
            var dec = document.querySelector(".dictionary .dictionary-pair:nth-child(9) .dictionary-pair-value").innerHTML;
            var reiss = document.querySelector(".dictionary .dictionary-pair:nth-child(11) .dictionary-pair-value").innerHTML;
            if (quant == 1 && quanti == ' ' && dec == 0 && reiss == 'false') {
                var typ = document.querySelector(".dictionary .dictionary-pair .dictionary-pair-value");
                typ.insertAdjacentHTML('beforeend', '<span class="badge" style="background-color: #ff5e00;margin-left: 5px;">Non-Fungible</span>');
            }
        }
        var dtfa = document.querySelector(".dictionary .dictionary-pair:nth-child(7) .dictionary-pair-value") !== null;
        var rtfa = document.querySelector(".dictionary .dictionary-pair:nth-child(8) .dictionary-pair-value") !== null;
        var qtfa = document.querySelector(".dictionary .dictionary-pair:nth-child(9) .dictionary-pair-value") !== null;
        if (qtfa && dtfa && rtfa) {
            var quana = document.querySelector(".dictionary .dictionary-pair:nth-child(9) .dictionary-pair-value").innerHTML
            var quanta = quana.charAt(0);
            var quantaa = quana.charAt(1);
            var deca = document.querySelector(".dictionary .dictionary-pair:nth-child(7) .dictionary-pair-value").innerHTML;
            var reissa = document.querySelector(".dictionary .dictionary-pair:nth-child(8) .dictionary-pair-value").innerHTML;
            if (quanta == 1 && quantaa == ' ' && deca == 0 && reissa == 'false') {
                var typa = document.querySelector(".headline");
                typa.insertAdjacentHTML('beforeend', '<span class="badge" style="background-color: #ff5e00;margin-left: 5px;width: 100px;height: 28px;text-align: center;padding-top: 6px;">Non-Fungible</span>');
            }
        }
    }

The results:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant