It’s the end of the week, yay! I don’t really have anything urgent to work on today, so I’m not quite sure whether I’m going to work on the DEX React dynamic menu stuff that I was working on or focus on Anchor development. Anchor is probably the most urgent, so I’ll probably start there and work on the React stuff this afternoon.
I had a pretty good day yesterday, I spent most of it digging into the aforementioned React code. We’re trying to make the StarAtlas.Exchange menu render dynamically off of the official NFT JSON feed. There’s a lot going on there though. First off we have to map the items, sorting them into the main itemTypes and categories. I did this using maps of maps of maps. Then we have to iterate through each level, rendering some AntD code at each level. It’s pretty ugly and took me all day to figure it out. The problem we’re having is that the top level submenu props are getting shared between all elements in the map, which is causing them to share the same mouse-over code. That’s where I finished up yesterday. Someone on the team figured out that if we pull the code into a parent component, where the menu gets rendered, that it doesn’t have the problem, but there’s got to be a way to separate the code to make it cleaner.
The next task is to pull the code that requests the NFT feed out of the menu generator. We need to use it for the token list as well, and there’s no point to having it called twice. So we’ll need to slap it into a context provider so that we can reuse the data in different places. Once we do that we should be able to do all sort of wonderful things like pull item details such as pictures on the individual market pages.
As far as Anchor goes, I went through the tutorials for the second time. Reading it makes sense, writing… well, I haven’t attempted that yet. Just knowing how to deploy these things and write scripts that can be used to interact with them is going to be enough for today. Since I’m done with the tutorials, the first thing I want to do is go through the existing examples and see what I can use. There’s a vesting contract that I’d like to extend. The way it works now is just one token address for one recipient, but I want to see if I can extend it to provide multiple token allocations for all SAIAdao members.