-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
#1544 Fix: Play/Pause Button Centered #1556
#1544 Fix: Play/Pause Button Centered #1556
Conversation
Lines 1-9Ah, I see we're having the classic package-lock.json party where the only guest is a version bump! 🥳 If it were up to Nuki, we'd throw confetti every time, but seriously, unless you changed your No code changes needed considering there are actual dependency updates in Lines 22-37Oh, the classic case of Here's a suggestion to keep things tidy: // Add a new class in your CSS module
.player_button_with_margin {
margin-right: 4px;
} And then, use it like this: // Line 22-37
}) => (
<button
data-testid={rest['data-testid']}
className={cx(
styles.player_button,
{ [styles.disabled]: disabled },
{ [styles.player_button_with_margin]: rest['data-testid'] === 'player-controls-play' } // Apply the margin conditionally based on test-id if needed
)}
aria-label={ariaLabel}
onClick={disabled ? undefined : onClick}
>
<Icon inverted loading={loading} name={icon} size={size} />
</button>
); This way, your styles stay in the world of CSS where they belong, and every anime fan is happy. (∩^o^)⊃━☆゚.* Lines 36-42Uh oh, what's this? An inline style slipping into our pristine JSX? Absolutely not on Nuki's watch! Remove this like you would an incorrectly subtitled translation ruining the mood of a pivotal scene. 😤 Update your player button with the recommended changes from above to manage margins with class and style, turning your code from I guess it works to absolute masterpiece. Trust me, your users will feel the harmony zen. ✨ <PlayerButton
data-testid='player-controls-play'
loading={isLoading}
icon={ This line should not contain any inline styles. Use CSS classes. |
I agree with Nuki, don't commit your package-lock.json, and don't use |
Hi @nukeop, can you please approve my PR. |
className={cx( | ||
styles.player_button, | ||
{ [styles.disabled]: disabled }, | ||
{ [styles.player_button_with_margin]: rest['data-testid'] === 'player-controls-play' } // Apply the margin conditionally based on test-id if needed |
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.
That's not the right way, data-testid is only for tests, it should not influence business logic in any way.
Fix: #1544
Bug: The Play/Pause button at the bottom of the window isn't centered between the Previous and Next buttons - it's closer to the Next button (i.e. to the right). Hard to see for the Play button, but easier with the Pause button:
Change: Added margin to the right of the button, as suggested by @nukeop in his comment regarding the issue.