feat: Added option to hide powerups from reward menu #1049
Closed
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.
Proposed changes
in the reward menu the options for power ups are now always displayed above all the channel point rewards. To make the menu cleaner an option to hide these power ups should be added.
Types of changes
What types of changes does your code introduce to 7TV?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
A slider option to hide the power ups from the reward menu was added to the settings under Site Layout -> Twitch Features:
![Screenshot 2024-06-19 214442](https://private-user-images.githubusercontent.com/103491518/341189067-6c62c6a1-96c4-4c06-b4ba-f7e4811a3188.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODA0NTUsIm5iZiI6MTcyNTk4MDE1NSwicGF0aCI6Ii8xMDM0OTE1MTgvMzQxMTg5MDY3LTZjNjJjNmExLTk2YzQtNGMwNi1iNGJhLWY3ZTQ4MTFhMzE4OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMFQxNDU1NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lMTZmMTc5ZTNhYjJjOWZkMGZkNjY5YmJiZTAwOWQ2YzYzZWNmM2UzMTBhYjQyZDlkZGVlNjMxMjQ0YTExYjdiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.ATfJb95UHv3SI8tWgIkZRs4hOQs-3eHct2V7hbamB28)
It was a bit tricky to make sure the right elements get hidden, since all the rewards, power ups and category headlines are on the same level in hierarchy and don't have any classes to make them unique. Furthermore depending on if a challenge or prediction are active an additional div for the category "Challenges and Predictions" can be existent or not (the divs for the actual challenge or prediction are always existing, just the one for the header is optional). With the implementation I chose it should always hide the correct divs regardless of that.
Reward menu with power ups:
![Screenshot 2024-06-19 215252](https://private-user-images.githubusercontent.com/103491518/341191011-270a7a6a-d90c-423e-9534-f0090d2b2f28.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODA0NTUsIm5iZiI6MTcyNTk4MDE1NSwicGF0aCI6Ii8xMDM0OTE1MTgvMzQxMTkxMDExLTI3MGE3YTZhLWQ5MGMtNDIzZS05NTM0LWYwMDkwZDJiMmYyOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMFQxNDU1NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMzQyNGFjY2IxNDNiNzg0YzQ1MzFjNzI5MzU1OGUwZDcxOTEzYjViNTQxNjM2YmEyMTc5NTRjNTRmMjFlMzNiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.U6E_hE50iBzskSNzNRCH7VRV1oQqUT6fqxEcT3WzOZA)
Reward menu with power ups and active prediction:
![Screenshot 2024-06-19 215357](https://private-user-images.githubusercontent.com/103491518/341191104-212fd2d0-f2df-449b-b4b7-cb590a55d600.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODA0NTUsIm5iZiI6MTcyNTk4MDE1NSwicGF0aCI6Ii8xMDM0OTE1MTgvMzQxMTkxMTA0LTIxMmZkMmQwLWYyZGYtNDQ5Yi1iNGI3LWNiNTkwYTU1ZDYwMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMFQxNDU1NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MmQwMzE1YWU0ZmM5ZDUxZGIyMDM1MmIwNjExMWUyNzU2ZjgxYmZlNjQzODQ5NWI4M2M2ZmM2YzIyYTA1NTg4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.cIA9tfhoP__6LMOPt37HksF5HySXq7Q3G0V-esj5Qno)
Reward menu without power ups:
![Screenshot 2024-06-19 215450](https://private-user-images.githubusercontent.com/103491518/341191166-2a1e242f-d277-4f03-924d-af038d66e92f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODA0NTUsIm5iZiI6MTcyNTk4MDE1NSwicGF0aCI6Ii8xMDM0OTE1MTgvMzQxMTkxMTY2LTJhMWUyNDJmLWQyNzctNGYwMy05MjRkLWFmMDM4ZDY2ZTkyZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMFQxNDU1NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yY2MyNDdiMGQxYTk5ODU4ZTFiOWJmODNlYTUwOGY4ODljOWRiOTJhNGFlYmYwOTYyNmQyMTQzNTJjZWE3ZWIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.8Sz17Mxf_GmnDTTspIW4OAs0zUc-aQKEgym3t3sW4-0)
Reward menu without power ups and active prediction:
![Screenshot 2024-06-19 215426](https://private-user-images.githubusercontent.com/103491518/341191280-61802e87-7c60-4f18-87c9-afb6c31c06ab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODA0NTUsIm5iZiI6MTcyNTk4MDE1NSwicGF0aCI6Ii8xMDM0OTE1MTgvMzQxMTkxMjgwLTYxODAyZTg3LTdjNjAtNGYxOC04N2M5LWFmYjZjMzFjMDZhYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMFQxNDU1NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05ZGE2NTc5Y2U2YzBkOGYwNDA2MTgzNTA2YWRhOTljODY1YWJmMTc4NTZlN2YxMDQ4NjUxMzZjODZkOGI1ZmMyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.M69tv-m3HnKL_skdTtFeNQtH8cxOjB7OSZwX8yo4dRs)