Skip to content

Commit

Permalink
updated buttons to be small by default, breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
dabit3 committed Nov 23, 2016
1 parent 8df4596 commit 858e723
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
13 changes: 6 additions & 7 deletions Readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,18 @@ import { Button } from 'react-native-elements'
title='BUTTON WITH ICON' />

<Button
small
large
iconRight
icon={{name: 'code'}}
title='SMALL WITH RIGHT ICON' />
title='LARGE WITH RIGHT ICON' />

<Button
small
large
icon={{name: 'envira', type: 'font-awesome'}}
title='SMALL WITH RIGHT ICON' />
title='LARGE WITH RIGHT ICON' />

<Button
small
large
icon={{name: 'squirrel', type: 'octicon', buttonStyle: styles.someButtonStyle }}
title='OCTICON' />

Expand All @@ -140,7 +140,7 @@ import { Button } from 'react-native-elements'
| Component | TouchableHighlight (iOS), TouchableNativeFeedback (android) | React Native Component | Specify other component such as TouchableOpacity or other (optional) |
| buttonStyle | none | object (style) | add additional styling for button component (optional) |
| title | none | string | button title (required) |
| small | false | boolean | makes button small |
| large | false | boolean | makes button large |
| fontFamily | System font (iOS), Roboto (android) | string | specify different font family |
| fontWeight | none | string | specify font weight for title (optional) |
| iconRight | false | boolean | moves icon to right of title |
Expand Down Expand Up @@ -825,7 +825,6 @@ import { Card, ListItem, Button } from 'react-native-elements'
The idea with React Native Elements is more about component structure than actual design.
</Text>
<Button
small
icon={{name: 'code'}}
backgroundColor='#03A9F4'
fontFamily='Lato'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-elements",
"version": "0.6.4",
"version": "0.7.0",
"description": "React Native Elements & UI Toolkit",
"main": "src/index.js",
"repository": {
Expand Down
12 changes: 6 additions & 6 deletions src/buttons/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Button = ({
underlayColor,
raised,
textStyle,
small,
large,
iconRight,
fontWeight,
fontFamily}) => {
Expand All @@ -65,7 +65,7 @@ const Button = ({
iconElement = (
<Icon
color={icon.color || 'white'}
size={icon.size || (small ? 18 : 26)}
size={icon.size || (large ? 26 : 18)}
style={[
iconRight ? styles.iconRight : styles.icon,
icon.style && icon.style
Expand All @@ -80,7 +80,7 @@ const Button = ({
animating={true}
style={[styles.activityIndicatorStyle, activityIndicatorStyle]}
color={color || "white"}
size={small && "small" || "large"}
size={large && "large" || "small"}
/>
)
}
Expand Down Expand Up @@ -125,7 +125,7 @@ const Button = ({
borderRadius && {borderRadius},
buttonStyle && buttonStyle,
raised && styles.raised,
small && styles.small,
!large && styles.small,
disabled && {backgroundColor: colors.disabled}
]}
>
Expand All @@ -140,7 +140,7 @@ const Button = ({
styles.text,
color && {color},
fontSize && {fontSize},
small && styles.smallFont,
!large && styles.smallFont,
textStyle && textStyle,
fontWeight && {fontWeight},
fontFamily && {fontFamily}
Expand Down Expand Up @@ -193,7 +193,7 @@ styles = StyleSheet.create({
},
text: {
color: 'white',
fontSize: normalize(18)
fontSize: normalize(16)
},
icon: {
marginRight: 10
Expand Down

0 comments on commit 858e723

Please sign in to comment.