Odd Jobs

May 20th, 2020
maps

Staying Busy

We're pretty far into our React Native application at work, and things are coming right along. However, there's still a lot left to be done, and I'm currently hitting some roadblocks. Since I don't have the ability to write the APIs in C#, although I'm trying to learn, I have to wait on my other teammate to get them done before I move on. Right now, I have one API to work with. When the user comes to the search screen, the list of leads is populated from this API, along with the representative's filter results. They can filter their leads by city, state, county, or type of lead, and I have the appropriate items associated with each category. I need another API, though, to actually filter the results by these filters. This API will take in the different checked results and query the backend with those filters. I could do this on the API, but my cohort says it would be better to handle this on the backend, and I'm sure he's right. I also need another API that, when a lead is clicked on, all of their details are given. This will pop onto the stack and the representative will be taken to a screen where they can view and edit that information. I have this screen with hard-coded data in it right now, but I could do so much work if I was given this API, in particular.

maps

While I wait, I'm working on some odds and ends. Yesterday, I created a component that works with both web and native to bring in animated graphics from Lottie. These graphics are really cool and they add a lot of life to the page. When I left yesterday, I had hooked one of these up to the search page, and it looked awesome. I started off my day hooking a couple more around the application. It might be something we want to do sparingly, but I think it adds a lot to the application and it will be received well. My only concern is these graphics may be costly to performance. In a development environment, it's difficult to tell, but when we get to testing it a little further, we could dumb down the connection a little bit and see how it goes. Right now, the most expensive thing for performance for our application is bringing in the lead list. For some representatives, this list is over 1000 items long, and a card has to be populated for each. I'm looking into some ways to optimize this, like lazy loading it, but so far, I haven't come up with much. There are some configuration options I've set up on the FlatList that have helped quite a bit, but again, it may be totally different on a slower internet connection. Anyways, after I worked out some of the bugs that were left with the Lottie animations, I decided to leave it alone; I think I could easily go overboard with these and end up adding way too many. I know I will be using them for my next portfolio site.

maps

Actually, before I even got started on these Lottie animations today, I started off the day with fixing some bugs in the styling on the individual lead page. Somehow, the margins had gotten all screwed up. I've found that, with CSS, sometimes you try to fix something and nothing happens. I had this issue today. I tried to change the margin in one component, nothing happened. Tried another component, nothing. I had to trace it all the way up to the base component, check the margin on this, and then trace it back down. Apparently, I had double booked some margins and it took me some time to unravel this. It was a pain, but I got it done. My next move was to work on some mapping functionality. On the individual lead page, there is a button where the representative should be able to get directions to the lead's address from their current location. Anytime you try to bring in mapping functionality to an application, things get real complicated. This ended up taking three different packages to get working. I first had to get a package that would open whatever mapping application the representative has on their device. Then, I needed a package to get the user's coordinates from their current location so the mapping application knows where they are. Then, I needed to get a package that would take in the address of the lead and convert it into coordinates. Getting these all to play nice together was not easy, but by the end of the day, I had it up and running. Unfortunately, this only works for native devices, and I'm going to have to come up with a completely different system for the web. That will likely be my day tomorrow.

Until tomorrow!

Created by Sam Thoyre, © 2019