Skip to content
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

Merged
merged 9 commits into from
Oct 14, 2022
Merged

Added the ability to change player skin #60

merged 9 commits into from
Oct 14, 2022

Conversation

zamanq
Copy link
Contributor

@zamanq zamanq commented Aug 29, 2022

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

  1. Create a new post/page
  2. Select the "Winamp Block" block
  3. In the sidebar settings panel(under Winamp Player Skin), you'll see the new predefined skins with thumbnails and a toggle switch to use custom skin

Here's a screenshot:

predefined-skins

When using custom skin input:
custom-skin-option

Changelog Entry

Added - Added the ability to change player skin from predefined list of skins with an option for custom skin input

Credits

Props @jeffpaul @dkotter @zamanq

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

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.
@zamanq zamanq requested a review from jeffpaul August 29, 2022 15:58
@jeffpaul jeffpaul added this to the 1.2.0 milestone Sep 2, 2022
@jeffpaul jeffpaul requested review from a team, dinhtungdu and Sidsector9 and removed request for jeffpaul, a team and dinhtungdu September 2, 2022 18:32
@jeffpaul jeffpaul marked this pull request as ready for review September 12, 2022 17:45
@jeffpaul
Copy link
Member

@Sidsector9 reminder on PR review here

src/edit.js Outdated
@@ -77,6 +77,15 @@ function Edit( props ) {
[ clientId ]
);

const [ useCustomUrl, setUseCustomUrl ] = useState( false );
Copy link
Member

@Sidsector9 Sidsector9 Oct 11, 2022

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?

Copy link
Contributor Author

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">
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sidsector9 Done as well.

Copy link
Member

@Sidsector9 Sidsector9 left a 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.

@Sidsector9 Sidsector9 merged commit b5b8e08 into develop Oct 14, 2022
@Sidsector9 Sidsector9 deleted the add/5 branch October 14, 2022 11:51
@jeffpaul jeffpaul modified the milestones: 1.2.0, 1.1.1 Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to change skin on player
3 participants