After #13 is merged GamesVisibilityList.tsx is going to be a bit cluttered, not to mention GameVisibilityToggle component is probably more specific than needed. The task is as follows:
[ ] Extract GameVisibilityToggle into its own file, call it CheckboxRow
[ ] CheckboxRow is a generic component that accepts: name, label, default check value and callback to invoke on change
[ ] Change the outer <div> to <label> and ensure IDs matching and unique IDs are set both in the label and input to ensure clicking on the text toggles the checkbox
[ ] Modify GamesVisibilityList to use that new component
[ ] As a bonus feel free to add a new directory to the components directory, to separate the reusable components from the specific ones
The goal is to get some experience creating generic, reusable components.
After #13 is merged
GamesVisibilityList.tsx
is going to be a bit cluttered, not to mentionGameVisibilityToggle
component is probably more specific than needed. The task is as follows:GameVisibilityToggle
into its own file, call itCheckboxRow
CheckboxRow
is a generic component that accepts: name, label, default check value and callback to invoke on change<div>
to<label>
and ensure IDs matching and unique IDs are set both in the label and input to ensure clicking on the text toggles the checkboxGamesVisibilityList
to use that new componentThe goal is to get some experience creating generic, reusable components.