-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the ability to change player skin #60
Conversation
Added the ability to change the player skin from the sidebar settings panel. Now users will be able to select different skins from the predefined list of skins (4 at the moment) and if they want to use any custom skin they can do so by toggling the swicth on and adding any custom skin URL in the input fields. Also added the thumbnails for the predefined skins for better user experience.
@Sidsector9 reminder on PR review here |
src/edit.js
Outdated
@@ -77,6 +77,15 @@ function Edit( props ) { | |||
[ clientId ] | |||
); | |||
|
|||
const [ useCustomUrl, setUseCustomUrl ] = useState( false ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
Because the hook is called after a return, that makes it conditional and violates the usage rules of hooks.
Can you move useState
to before line 58?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sidsector9 Makes sense. done. Thanks!
src/edit.js
Outdated
<div className="preview-wrapper"> | ||
{ defaultSkins.length && defaultSkins.map( ( skin, index ) => { | ||
return ( | ||
<label key={ index } className="winamp-radio-wrapper"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add htmlFor
to associate with the following input element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sidsector9 Done as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes. I have added fixes for some linting errors.
Description of the Change
Added the ability to change the player skin from the sidebar settings panel. Now users will be able to select different skins from the predefined list of skins (4 at the moment), for designs please see #1
Additionally, if users want to use any custom skin they can do so by toggling the switch on and adding any custom skin URL in the input field. Also added the thumbnails for the predefined skins for better user experience.
Closes #5
How to test the Change
Here's a screenshot:
When using custom skin input:
Changelog Entry
Credits
Props @jeffpaul @dkotter @zamanq
Checklist: