twlevelup / watch_edition_react

A smartwatch simulator, built in ReactJS
MIT License
3 stars 2 forks source link

Added the ability to select a contact and view their details #28

Closed sinan-aumarah closed 6 years ago

sinan-aumarah commented 6 years ago

@raytung @adamhope @AMitchemTW @aaron-m-edwards This is a quick spike to mimic the previous menu selection page. I refactored the contact list screen to make it stateful and store the index of a specific item in the list based on the top and bottom buttons. When you press on the screen it will then pass the index to the new contactView page which will display the contact's details

Please note: It's not the cleanest solution and it's currently all spiked up using the client code rather than the framework. Not sure if we want to make it an HOC and use Redux as it might confuse students even more. They already have a hard time trying to understand how the button remapping works, so not sure if we want to move everything to Redux. Feel free to modify it and make it cleaner.

adamhope commented 6 years ago

Most obvious issue is the naming, it's a generic menu screen not a contacts screen.

sinan-aumarah commented 6 years ago

@adamhope I agree. The idea behind this spike is to see if people agree on the approach and maybe then refactore it to be part of the framework, but I'm not even sure if we want to move it to the framework code as most of it is pure ReactJs code.

aaron-m-edwards commented 6 years ago

@sinan-aumarah You could still create a MenuScreen component. You would just need to pass in a list of Label/Action or Route pairs.