code-for-charlottesville / housinghub

GNU General Public License v3.0
14 stars 23 forks source link

alert branch + basic sidebar filter #125

Closed jnoowin closed 3 years ago

jnoowin commented 3 years ago

Currently it kinda filters what is displayed in the table given the criteria from the side bar. There are a couple of things of note

I used a Map to map between the sidebar input(SearchTools.js/searchFields state in reducer) and the various property attribute(property.js state in reducer) so that checking each property wouldn't have to go through a bunch of if/else or switch/cases. But there's definitely some weirdness with the sidebar input state not being initialized until an actual input is given and not having a default value. Also some of the criteria in the sidebar doesn't really match to a property attribute from what I could tell, so I have them commented out. Also the Map could probably be memoized if needed because it is created for every single property.