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

Social Icons: Avoid loss of previously selected background color when switching back from "Logos Only" style #39276

Merged

Conversation

HILAYTRIVEDI
Copy link
Contributor

I tested the code with different themes which are default provided by WordPress. No other functionalities are affected by the changes.

After the changes, I tested it with the different combinations of the use of the styling pattern, and it's working fine.

Video Demo Of Fix

https://www.awesomescreenshot.com/video/5232616?key=888676e6a53d9db85397b4430d64c810

Types of changes

The use effect in the file uses the previous state of the iconBackgroundColorValue and while the class changes it uses the value of preveIconBackgroundColorValue for the previously set value of the background.

Bugfix #34677

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@HILAYTRIVEDI HILAYTRIVEDI requested a review from mkaz as a code owner March 8, 2022 09:10
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Mar 8, 2022
@github-actions
Copy link

github-actions bot commented Mar 8, 2022

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @HILAYTRIVEDI! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Mamaduka Mamaduka requested a review from stokesman March 8, 2022 10:36
@stokesman
Copy link
Contributor

stokesman commented Mar 10, 2022

Hi @HILAYTRIVEDI, this looks to be the same branch as #34834. It's still a great many commits behind trunk. I can checkout the branch and see about rebasing itbut we should probably close this PR and keep the other one open.

Update: I see they are different branches and the other didn't rebase without conflicts while this one did. So fine to have this one open I guess.

@stokesman stokesman force-pushed the fix/34677-social-links-background branch from 0d5d1c4 to bd60594 Compare March 10, 2022 06:33
@skorasaurus skorasaurus added the [Block] Social Affects the Social Block - used to display Social Media accounts label Mar 11, 2022
@HILAYTRIVEDI
Copy link
Contributor Author

Thank you @stokesman , I closed the previous pull request.

@stokesman stokesman force-pushed the fix/34677-social-links-background branch from a2dcc0d to 9312822 Compare March 16, 2022 17:30
Copy link
Contributor

@stokesman stokesman left a comment

Choose a reason for hiding this comment

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

I've tested and it works as intended. LGTM! Disclaimer: I fixed one thing and made a couple of quality/style changes besides.

@stokesman stokesman changed the title Background color issue fixed Social Icons: Avoid loss of previously selected background color when switching back from "Logos Only" style Mar 16, 2022
@stokesman
Copy link
Contributor

My confidence in this is high so unless anyone chimes in with a reason not to I think I'll merge it soon. CC @Mamaduka.

@stokesman stokesman added the [Type] Enhancement A suggestion for improvement. label Mar 16, 2022
@Mamaduka
Copy link
Member

The changes look good to me. Thank you, @HILAYTRIVEDI and @stokesman.

@Mamaduka Mamaduka merged commit 79cacc5 into WordPress:trunk Mar 17, 2022
@github-actions github-actions bot added this to the Gutenberg 12.9 milestone Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Social Icons: custom icon background colour does not persist when switching between block styles
4 participants