fix(add_enable_all_disable_all_buttons): this PR adds enable and disable all patterns to the UI to quickly manage all patterns if desired. #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The UI on the page loads if nothing is enabled,
DisableAll
is disabled, andEnableAll
is enabled.When the
EnableAll
button is pushed, we show a spinner (this is useful when there is a persistent store on the backend in another PR in this repo.) so that users do not get trigger-happy. The implementation of this spinner is a little hacky. React lifecycles are opinionated on how it re-renders the UI for performance optimization... we trick it by setting a timeout and using the timeout callback.This is the UI when the page is loaded, and all patterns are enabled. Note the
Enable All
button is disabled, and theDisable All
button is activated. This is so the user doesn't add the same patterns to the same playlist, preventing accidental duplicates.This is the result of a user clicking on
Disable All
. Note theEnable All
button is activated, and theDisable All
button is disabled. The UI reflects nothing is in the current playlist, and the local storage also shows[]
.This PR resolves #45