@@ -70,9 +70,9 @@ type State = {
70
70
* A button is component that the user can press to trigger an action.
71
71
*
72
72
* <div class="screenshots">
73
- * <img src="http://github.com/screenshots/button-%3Cspan%20class="x x-first x-last">raised .png" />
74
- * <img src="http://github.com/screenshots/button-%3Cspan%20class="x x-first x-last">primary .png" />
75
- * <img src="http://github.com/screenshots/button-%3Cspan%20class="x x-first x-last">custom .png" />
73
+ * <img src="http://github.com/screenshots/button-%3Cspan%20class="x x-first x-last">1 .png" />
74
+ * <img src="http://github.com/screenshots/button-%3Cspan%20class="x x-first x-last">2 .png" />
75
+ * <img src="http://github.com/screenshots/button-%3Cspan%20class="x x-first x-last">3 .png" />
76
76
* </div>
77
77
*
78
78
* ## Usage
@@ -185,37 +185,6 @@ class Button extends React.Component<Props, State> {
185
185
const textStyle = { color : textColor , fontFamily } ;
186
186
const elevation = disabled ? 0 : this . state . elevation ;
187
187
188
- const content = (
189
- < View style = { styles . content } >
190
- { icon && loading !== true ? (
191
- < View style = { styles . icon } >
192
- < Icon name = { icon } size = { 16 } color = { textColor } />
193
- </ View >
194
- ) : null }
195
- { loading ? (
196
- < ActivityIndicator
197
- size = "small"
198
- color = { textColor }
199
- style = { styles . icon }
200
- />
201
- ) : null }
202
- < Text
203
- numberOfLines = { 1 }
204
- style = { [
205
- styles . label ,
206
- compact && styles . compactLabel ,
207
- textStyle ,
208
- { fontFamily } ,
209
- ] }
210
- >
211
- { React . Children . map (
212
- children ,
213
- child => ( typeof child === 'string' ? child . toUpperCase ( ) : child )
214
- ) }
215
- </ Text >
216
- </ View >
217
- ) ;
218
-
219
188
return (
220
189
< AnimatedPaper
221
190
style = { [
@@ -226,21 +195,45 @@ class Button extends React.Component<Props, State> {
226
195
style ,
227
196
] }
228
197
>
229
- { disabled ? (
230
- content
231
- ) : (
232
- < TouchableRipple
233
- borderless
234
- delayPressIn = { 0 }
235
- onPress = { onPress }
236
- onPressIn = { this . _handlePressIn }
237
- onPressOut = { this . _handlePressOut }
238
- rippleColor = { rippleColor }
239
- style = { touchableStyle }
240
- >
241
- { content }
242
- </ TouchableRipple >
243
- ) }
198
+ < TouchableRipple
199
+ borderless
200
+ delayPressIn = { 0 }
201
+ onPress = { disabled ? undefined : onPress }
202
+ onPressIn = { disabled ? undefined : this . _handlePressIn }
203
+ onPressOut = { disabled ? undefined : this . _handlePressOut }
204
+ rippleColor = { rippleColor }
205
+ style = { touchableStyle }
206
+ >
207
+ < View style = { styles . content } >
208
+ { icon && loading !== true ? (
209
+ < View style = { styles . icon } >
210
+ < Icon name = { icon } size = { 16 } color = { textColor } />
211
+ </ View >
212
+ ) : null }
213
+ { loading ? (
214
+ < ActivityIndicator
215
+ size = "small"
216
+ color = { textColor }
217
+ style = { styles . icon }
218
+ />
219
+ ) : null }
220
+ < Text
221
+ numberOfLines = { 1 }
222
+ style = { [
223
+ styles . label ,
224
+ compact && styles . compactLabel ,
225
+ textStyle ,
226
+ { fontFamily } ,
227
+ ] }
228
+ >
229
+ { React . Children . map (
230
+ children ,
231
+ child =>
232
+ typeof child === 'string' ? child . toUpperCase ( ) : child
233
+ ) }
234
+ </ Text >
235
+ </ View >
236
+ </ TouchableRipple >
244
237
</ AnimatedPaper >
245
238
) ;
246
239
}
@@ -257,7 +250,7 @@ const styles = StyleSheet.create({
257
250
content : {
258
251
flexDirection : 'row' ,
259
252
alignItems : 'center' ,
260
- justifyContent : 'space-around ' ,
253
+ justifyContent : 'center ' ,
261
254
} ,
262
255
icon : {
263
256
width : 16 ,
0 commit comments