Skip to content

Commit

Permalink
feat: Remove containerBorderRadius props (react-native-elements#2068)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removes containerBorderRadius from ButtonGroup
  • Loading branch information
Naturalclar authored and iRoachie committed Sep 20, 2019
1 parent 31d9b8a commit 536fc78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
11 changes: 0 additions & 11 deletions docs/button_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ render () {
- [`buttonStyle`](#buttonstyle)
- [`buttons`](#buttons)
- [`Component`](#Component)
- [`containerBorderRadius`](#containerborderradius)
- [`containerStyle`](#containerstyle)
- [`disabled`](#disabled)
- [`disabledStyle`](#disabledstyle)
Expand Down Expand Up @@ -135,16 +134,6 @@ Choose other button component such as TouchableOpacity (optional)

---

### `containerBorderRadius`

Set's the border radius for the first and last button in the button group

| Type | Default |
| :----: | :-----: |
| number | 3 |

---

### `containerStyle`

specify styling for main button container (optional)
Expand Down
13 changes: 6 additions & 7 deletions src/buttons/ButtonGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const ButtonGroup = props => {
onHideUnderlay,
onShowUnderlay,
setOpacityTo,
containerBorderRadius,
disabled,
disabledStyle,
disabledTextStyle,
Expand All @@ -46,6 +45,7 @@ const ButtonGroup = props => {
} = rest;

let innerBorderWidth = 1;
const defaultBorderRadius = 3;

if (
innerBorderStyle &&
Expand Down Expand Up @@ -74,6 +74,7 @@ const ButtonGroup = props => {
style={StyleSheet.flatten([
// FIXME: This is a workaround to the borderColor and borderRadius bug
// react-native ref: https://github.com/facebook/react-native/issues/8236

styles.button,
i < buttons.length - 1 && {
borderRightWidth: i === 0 ? 0 : innerBorderWidth,
Expand All @@ -89,12 +90,12 @@ const ButtonGroup = props => {
},
i === buttons.length - 1 && {
...lastBorderStyle,
borderTopRightRadius: containerBorderRadius,
borderBottomRightRadius: containerBorderRadius,
borderBottomRightRadius: defaultBorderRadius,
borderTopRightRadius: defaultBorderRadius,
},
i === 0 && {
borderTopLeftRadius: containerBorderRadius,
borderBottomLeftRadius: containerBorderRadius,
borderBottomLeftRadius: defaultBorderRadius,
borderTopLeftRadius: defaultBorderRadius,
},
])}
>
Expand Down Expand Up @@ -230,7 +231,6 @@ ButtonGroup.propTypes = {
NativeText.propTypes.style,
]),
buttonStyle: ViewPropTypes.style,
containerBorderRadius: PropTypes.number,
selectMultiple: PropTypes.bool,
theme: PropTypes.object,
disabled: PropTypes.oneOfType([
Expand All @@ -247,7 +247,6 @@ ButtonGroup.defaultProps = {
selectedIndex: null,
selectedIndexes: [],
selectMultiple: false,
containerBorderRadius: 3,
disabled: false,
Component: Platform.select({
android: TouchableNativeFeedback,
Expand Down

0 comments on commit 536fc78

Please sign in to comment.