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

fix(clerk-js): Fix layout shift for Social block buttons #1838

Conversation

octoper
Copy link
Member

@octoper octoper commented Oct 6, 2023

Description

This PR fixes layout shift that is happening when Social block button is in loading state.

Before:

CleanShot.2023-10-09.at.17.06.33.mp4

After:

Layout.Shift.after.20px.mp4

Fixes JS-792

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2023

🦋 Changeset detected

Latest commit: 9efbefb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@octoper octoper changed the title fix(clerk-js): Fix layout shift for Social block buttons fix(clerk-js): Fix layout shift for oAuth block buttons Oct 6, 2023
@octoper octoper changed the title fix(clerk-js): Fix layout shift for oAuth block buttons fix(clerk-js): Fix layout shift for Social block buttons Oct 6, 2023
@octoper octoper force-pushed the vaggelis/js-792-layout-shift-still-happening-for-social-button branch from 731b4de to b1fe1f5 Compare October 6, 2023 19:48
@octoper octoper marked this pull request as ready for review October 6, 2023 19:50
@octoper octoper requested a review from a team as a code owner October 6, 2023 19:50
@octoper octoper force-pushed the vaggelis/js-792-layout-shift-still-happening-for-social-button branch from b1fe1f5 to 1f884f3 Compare October 6, 2023 21:47
@panteliselef
Copy link
Member

@octoper I remember that we decided to change the social logos' dimensions to 20px by 20px, this PR seems to bring it back to 16x16, are we ok with this ?

@octoper
Copy link
Member Author

octoper commented Oct 9, 2023

@panteliselef yeah you are correct, had some problems at first to keep it at 20px but I did manage to resolve them today.

@octoper
Copy link
Member Author

octoper commented Oct 9, 2023

@panteliselef Just changed the sizes and also updated the videos.

@octoper octoper force-pushed the vaggelis/js-792-layout-shift-still-happening-for-social-button branch from d34278c to 2394bf8 Compare October 9, 2023 14:47
@@ -37,8 +37,9 @@ const { applyVariants, filterProps } = createVariants(theme => {
md: { [thickness]: theme.sizes.$1 },
},
size: {
sm: { [size]: theme.sizes.$3 },
md: { [size]: theme.sizes.$4 },
xs: { [size]: theme.sizes.$3 },
Copy link
Member

Choose a reason for hiding this comment

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

❓ Are we using this somewhere ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this is used here packages/clerk-js/src/ui/elements/Actions.tsx

Copy link
Member

@panteliselef panteliselef left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @octoper 🔧

Copy link
Member

@nikosdouvlis nikosdouvlis left a comment

Choose a reason for hiding this comment

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

💯

@nikosdouvlis nikosdouvlis merged commit f20adc3 into main Oct 10, 2023
6 checks passed
@nikosdouvlis nikosdouvlis deleted the vaggelis/js-792-layout-shift-still-happening-for-social-button branch October 10, 2023 10:28
@clerk-cookie clerk-cookie mentioned this pull request Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants