From 4296a02a5f00ca3db234d188e7c9a3cb71d7c8b4 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 9 Aug 2018 11:53:22 +0200 Subject: [PATCH 1/2] Replace TextPropTypes with Text.propTypes --- src/component/button.js | 4 ++-- src/component/field.js | 6 +++--- src/component/form.js | 6 +++--- src/component/input.js | 6 +++--- src/component/label.js | 8 ++++---- src/component/text.js | 14 +++++++------- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/component/button.js b/src/component/button.js index e7e47fc66..9da84505e 100644 --- a/src/component/button.js +++ b/src/component/button.js @@ -3,7 +3,7 @@ import { View, TouchableOpacity, ViewPropTypes, - TextPropTypes, + Text as RNText, StyleSheet, } from 'react-native'; import PropTypes from 'prop-types'; @@ -58,7 +58,7 @@ export const ButtonText = ({ children, style }) => ( ButtonText.propTypes = { children: PropTypes.string.isRequired, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // diff --git a/src/component/field.js b/src/component/field.js index 5a6d0aa56..1e1eac148 100644 --- a/src/component/field.js +++ b/src/component/field.js @@ -1,5 +1,5 @@ import React from 'react'; -import { TextPropTypes, ViewPropTypes, StyleSheet, View } from 'react-native'; +import { Text as RNText, ViewPropTypes, StyleSheet, View } from 'react-native'; import PropTypes from 'prop-types'; import Text from './text'; import { TextInput, HorizontalExpandingTextInput } from './input'; @@ -29,7 +29,7 @@ export const AmountInputField = ({ style, ...props }) => ( ); AmountInputField.propTypes = { - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -50,7 +50,7 @@ export const InputField = ({ style, ...props }) => ( InputField.propTypes = { children: PropTypes.string, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // diff --git a/src/component/form.js b/src/component/form.js index 4f82e2050..5e6c80240 100644 --- a/src/component/form.js +++ b/src/component/form.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, TextPropTypes, ViewPropTypes, StyleSheet } from 'react-native'; +import { View, Text as RNText, ViewPropTypes, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import Text from './text'; import { color, font } from './style'; @@ -46,7 +46,7 @@ export const FormText = ({ children, style }) => ( FormText.propTypes = { children: PropTypes.string, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -68,5 +68,5 @@ export const FormSubText = ({ children, style }) => ( FormSubText.propTypes = { children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), - style: TextPropTypes.style, + style: RNText.propTypes.style, }; diff --git a/src/component/input.js b/src/component/input.js index c948942c9..ca45215a6 100644 --- a/src/component/input.js +++ b/src/component/input.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { TextInput as RNTextInput, - TextPropTypes, + Text as RNText, StyleSheet, } from 'react-native'; import PropTypes from 'prop-types'; @@ -33,7 +33,7 @@ export const TextInput = ({ style, ...props }) => ( ); TextInput.propTypes = { - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -73,7 +73,7 @@ HorizontalExpandingTextInput.propTypes = { value: PropTypes.string, charWidth: PropTypes.number.isRequired, onChangeText: PropTypes.func, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; export default TextInput; diff --git a/src/component/label.js b/src/component/label.js index 999045fc5..eb4a63b52 100644 --- a/src/component/label.js +++ b/src/component/label.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, ViewPropTypes, TextPropTypes, StyleSheet } from 'react-native'; +import { View, ViewPropTypes, Text as RNText, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import Text from './text'; import { font } from './style'; @@ -40,7 +40,7 @@ export const BalanceLabelNumeral = ({ children, style }) => ( BalanceLabelNumeral.propTypes = { children: PropTypes.string.isRequired, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; export const BalanceLabelUnit = ({ children, style }) => @@ -48,7 +48,7 @@ export const BalanceLabelUnit = ({ children, style }) => BalanceLabelUnit.propTypes = { children: PropTypes.string, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -82,5 +82,5 @@ export const SmallBalanceLabel = ({ children, unit, style }) => ( SmallBalanceLabel.propTypes = { children: PropTypes.string.isRequired, unit: PropTypes.string, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; diff --git a/src/component/text.js b/src/component/text.js index 65242387f..21d267f00 100644 --- a/src/component/text.js +++ b/src/component/text.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Text as RNText, TextPropTypes, StyleSheet } from 'react-native'; +import { Text as RNText, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import { color, font } from './style'; import './font'; @@ -26,7 +26,7 @@ export const Text = ({ children, style, ...props }) => ( Text.propTypes = { children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -47,7 +47,7 @@ export const CopyText = ({ children, style }) => ( CopyText.propTypes = { children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -68,7 +68,7 @@ export const CopyOnboardText = ({ children = '', style }) => ( CopyOnboardText.propTypes = { children: PropTypes.string.isRequired, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -89,7 +89,7 @@ export const H1Text = ({ children = '', style }) => ( H1Text.propTypes = { children: PropTypes.string.isRequired, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -110,7 +110,7 @@ export const H3Text = ({ children = '', style }) => ( H3Text.propTypes = { children: PropTypes.string.isRequired, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; // @@ -131,7 +131,7 @@ export const H4Text = ({ children, style }) => ( H4Text.propTypes = { children: PropTypes.string.isRequired, - style: TextPropTypes.style, + style: RNText.propTypes.style, }; export default Text; From c7e43c1617dbf4d2697e63f390ffcf87d7422bfe Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 9 Aug 2018 12:04:12 +0200 Subject: [PATCH 2/2] Replace ViewPropTypes with View.propTypes --- src/component/background.js | 6 +++--- src/component/button.js | 21 ++++++++++----------- src/component/card.js | 4 ++-- src/component/container.js | 4 ++-- src/component/field.js | 6 +++--- src/component/form.js | 4 ++-- src/component/header.js | 6 +++--- src/component/icon.js | 4 ++-- src/component/label.js | 4 ++-- src/component/list.js | 16 +++++----------- src/component/main-content.js | 4 ++-- src/component/modal.js | 4 ++-- src/component/notification.js | 4 ++-- src/component/spinner.js | 9 ++------- 14 files changed, 42 insertions(+), 54 deletions(-) diff --git a/src/component/background.js b/src/component/background.js index ef3025a1e..c1918d1f0 100644 --- a/src/component/background.js +++ b/src/component/background.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, StyleSheet, ImageBackground, ViewPropTypes } from 'react-native'; +import { View, StyleSheet, ImageBackground } from 'react-native'; import PropTypes from 'prop-types'; // @@ -30,7 +30,7 @@ Background.propTypes = { image: PropTypes.string, color: PropTypes.string, children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -66,7 +66,7 @@ SplitBackground.propTypes = { color: PropTypes.string, bottom: PropTypes.string, children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; export default Background; diff --git a/src/component/button.js b/src/component/button.js index 9da84505e..9fab42f5b 100644 --- a/src/component/button.js +++ b/src/component/button.js @@ -2,7 +2,6 @@ import React from 'react'; import { View, TouchableOpacity, - ViewPropTypes, Text as RNText, StyleSheet, } from 'react-native'; @@ -38,7 +37,7 @@ Button.propTypes = { onPress: PropTypes.func.isRequired, disabled: PropTypes.bool, children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -98,7 +97,7 @@ GlasButton.propTypes = { onPress: PropTypes.func.isRequired, disabled: PropTypes.bool, children: PropTypes.string.isRequired, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -134,7 +133,7 @@ PillButton.propTypes = { onPress: PropTypes.func.isRequired, disabled: PropTypes.bool, children: PropTypes.string.isRequired, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -209,7 +208,7 @@ SmallButton.propTypes = { border: PropTypes.bool, alert: PropTypes.string, children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -255,7 +254,7 @@ SmallPillButton.propTypes = { text: PropTypes.string, onPress: PropTypes.func.isRequired, disabled: PropTypes.bool, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -278,7 +277,7 @@ export const BackButton = ({ onPress, disabled, style }) => ( BackButton.propTypes = { onPress: PropTypes.func, disabled: PropTypes.bool, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -301,7 +300,7 @@ export const CancelButton = ({ onPress, disabled, style }) => ( CancelButton.propTypes = { onPress: PropTypes.func, disabled: PropTypes.bool, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -339,7 +338,7 @@ export const QrButton = ({ onPress, disabled, style, children }) => ( QrButton.propTypes = { onPress: PropTypes.func.isRequired, disabled: PropTypes.bool, - style: ViewPropTypes.style, + style: View.propTypes.style, children: PropTypes.string, }; @@ -368,7 +367,7 @@ export const DownButton = ({ onPress, disabled, style, children }) => ( DownButton.propTypes = { onPress: PropTypes.func, disabled: PropTypes.bool, - style: ViewPropTypes.style, + style: View.propTypes.style, children: PropTypes.string, }; @@ -419,7 +418,7 @@ CopyButton.propTypes = { onPress: PropTypes.func, icon: PropTypes.string, children: PropTypes.string, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // diff --git a/src/component/card.js b/src/component/card.js index 07786fe9d..601905b0f 100644 --- a/src/component/card.js +++ b/src/component/card.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, ViewPropTypes, StyleSheet } from 'react-native'; +import { View, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import { color } from './style'; @@ -22,7 +22,7 @@ const Card = ({ children, style }) => ( Card.propTypes = { children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; export default Card; diff --git a/src/component/container.js b/src/component/container.js index e5485e8b5..e2f0e9321 100644 --- a/src/component/container.js +++ b/src/component/container.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, ViewPropTypes, StyleSheet } from 'react-native'; +import { View, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; const styles = StyleSheet.create({ @@ -15,7 +15,7 @@ const Container = ({ children, style }) => ( Container.propTypes = { children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; export default Container; diff --git a/src/component/field.js b/src/component/field.js index 1e1eac148..21b92f158 100644 --- a/src/component/field.js +++ b/src/component/field.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Text as RNText, ViewPropTypes, StyleSheet, View } from 'react-native'; +import { Text as RNText, StyleSheet, View } from 'react-native'; import PropTypes from 'prop-types'; import Text from './text'; import { TextInput, HorizontalExpandingTextInput } from './input'; @@ -93,7 +93,7 @@ export const NamedField = ({ name, children, style }) => ( NamedField.propTypes = { name: PropTypes.string, children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -130,5 +130,5 @@ export const DetailField = ({ name, children, style }) => ( DetailField.propTypes = { name: PropTypes.string, children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), - style: ViewPropTypes.style, + style: View.propTypes.style, }; diff --git a/src/component/form.js b/src/component/form.js index 5e6c80240..6f8290784 100644 --- a/src/component/form.js +++ b/src/component/form.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, Text as RNText, ViewPropTypes, StyleSheet } from 'react-native'; +import { View, Text as RNText, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import Text from './text'; import { color, font } from './style'; @@ -25,7 +25,7 @@ export const FormStretcher = ({ children, style }) => ( FormStretcher.propTypes = { children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // diff --git a/src/component/header.js b/src/component/header.js index 36ef3f0f5..9d8f52401 100644 --- a/src/component/header.js +++ b/src/component/header.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, ViewPropTypes, StyleSheet } from 'react-native'; +import { View, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import Text from './text'; import { color } from './style'; @@ -43,7 +43,7 @@ export const Header = ({ style, children, color, shadow, separator }) => ( ); Header.propTypes = { - style: ViewPropTypes.style, + style: View.propTypes.style, children: PropTypes.node, color: PropTypes.string, shadow: PropTypes.bool, @@ -86,7 +86,7 @@ export const Title = ({ title = '', style, children }) => ( Title.propTypes = { title: PropTypes.string, - style: ViewPropTypes.style, + style: View.propTypes.style, children: PropTypes.node, }; diff --git a/src/component/icon.js b/src/component/icon.js index 4e62dfcaf..ae1a11b2c 100644 --- a/src/component/icon.js +++ b/src/component/icon.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Image, ViewPropTypes } from 'react-native'; +import { Image, View } from 'react-native'; import PropTypes from 'prop-types'; const Icon = ({ image, style }) => ( @@ -8,7 +8,7 @@ const Icon = ({ image, style }) => ( Icon.propTypes = { image: PropTypes.string.isRequired, - style: ViewPropTypes.style, + style: View.propTypes.style, }; export default Icon; diff --git a/src/component/label.js b/src/component/label.js index eb4a63b52..f5547648a 100644 --- a/src/component/label.js +++ b/src/component/label.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, ViewPropTypes, Text as RNText, StyleSheet } from 'react-native'; +import { View, Text as RNText, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import Text from './text'; import { font } from './style'; @@ -31,7 +31,7 @@ export const BalanceLabel = ({ children, style }) => ( BalanceLabel.propTypes = { children: PropTypes.node.isRequired, - style: ViewPropTypes.style, + style: View.propTypes.style, }; export const BalanceLabelNumeral = ({ children, style }) => ( diff --git a/src/component/list.js b/src/component/list.js index d8d35143c..14b0947f2 100644 --- a/src/component/list.js +++ b/src/component/list.js @@ -1,11 +1,5 @@ import React, { Component, PureComponent } from 'react'; -import { - View, - ListView, - TouchableOpacity, - ViewPropTypes, - StyleSheet, -} from 'react-native'; +import { View, ListView, TouchableOpacity, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import Text from './text'; import Icon from './icon'; @@ -31,7 +25,7 @@ export const ListContent = ({ children, style }) => ( ListContent.propTypes = { children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -100,7 +94,7 @@ export class ListItem extends PureComponent { ListItem.propTypes = { onSelect: PropTypes.func, children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -119,7 +113,7 @@ export const ListHeader = ({ style, children }) => ( ListHeader.propTypes = { children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; // @@ -187,5 +181,5 @@ export const SettingHeader = ({ name, style }) => ( SettingHeader.propTypes = { name: PropTypes.string.isRequired, - style: ViewPropTypes.style, + style: View.propTypes.style, }; diff --git a/src/component/main-content.js b/src/component/main-content.js index bbd96bb04..341e124b9 100644 --- a/src/component/main-content.js +++ b/src/component/main-content.js @@ -1,5 +1,5 @@ import React from 'react'; -import { ScrollView, ViewPropTypes, StyleSheet } from 'react-native'; +import { ScrollView, View, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; const styles = StyleSheet.create({ @@ -17,7 +17,7 @@ const MainContent = ({ children, style }) => ( MainContent.propTypes = { children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; export default MainContent; diff --git a/src/component/modal.js b/src/component/modal.js index 0a110c00a..1e0dc052e 100644 --- a/src/component/modal.js +++ b/src/component/modal.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, ViewPropTypes, StyleSheet } from 'react-native'; +import { View, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import { Button } from './button'; import { H4Text } from './text'; @@ -54,7 +54,7 @@ Modal.propTypes = { title: PropTypes.string.isRequired, onClose: PropTypes.func.isRequired, children: PropTypes.node, - style: ViewPropTypes.style, + style: View.propTypes.style, }; export default Modal; diff --git a/src/component/notification.js b/src/component/notification.js index dad6d5cc0..2d85e9971 100644 --- a/src/component/notification.js +++ b/src/component/notification.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Animated, StyleSheet, ViewPropTypes, View } from 'react-native'; +import { Animated, StyleSheet, View } from 'react-native'; import PropTypes from 'prop-types'; import { SmallPillButton } from './button'; import { Text, H4Text } from './text'; @@ -193,5 +193,5 @@ class FadeInView extends Component { FadeInView.propTypes = { display: PropTypes.bool.isRequired, children: PropTypes.node.isRequired, - style: ViewPropTypes.style, + style: View.propTypes.style, }; diff --git a/src/component/spinner.js b/src/component/spinner.js index 1fc8b6cf9..86d92bcb4 100644 --- a/src/component/spinner.js +++ b/src/component/spinner.js @@ -1,10 +1,5 @@ import React from 'react'; -import { - ActivityIndicator, - StyleSheet, - View, - ViewPropTypes, -} from 'react-native'; +import { ActivityIndicator, StyleSheet, View } from 'react-native'; import PropTypes from 'prop-types'; import { color, font } from './style'; import Icon from './icon'; @@ -64,7 +59,7 @@ export const LoadNetworkSpinner = ({ percentage, msg, style }) => ( LoadNetworkSpinner.propTypes = { percentage: PropTypes.number.isRequired, msg: PropTypes.string.isRequired, - style: ViewPropTypes.style, + style: View.propTypes.style, }; //