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: Add support for borderRadii on RectButton #2691

Merged
merged 14 commits into from
Jan 11, 2024

Conversation

kacperkapusciak
Copy link
Member

@kacperkapusciak kacperkapusciak commented Dec 12, 2023

Description

Screen.Recording.2023-12-12.at.11.34.21.mov

This PR adds support for border radius style props like: borderTopLeftRadius, borderTopRightRadius, borderBottomLeftRadius, borderBottomRightRadius to RectButton.

It implements the border radii by wrapping a RawButton with two Views - the outer one curves the native RawButton and the inner acts like a mask cutting the corners of the button. The radius of the inner view had to be adjusted by subtracting the borderWidth from it - see this tweet.

FIxes #2594

Copy link
Contributor

@m-bert m-bert left a comment

Choose a reason for hiding this comment

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

Logic looks fine, thanks for fixing that! ❤️

I'll leave review of TS part for @tjzel

Copy link
Contributor

@tjzel tjzel left a comment

Choose a reason for hiding this comment

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

TS seems approvable now 🚀

src/components/splitStyleProp.ts Outdated Show resolved Hide resolved
example/src/release_tests/roundedButtons/index.tsx Outdated Show resolved Hide resolved
src/components/splitStyleProp.ts Show resolved Hide resolved
@j-piasecki j-piasecki linked an issue Dec 20, 2023 that may be closed by this pull request
Copy link
Member

@j-piasecki j-piasecki left a comment

Choose a reason for hiding this comment

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

🔥

@j-piasecki j-piasecki merged commit 74c01a3 into main Jan 11, 2024
3 checks passed
@j-piasecki j-piasecki deleted the @kacperkapusciak/rectbutton-border-radius branch January 11, 2024 11:54
j-piasecki added a commit that referenced this pull request Feb 5, 2024
j-piasecki added a commit that referenced this pull request Feb 5, 2024
## Description

Reverts #2691.

During testing before release, I've found some cases where the approach
from PR doesn't work. At this point it may be better to leave the
buttons as they are so we don't break any existing setups, and possibly
reuse the logic for pressables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants