From 8e82e9951a1c07b7db7deac09db67d5a553cf9c0 Mon Sep 17 00:00:00 2001 From: M1chael Date: Sat, 27 Feb 2021 21:17:30 +1100 Subject: [PATCH] remove `ViewPropTypes` as it has been deprecated --- src/Avatar.js | 8 +++++--- src/Toast.js | 14 +++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Avatar.js b/src/Avatar.js index d331fbd..1e6fe0b 100644 --- a/src/Avatar.js +++ b/src/Avatar.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, Text, StyleSheet, Image, ViewPropTypes } from 'react-native'; +import { View, Text, StyleSheet, Image } from 'react-native'; import PropTypes from 'prop-types'; import { withGalio } from 'theme'; @@ -87,12 +87,14 @@ Avatar.propTypes = { backgroundColor: PropTypes.string, imageProps: PropTypes.object, imageStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), - containerStyle: ViewPropTypes.style, + containerStyle: PropTypes.shape({ + style: PropTypes.any, + }), styles: PropTypes.any, theme: PropTypes.any, }; -const styles = theme => +const styles = (theme) => StyleSheet.create({ labelContainerWithInset: { top: 1, diff --git a/src/Toast.js b/src/Toast.js index fc3b557..b9b7b9f 100644 --- a/src/Toast.js +++ b/src/Toast.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Dimensions, StyleSheet, Animated, ViewPropTypes } from 'react-native'; +import { Dimensions, StyleSheet, Animated } from 'react-native'; import PropTypes from 'prop-types'; // galio components import Text from './atomic/ions/Text'; @@ -20,8 +20,12 @@ class Toast extends Component { PropTypes.string, ]), round: PropTypes.bool, - style: ViewPropTypes.style, - textStyle: ViewPropTypes.style, + style: PropTypes.shape({ + style: PropTypes.any, + }), + textStyle: PropTypes.shape({ + style: PropTypes.any, + }), styles: PropTypes.any, theme: PropTypes.any, }; @@ -84,7 +88,7 @@ class Toast extends Component { } } - setVisibility = isShow => this.setState({ isShow }); + setVisibility = (isShow) => this.setState({ isShow }); getTopPosition = () => { const { positionIndicator, positionOffset } = this.props; @@ -135,7 +139,7 @@ class Toast extends Component { } } -const styles = theme => +const styles = (theme) => StyleSheet.create({ toast: { padding: theme.SIZES.BASE,