website icon indicating copy to clipboard operation
website copied to clipboard

Clean up Player component

Open simeydk opened this issue 5 years ago • 2 comments

The current version of the Player component is massive: 280 lines with 10 items of state and 13 custom methods.

This could be improved in the following potential ways:

  • [ ] move the Progressbar and its associated state (tooltip value and tooltip location) into a separate component
  • [ ] Change the Volumebars to a stateless functional component and remove its reliance on localstorage
  • [ ] Reorganise and simplify the localstorage logic - it uses a nested object instead of storing values directly, and there is a lot of complex logic around when to write to localstorage and when to read from localstorage

This should enable easier enhancements and changes further on. Would this be something that you're interested in?

I would like to try implementing some of these changes if this is something that you are interested in.

simeydk avatar Nov 24 '19 15:11 simeydk

PR #414 attempts to address the second item. it greatly reduces the number of lines in the Volumebars component and removes its unnecessary reliance on localstorage.

simeydk avatar Nov 24 '19 15:11 simeydk

PR #415 attempts to address the third item. It creates a simpler interface with localstorage and reduces the number of lines of code in Player.js by 14.

simeydk avatar Nov 24 '19 15:11 simeydk