� Improve Button component stylesheet; removed duplicate styles (#21535)

Summary:
Updated Button component inspiration. Refactored code takes advantage of Platform Specific Code, as we want to re-use as much code as possible.

1. Import Button component
2. Button should work the same

https://github.com/facebook/react-native/pull/19752

[GENERAL] [ENHANCEMENT] [Button] - Uses spread operator for platform specific code in creating styles
Pull Request resolved: https://github.com/facebook/react-native/pull/21535

Differential Revision: D10248048

Pulled By: TheSavior

fbshipit-source-id: 7260fa56f15b70b7c9499c8da418db7b2214b0dd
This commit is contained in:
Julius Lundang 2018-10-08 23:19:24 -07:00 committed by Facebook Github Bot
parent f187a308bc
commit bbb6a0754c
1 changed files with 15 additions and 15 deletions

View File

@ -150,21 +150,21 @@ const styles = StyleSheet.create({
borderRadius: 2, borderRadius: 2,
}, },
}), }),
text: Platform.select({ text: {
ios: { textAlign: 'center',
// iOS blue from https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/ padding: 8,
color: '#007AFF', ...Platform.select({
textAlign: 'center', ios: {
padding: 8, // iOS blue from https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/
fontSize: 18, color: '#007AFF',
}, fontSize: 18,
android: { },
color: 'white', android: {
textAlign: 'center', color: 'white',
padding: 8, fontWeight: '500',
fontWeight: '500', },
}, }),
}), },
buttonDisabled: Platform.select({ buttonDisabled: Platform.select({
ios: {}, ios: {},
android: { android: {