Skip to content

FloatingButton - add 'fullWidth' prop #2974

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

Merged
merged 3 commits into from
Mar 11, 2024
Merged

Conversation

Inbal-Tish
Copy link
Collaborator

Description

FloatingButton - add 'fullWidth' prop

Changelog

FloatingButton - add 'fullWidth' prop

Additional info

ticket 4057

@@ -16,6 +16,8 @@
"type": "number",
"description": "The bottom margin of the button, or secondary button if passed"
},
{"name": "fullWidth", "type": "boolean", "description": "Whether the buttons get the container's full with", "note": "Relevant to a vertical layout with secondary button"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{"name": "fullWidth", "type": "boolean", "description": "Whether the buttons get the container's full with", "note": "Relevant to a vertical layout with secondary button"},
{"name": "fullWidth", "type": "boolean", "description": "Whether the buttons get the container's full width", "note": "Relevant to a vertical layout with secondary button"},

In the ticket the button in the image seems to be primary, is it relevant only for secondary button?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, it's only relevant to vertical layout. I'll fix it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@Inbal-Tish Inbal-Tish requested a review from adids1221 March 11, 2024 07:14
@@ -199,7 +194,8 @@ class FloatingButton extends PureComponent<FloatingButtonProps> {
return (
<View
row={!!this.isSecondaryHorizontal}
center={!!this.isSecondaryHorizontal}
center={!fullWidth}
paddingH-16={fullWidth}
Copy link
Contributor

@adids1221 adids1221 Mar 11, 2024

Choose a reason for hiding this comment

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

Why use the padding here?
Is it by design?

In the example screen set it to Horizontal layout and play with the fullWidth you can see it changes even though it shouldn't.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see. Thanks. Fixed

const buttonDriver = ButtonDriver({renderTree, testID: `${TEST_ID}.secondaryButton`});
expect(await buttonDriver.getLabel().getText()).toEqual(secondaryButton.label);
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should test the fullWidth prop also, check for the style of the button since this is the feature in this PR eventuality, WDYT ?

Or we should add the test file in separate PR since this PR is for the fullWidth feature ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The fullWidth prop doesn't effect the Buttons' style, but the container's. How do you suggest to test it?

Copy link
Contributor

Choose a reason for hiding this comment

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

We can leave it a side for now.

Copy link
Contributor

@adids1221 adids1221 left a comment

Choose a reason for hiding this comment

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

Great work, left 2 small comments

@Inbal-Tish Inbal-Tish requested a review from adids1221 March 11, 2024 10:08
@adids1221 adids1221 merged commit 352539f into master Mar 11, 2024
@adids1221 adids1221 deleted the feat/FloatingButton_fullWidth branch March 11, 2024 11:02
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.

2 participants