-
Notifications
You must be signed in to change notification settings - Fork 734
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
Conversation
@@ -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"}, |
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.
{"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?
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.
Right, it's only relevant to vertical layout. I'll fix it
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.
fixed
@@ -199,7 +194,8 @@ class FloatingButton extends PureComponent<FloatingButtonProps> { | |||
return ( | |||
<View | |||
row={!!this.isSecondaryHorizontal} | |||
center={!!this.isSecondaryHorizontal} | |||
center={!fullWidth} | |||
paddingH-16={fullWidth} |
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.
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.
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.
I see. Thanks. Fixed
const buttonDriver = ButtonDriver({renderTree, testID: `${TEST_ID}.secondaryButton`}); | ||
expect(await buttonDriver.getLabel().getText()).toEqual(secondaryButton.label); | ||
}); | ||
}); |
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.
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 ?
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.
The fullWidth prop doesn't effect the Buttons' style, but the container's. How do you suggest to test it?
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.
We can leave it a side for now.
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.
Great work, left 2 small comments
Description
FloatingButton - add 'fullWidth' prop
Changelog
FloatingButton - add 'fullWidth' prop
Additional info
ticket 4057