Open kr-matthews opened 3 years ago
Could this be solved using an "event selector" React component which is reused across all these different pages?
(Anyone implementing a Reach component to solve this should consider 6811 at the same time.)
We already do have a React component which is the horizontal bar in the above pictures. The vertical(ish) sidebar selector is still written in Ruby afaik so this is a matter of frankensteining together the Ruby state and React state. In the interest of developer sanity, I'd rather not explicitly tackle this. If we wait until the sidebar is also ported to React this issue solves itself.
Describe the bug If you go to Results > All for a competition with results posted (example), there are two event selector widgets. One is in the left side-bar and the other is at the top of the first table of results. There are multiple inconsistencies here:
Finally, it might make more sense if the side bar sub-options under Results were Podiums, By Event (instead of All), and By Person.
To Reproduce
Expected behavior
Screenshots Side-bar widget doesn't indicate current event (3x3): Widgets use orange/grey backwards: Side-bar widget doesn't update when page widget is used (megaminx vs 7x7):
Desktop (please complete the following information):
Additional context
There's a similar set of issues going on when you go to Scrambles in the side-bar, except that there's no event selector widget in the side-bar. It would make sense to have Scrambles and Results > All have the same setup and functionality (as described above).
There's also an event selector widget in the schedule. It would make sense if that was also consistent with the above, but note that it does behave slightly differently since there it's possible to select multiple events at once, whereas in results (and scrambles) you probably only need to be able to select either one event or all events.
Edit: There are also event selector widgets on the rankings page, records page, and competitions page, all of which function slightly differently. The first two are similar to the main two event selector widgets in this issue, while the last one is similar to the schedule event selector widget.
Finally, there are also event icons on the main info page of any competition (the events the competition is holding), and hovering over them changes the cursor and their colour, even though you can't click on them.
(First time adding an issue, so please let me know if I could/should be doing anything different.)