From 7b3c91ef163eb6172da44b8c2c340adef0d5a44b Mon Sep 17 00:00:00 2001 From: Ignacio Olaciregui Date: Thu, 8 Nov 2018 17:17:26 -0800 Subject: [PATCH] Fix inline styles eslint warnings for examples (#22123) Summary: Fixes `react-native/no-inline-styles` warning for several examples. I'm limiting the size of this PR to make it simpler to review. Pull Request resolved: https://github.com/facebook/react-native/pull/22123 Reviewed By: RSNara Differential Revision: D12929701 Pulled By: TheSavior fbshipit-source-id: 7a976f2208b557fcfda46d5b586b30652c550eb2 --- RNTester/js/ActivityIndicatorExample.js | 4 +- RNTester/js/AlertIOSExample.js | 10 ++++- RNTester/js/AnimatedExample.js | 6 ++- RNTester/js/BorderExample.js | 25 ++++++++--- RNTester/js/BoxShadowExample.js | 45 +++++++++---------- RNTester/js/ButtonExample.js | 11 ++++- RNTester/js/CheckBoxExample.js | 27 +++++++---- RNTester/js/ClipboardExample.js | 16 +++++-- RNTester/js/ToolbarAndroidExample.android.js | 8 +++- RNTester/js/TouchableExample.js | 11 +++-- RNTester/js/TransformExample.js | 9 ++-- .../androidTest/js/ProgressBarTestModule.js | 10 ++++- 12 files changed, 124 insertions(+), 58 deletions(-) diff --git a/RNTester/js/ActivityIndicatorExample.js b/RNTester/js/ActivityIndicatorExample.js index a9bd7ff062a0f9..937b368a443b10 100644 --- a/RNTester/js/ActivityIndicatorExample.js +++ b/RNTester/js/ActivityIndicatorExample.js @@ -90,9 +90,7 @@ exports.examples = [ return ( - + ); }, diff --git a/RNTester/js/AlertIOSExample.js b/RNTester/js/AlertIOSExample.js index 87f9e2f6f13e5f..16868ce504a15b 100644 --- a/RNTester/js/AlertIOSExample.js +++ b/RNTester/js/AlertIOSExample.js @@ -96,8 +96,8 @@ class PromptOptions extends React.Component<$FlowFixMeProps, any> { render() { return ( - - Prompt value:{' '} + + Prompt value:{' '} {this.state.promptValue} @@ -189,4 +189,10 @@ const styles = StyleSheet.create({ backgroundColor: '#eeeeee', padding: 10, }, + promptValue: { + marginBottom: 10, + }, + promptValueLabel: { + fontWeight: 'bold', + }, }); diff --git a/RNTester/js/AnimatedExample.js b/RNTester/js/AnimatedExample.js index 51b335700d812f..1802d03a2719bc 100644 --- a/RNTester/js/AnimatedExample.js +++ b/RNTester/js/AnimatedExample.js @@ -246,7 +246,7 @@ exports.examples = [ - - - - + + + + + ); }, diff --git a/RNTester/js/BoxShadowExample.js b/RNTester/js/BoxShadowExample.js index 5c94582e1b18fe..2996d063e73d5c 100644 --- a/RNTester/js/BoxShadowExample.js +++ b/RNTester/js/BoxShadowExample.js @@ -30,6 +30,23 @@ const styles = StyleSheet.create({ shadowRadius: 0, shadowOffset: {width: 3, height: 3}, }, + shadowShaped: { + borderRadius: 50, + }, + shadowImage: { + borderWidth: 0, + overflow: 'visible', + }, + shadowChild: { + backgroundColor: 'transparent', + }, + shadowChildBox: { + width: 80, + height: 80, + borderRadius: 40, + margin: 8, + backgroundColor: 'red', + }, }); exports.title = 'Box Shadow'; @@ -54,7 +71,7 @@ exports.examples = [ title: 'Shaped shadow', description: 'borderRadius: 50', render() { - return ; + return ; }, }, { @@ -64,11 +81,7 @@ exports.examples = [ return ( ); }, @@ -79,24 +92,8 @@ exports.examples = [ 'For views without an opaque background color, shadow will be derived from the subviews.', render() { return ( - - + + ); }, diff --git a/RNTester/js/ButtonExample.js b/RNTester/js/ButtonExample.js index 361913960c8773..4892947c4844d1 100644 --- a/RNTester/js/ButtonExample.js +++ b/RNTester/js/ButtonExample.js @@ -12,7 +12,7 @@ const React = require('react'); const ReactNative = require('react-native'); -const {Alert, Button, View} = ReactNative; +const {Alert, Button, View, StyleSheet} = ReactNative; function onButtonPress(buttonName) { Alert.alert(`${buttonName} has been pressed!`); @@ -63,7 +63,7 @@ exports.examples = [ 'This layout strategy lets the title define the width of ' + 'the button', render: function() { return ( - +