Skip to content

Commit 2e5e092

Browse files
cHaLkdusTfacebook-github-bot
authored andcommitted
� Improve Button component stylesheet; removed duplicate styles (facebook#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 facebook#19752 [GENERAL] [ENHANCEMENT] [Button] - Uses spread operator for platform specific code in creating styles Pull Request resolved: facebook#21535 Differential Revision: D10248048 Pulled By: TheSavior fbshipit-source-id: 7260fa56f15b70b7c9499c8da418db7b2214b0dd
1 parent 77c3ea9 commit 2e5e092

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Libraries/Components/Button.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,21 @@ const styles = StyleSheet.create({
150150
borderRadius: 2,
151151
},
152152
}),
153-
text: Platform.select({
154-
ios: {
155-
// iOS blue from https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/
156-
color: '#007AFF',
157-
textAlign: 'center',
158-
padding: 8,
159-
fontSize: 18,
160-
},
161-
android: {
162-
color: 'white',
163-
textAlign: 'center',
164-
padding: 8,
165-
fontWeight: '500',
166-
},
167-
}),
153+
text: {
154+
textAlign: 'center',
155+
padding: 8,
156+
...Platform.select({
157+
ios: {
158+
// iOS blue from https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/
159+
color: '#007AFF',
160+
fontSize: 18,
161+
},
162+
android: {
163+
color: 'white',
164+
fontWeight: '500',
165+
},
166+
}),
167+
},
168168
buttonDisabled: Platform.select({
169169
ios: {},
170170
android: {

0 commit comments

Comments
 (0)