Closed modersohn closed 2 years ago
We already have the NftMetadata class which we could serialize into a string that could be displayed somewhere? Though some people have mentioned adding extra fields in their metadata which wouldn't be serialized at all I believe. Otherwise we could have a button that opens the ipfs metadata link in another tab like the official explorer.
If we serialize the text ourselves we should use something like prism.js to make the json prettier with highlighting. Example here https://liamhunt.blog/2022/prism-js-syntax-highlighting-in-blazor/
I don't think re-serialising the JSON is good idea - the user wants to see the on-chain JSON, not something we generated that might be equal but then also might not. Since we get the raw text already, I don't think it's a problem to keep all of the text with the deserialised object itself.
I have a relatively simple version and explicitly did not go the full way via prism. The JSON is properly intended and shown in a readonly text editor in a MudDialog, which allows for proper scrolling and ease copy/paste.
PR coming up
Fixed with #192
Like official explorer does, but maybe a bit nicer?