Fix propTypes warnings (#5285)

This commit is contained in:
Elias Nahum 2021-04-06 21:18:31 -04:00 committed by GitHub
parent fca7c79183
commit c6953bef47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 72 additions and 144 deletions

View file

@ -3,14 +3,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import {Text} from 'react-native';
import {StyleSheet, Text} from 'react-native';
import Clipboard from '@react-native-community/clipboard';
import {intlShape} from 'react-intl';
import {displayUsername} from '@mm-redux/utils/user_utils';
import {showModal} from '@actions/navigation';
import CompassIcon from '@components/compass_icon';
import CustomPropTypes from '@constants/custom_prop_types';
import BottomSheet from '@utils/bottom_sheet';
import mattermostManaged from 'app/mattermost_managed';
@ -19,9 +18,9 @@ export default class AtMention extends React.PureComponent {
isSearchResult: PropTypes.bool,
mentionKeys: PropTypes.array.isRequired,
mentionName: PropTypes.string.isRequired,
mentionStyle: CustomPropTypes.Style,
mentionStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
onPostPress: PropTypes.func,
textStyle: CustomPropTypes.Style,
textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
teammateNameDisplay: PropTypes.string,
theme: PropTypes.object.isRequired,
usersByUsername: PropTypes.object.isRequired,
@ -193,7 +192,7 @@ export default class AtMention extends React.PureComponent {
}
if (suffix) {
const suffixStyle = {...styleText, color: theme.centerChannelColor};
const suffixStyle = {...StyleSheet.flatten(styleText), color: theme.centerChannelColor};
suffixElement = (
<Text style={suffixStyle}>
{suffix}

View file

@ -7,7 +7,6 @@ import {Text} from 'react-native';
import {intlShape} from 'react-intl';
import {popToRoot, dismissAllModals} from '@actions/navigation';
import CustomPropTypes from '@constants/custom_prop_types';
import {t} from '@utils/i18n';
import {alertErrorWithFallback} from '@utils/general';
@ -19,9 +18,9 @@ export default class ChannelLink extends React.PureComponent {
channelMentions: PropTypes.object,
currentTeamId: PropTypes.string.isRequired,
currentUserId: PropTypes.string.isRequired,
linkStyle: CustomPropTypes.Style,
linkStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
onChannelLinkPress: PropTypes.func,
textStyle: CustomPropTypes.Style,
textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
channelsByName: PropTypes.object.isRequired,
actions: PropTypes.shape({
handleSelectChannel: PropTypes.func.isRequired,

View file

@ -14,7 +14,6 @@ import * as RNPlaceholder from 'rn-placeholder';
import {SafeAreaView} from 'react-native-safe-area-context';
import FormattedText from '@components/formatted_text';
import CustomPropTypes from '@constants/custom_prop_types';
import {INDICATOR_BAR_HEIGHT} from '@constants/view';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
@ -39,7 +38,7 @@ export default class ChannelLoader extends PureComponent {
static propTypes = {
backgroundColor: PropTypes.string,
channelIsLoading: PropTypes.bool.isRequired,
style: CustomPropTypes.Style,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
theme: PropTypes.object.isRequired,
height: PropTypes.number,
retryLoad: PropTypes.func,

View file

@ -5,12 +5,10 @@ import PropTypes from 'prop-types';
import React from 'react';
import {TouchableOpacity} from 'react-native';
import CustomPropTypes from '@constants/custom_prop_types';
export default class ConditionalTouchable extends React.PureComponent {
static propTypes = {
touchable: PropTypes.bool,
children: CustomPropTypes.Children,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]),
};
render() {

View file

@ -10,7 +10,6 @@ import {
import CompassIcon from '@components/compass_icon';
import ConditionalTouchable from '@components/conditional_touchable';
import CustomPropTypes from '@constants/custom_prop_types';
export default class CustomListRow extends React.PureComponent {
static propTypes = {
@ -18,7 +17,7 @@ export default class CustomListRow extends React.PureComponent {
enabled: PropTypes.bool,
selectable: PropTypes.bool,
selected: PropTypes.bool,
children: CustomPropTypes.Children,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]),
testID: PropTypes.string,
};

View file

@ -3,12 +3,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import {Text, View, StyleSheet, StyleProp, TextStyle} from 'react-native';
import Emoji from 'app/components/emoji';
import {getEmoticonName} from 'app/utils/emoji_utils';
import {reEmoji, reEmoticon, reMain} from 'app/constants/emoji';
import {Text, View, StyleSheet, StyleProp} from 'react-native';
export default function ButtonBindingText({message, style}: {message: string; style: StyleProp<TextStyle>}) {
import Emoji from '@components/emoji';
import {reEmoji, reEmoticon, reMain} from '@constants/emoji';
import {getEmoticonName} from '@utils/emoji_utils';
export default function ButtonBindingText({message, style}: {message: string; style: StyleProp<any>}) {
const components = [] as JSX.Element[];
let text = message;

View file

@ -2,20 +2,20 @@
// See LICENSE.txt for license information.
import React, {PureComponent} from 'react';
import {LayoutChangeEvent, ScrollView, StyleProp, TextStyle, View, ViewStyle} from 'react-native';
import {LayoutChangeEvent, ScrollView, StyleProp, View} from 'react-native';
import Markdown from 'app/components/markdown';
import ShowMoreButton from 'app/components/show_more_button';
import Markdown from '@components/markdown';
import ShowMoreButton from '@components/show_more_button';
import {Theme} from '@mm-redux/types/preferences';
const SHOW_MORE_HEIGHT = 60;
type Props = {
baseTextStyle: StyleProp<TextStyle>,
blockStyles?: StyleProp<ViewStyle>[],
baseTextStyle: StyleProp<any>,
blockStyles?: StyleProp<any>[],
deviceHeight: number,
onPermalinkPress?: () => void,
textStyles?: StyleProp<TextStyle>[],
textStyles?: StyleProp<any>[],
theme?: Theme,
value?: string,
}

View file

@ -10,8 +10,6 @@ import {
} from 'react-native';
import FastImage from 'react-native-fast-image';
import CustomPropTypes from '@constants/custom_prop_types';
export default class Emoji extends React.PureComponent {
static propTypes = {
@ -36,9 +34,9 @@ export default class Emoji extends React.PureComponent {
displayTextOnly: PropTypes.bool,
literal: PropTypes.string,
size: PropTypes.number,
textStyle: CustomPropTypes.Style,
textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
unicode: PropTypes.string,
customEmojiStyle: CustomPropTypes.Style,
customEmojiStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
testID: PropTypes.string,
};

View file

@ -5,7 +5,6 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {Text} from 'react-native';
import CustomPropTypes from '@constants/custom_prop_types';
import FormattedText from 'app/components/formatted_text';
import {GlobalStyles} from 'app/styles';
import {makeStyleSheetFromTheme} from 'app/utils/theme';
@ -14,7 +13,7 @@ export default class ErrorText extends PureComponent {
static propTypes = {
testID: PropTypes.string,
error: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
textStyle: CustomPropTypes.Style,
textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
theme: PropTypes.object.isRequired,
};

View file

@ -10,7 +10,6 @@ import {injectIntl, intlShape} from 'react-intl';
import {concatStyles, changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
import {getMarkdownTextStyles} from 'app/utils/markdown';
import CustomPropTypes from '@constants/custom_prop_types';
import AtMention from 'app/components/at_mention';
import MarkdownLink from 'app/components/markdown/markdown_link';
@ -32,11 +31,11 @@ const TARGET_BLANK_URL_PREFIX = '!';
*/
class FormattedMarkdownText extends React.PureComponent {
static propTypes = {
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
defaultMessage: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
onPostPress: PropTypes.func,
style: CustomPropTypes.Style,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
textStyles: PropTypes.object,
theme: PropTypes.object.isRequired,
values: PropTypes.object,

View file

@ -6,15 +6,13 @@ import PropTypes from 'prop-types';
import {Text} from 'react-native';
import moment from 'moment-timezone';
import CustomPropTypes from '@constants/custom_prop_types';
export default class FormattedTime extends React.PureComponent {
static propTypes = {
value: PropTypes.any.isRequired,
timeZone: PropTypes.string,
children: PropTypes.func,
hour12: PropTypes.bool,
style: CustomPropTypes.Style,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
testID: PropTypes.string,
};

View file

@ -10,12 +10,10 @@ import {
View,
} from 'react-native';
import * as CustomPropTypes from '@constants/custom_prop_types';
export default class KeyboardLayout extends PureComponent {
static propTypes = {
children: PropTypes.node,
style: CustomPropTypes.Style,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
testID: PropTypes.string,
};

View file

@ -5,13 +5,12 @@ import PropTypes from 'prop-types';
import React from 'react';
import {Text} from 'react-native';
import CustomPropTypes from '@constants/custom_prop_types';
import {popToRoot, showSearchModal, dismissAllModals} from 'app/actions/navigation';
import {popToRoot, showSearchModal, dismissAllModals} from '@actions/navigation';
export default class Hashtag extends React.PureComponent {
static propTypes = {
hashtag: PropTypes.string.isRequired,
linkStyle: CustomPropTypes.Style,
linkStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
onHashtagPress: PropTypes.func,
};

View file

@ -16,7 +16,6 @@ import ChannelLink from 'app/components/channel_link';
import Emoji from 'app/components/emoji';
import FormattedText from 'app/components/formatted_text';
import Hashtag from 'app/components/markdown/hashtag';
import CustomPropTypes from '@constants/custom_prop_types';
import {blendColors, concatStyles, makeStyleSheetFromTheme} from 'app/utils/theme';
import {getScheme} from 'app/utils/url';
@ -40,7 +39,7 @@ import {
export default class Markdown extends PureComponent {
static propTypes = {
autolinkedUrlSchemes: PropTypes.array,
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
blockStyles: PropTypes.object,
channelMentions: PropTypes.object,
imagesMetadata: PropTypes.object,
@ -155,7 +154,8 @@ export default class Markdown extends PureComponent {
};
computeTextStyle = (baseStyle, context) => {
return concatStyles(baseStyle, context.map((type) => this.props.textStyles[type]));
const contextStyles = context.map((type) => this.props.textStyles[type]).filter((f) => f !== undefined);
return contextStyles.length ? concatStyles(baseStyle, contextStyles) : baseStyle;
};
renderText = ({context, literal}) => {

View file

@ -9,13 +9,12 @@ import {
} from 'react-native';
import CompassIcon from '@components/compass_icon';
import CustomPropTypes from '@constants/custom_prop_types';
export default class MarkdownBlockQuote extends PureComponent {
static propTypes = {
continue: PropTypes.bool,
iconStyle: CustomPropTypes.Style,
children: CustomPropTypes.Children,
iconStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]),
};
render() {

View file

@ -12,7 +12,6 @@ import {
} from 'react-native';
import Clipboard from '@react-native-community/clipboard';
import CustomPropTypes from '@constants/custom_prop_types';
import FormattedText from 'app/components/formatted_text';
import TouchableWithFeedback from 'app/components/touchable_with_feedback';
import BottomSheet from 'app/utils/bottom_sheet';
@ -29,7 +28,7 @@ export default class MarkdownCodeBlock extends React.PureComponent {
theme: PropTypes.object.isRequired,
language: PropTypes.string,
content: PropTypes.string.isRequired,
textStyle: CustomPropTypes.Style,
textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
};
static defaultProps = {

View file

@ -9,12 +9,11 @@ import PropTypes from 'prop-types';
import Emoji from 'app/components/emoji';
import FormattedText from 'app/components/formatted_text';
import CustomPropTypes from '@constants/custom_prop_types';
import {blendColors, concatStyles, makeStyleSheetFromTheme} from 'app/utils/theme';
export default class MarkdownEmoji extends PureComponent {
static propTypes = {
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
isEdited: PropTypes.bool,
shouldRenderJumboEmoji: PropTypes.bool.isRequired,
theme: PropTypes.object.isRequired,

View file

@ -19,7 +19,6 @@ import ImageViewPort from '@components/image_viewport';
import ProgressiveImage from '@components/progressive_image';
import FormattedText from '@components/formatted_text';
import TouchableWithFeedback from '@components/touchable_with_feedback';
import {CustomPropTypes} from '@constants';
import EphemeralStore from '@store/ephemeral_store';
import BottomSheet from '@utils/bottom_sheet';
import {generateId} from '@utils/file';
@ -35,7 +34,7 @@ export default class MarkdownImage extends ImageViewPort {
static propTypes = {
children: PropTypes.node,
disable: PropTypes.bool,
errorTextStyle: CustomPropTypes.Style,
errorTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
imagesMetadata: PropTypes.object,
isReplyPost: PropTypes.bool,
linkDestination: PropTypes.string,

View file

@ -10,7 +10,6 @@ import urlParse from 'url-parse';
import Config from '@assets/config';
import {DeepLinkTypes} from '@constants';
import CustomPropTypes from '@constants/custom_prop_types';
import {getCurrentServerUrl} from '@init/credentials';
import BottomSheet from '@utils/bottom_sheet';
import {errorBadChannel} from '@utils/draft';
@ -24,7 +23,7 @@ export default class MarkdownLink extends PureComponent {
actions: PropTypes.shape({
handleSelectChannelByName: PropTypes.func.isRequired,
}).isRequired,
children: CustomPropTypes.Children,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]),
href: PropTypes.string.isRequired,
onPermalinkPress: PropTypes.func,
serverURL: PropTypes.string,

View file

@ -9,16 +9,14 @@ import {
View,
} from 'react-native';
import CustomPropTypes from '@constants/custom_prop_types';
export default class MarkdownListItem extends PureComponent {
static propTypes = {
children: CustomPropTypes.Children,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]),
ordered: PropTypes.bool.isRequired,
continue: PropTypes.bool,
index: PropTypes.number.isRequired,
bulletWidth: PropTypes.number,
bulletStyle: CustomPropTypes.Style,
bulletStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
level: PropTypes.number,
};

View file

@ -5,13 +5,12 @@ import React, {PureComponent} from 'react';
import {Text, View} from 'react-native';
import PropTypes from 'prop-types';
import Markdown from 'app/components/markdown';
import CustomPropTypes from '@constants/custom_prop_types';
import {makeStyleSheetFromTheme} from 'app/utils/theme';
import Markdown from '@components/markdown';
import {makeStyleSheetFromTheme} from '@utils/theme';
export default class AttachmentFields extends PureComponent {
static propTypes = {
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
blockStyles: PropTypes.object.isRequired,
fields: PropTypes.array,
metadata: PropTypes.object,

View file

@ -5,12 +5,11 @@ import React, {PureComponent} from 'react';
import {StyleSheet, View} from 'react-native';
import PropTypes from 'prop-types';
import Markdown from 'app/components/markdown';
import CustomPropTypes from '@constants/custom_prop_types';
import Markdown from '@components/markdown';
export default class AttachmentPreText extends PureComponent {
static propTypes = {
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
blockStyles: PropTypes.object.isRequired,
metadata: PropTypes.object,
onPermalinkPress: PropTypes.func,

View file

@ -5,15 +5,14 @@ import React, {PureComponent} from 'react';
import {ScrollView, StyleSheet, View} from 'react-native';
import PropTypes from 'prop-types';
import Markdown from 'app/components/markdown';
import ShowMoreButton from 'app/components/show_more_button';
import CustomPropTypes from '@constants/custom_prop_types';
import Markdown from '@components/markdown';
import ShowMoreButton from '@components/show_more_button';
const SHOW_MORE_HEIGHT = 60;
export default class AttachmentText extends PureComponent {
static propTypes = {
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
blockStyles: PropTypes.object.isRequired,
deviceHeight: PropTypes.number.isRequired,
hasThumbnail: PropTypes.bool,

View file

@ -5,14 +5,12 @@ import React, {PureComponent} from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import CustomPropTypes from '@constants/custom_prop_types';
import MessageAttachment from './message_attachment';
export default class MessageAttachments extends PureComponent {
static propTypes = {
attachments: PropTypes.array.isRequired,
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
blockStyles: PropTypes.object,
deviceHeight: PropTypes.number.isRequired,
deviceWidth: PropTypes.number.isRequired,

View file

@ -5,9 +5,8 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import CustomPropTypes from '@constants/custom_prop_types';
import {getStatusColors} from 'app/utils/message_attachment_colors';
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
import {getStatusColors} from '@utils/message_attachment_colors';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
import AttachmentActions from './attachment_actions';
import AttachmentAuthor from './attachment_author';
@ -22,7 +21,7 @@ import AttachmentFooter from './attachment_footer';
export default class MessageAttachment extends PureComponent {
static propTypes = {
attachment: PropTypes.object.isRequired,
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
blockStyles: PropTypes.object,
deviceHeight: PropTypes.number.isRequired,
deviceWidth: PropTypes.number.isRequired,

View file

@ -7,14 +7,11 @@ import {intlShape} from 'react-intl';
import {Text} from 'react-native';
import AtMention from '@components/at_mention';
import FormattedText from '@components/formatted_text';
import {General} from '@mm-redux/constants';
import {concatStyles} from 'app/utils/theme';
import {t} from 'app/utils/i18n';
import AtMention from 'app/components/at_mention';
import FormattedText from 'app/components/formatted_text';
import CustomPropTypes from '@constants/custom_prop_types';
import {t} from '@utils/i18n';
import {concatStyles} from '@utils/theme';
export default class PostAddChannelMember extends React.PureComponent {
static propTypes = {
@ -23,7 +20,7 @@ export default class PostAddChannelMember extends React.PureComponent {
removePost: PropTypes.func.isRequired,
sendAddToChannelEphemeralPost: PropTypes.func.isRequired,
}).isRequired,
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
currentUser: PropTypes.object.isRequired,
channelType: PropTypes.string,
post: PropTypes.object.isRequired,

View file

@ -14,14 +14,7 @@ exports[`renderSystemMessage uses renderer for Channel Display Name update 1`] =
>
<Text>
<Text
style={
Array [
Object {},
Array [
undefined,
],
]
}
style={Object {}}
testID="markdown_text"
>
{username} updated the channel display name from: {oldDisplayName} to: {newDisplayName}
@ -44,14 +37,7 @@ exports[`renderSystemMessage uses renderer for Channel Header update 1`] = `
>
<Text>
<Text
style={
Array [
Object {},
Array [
undefined,
],
]
}
style={Object {}}
testID="markdown_text"
>
{username} updated the channel header from: {oldHeader} to: {newHeader}
@ -82,14 +68,7 @@ exports[`renderSystemMessage uses renderer for OLD archived channel without a us
>
<Text>
<Text
style={
Array [
Object {},
Array [
undefined,
],
]
}
style={Object {}}
testID="markdown_text"
>
{username} archived the channel
@ -123,14 +102,7 @@ exports[`renderSystemMessage uses renderer for archived channel 2`] = `
>
<Text>
<Text
style={
Array [
Object {},
Array [
undefined,
],
]
}
style={Object {}}
testID="markdown_text"
>
{username} archived the channel
@ -153,14 +125,7 @@ exports[`renderSystemMessage uses renderer for unarchived channel 1`] = `
>
<Text>
<Text
style={
Array [
Object {},
Array [
undefined,
],
]
}
style={Object {}}
testID="markdown_text"
>
{username} unarchived the channel

View file

@ -18,7 +18,6 @@ import ImageViewPort from '@components/image_viewport';
import PostAttachmentImage from '@components/post_attachment_image';
import ProgressiveImage from '@components/progressive_image';
import TouchableWithFeedback from '@components/touchable_with_feedback';
import CustomPropTypes from '@constants/custom_prop_types';
import EventEmitter from '@mm-redux/utils/event_emitter';
import {generateId} from '@utils/file';
import {calculateDimensions, getViewPortWidth, openGalleryAtIndex} from '@utils/images';
@ -36,7 +35,7 @@ export default class PostBodyAdditionalContent extends ImageViewPort {
actions: PropTypes.shape({
getRedirectLocation: PropTypes.func.isRequired,
}).isRequired,
baseTextStyle: CustomPropTypes.Style,
baseTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
blockStyles: PropTypes.object,
deviceHeight: PropTypes.number.isRequired,
deviceWidth: PropTypes.number.isRequired,

View file

@ -6,7 +6,6 @@ import PropTypes from 'prop-types';
import {Animated, ImageBackground, Image, Platform, View, StyleSheet} from 'react-native';
import thumb from '@assets/images/thumb.png';
import CustomPropTypes from '@constants/custom_prop_types';
import RetriableFastImage from '@components/retriable_fast_image';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
@ -17,15 +16,15 @@ export default class ProgressiveImage extends PureComponent {
static propTypes = {
id: PropTypes.string,
isBackgroundImage: PropTypes.bool,
children: CustomPropTypes.Children,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]),
defaultSource: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.number]), // this should be provided by the component
imageUri: PropTypes.string,
imageStyle: CustomPropTypes.Style,
imageStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
inViewPort: PropTypes.bool,
onError: PropTypes.func,
resizeMethod: PropTypes.string,
resizeMode: PropTypes.string,
style: CustomPropTypes.Style,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
theme: PropTypes.object.isRequired,
thumbnailUri: PropTypes.string,
tintDefaultSource: PropTypes.bool,

View file

@ -19,7 +19,6 @@ import {SearchBar} from 'react-native-elements';
import {memoizeResult} from '@mm-redux/utils/helpers';
import CompassIcon from '@components/compass_icon';
import CustomPropTypes from '@constants/custom_prop_types';
const LEFT_COMPONENT_INITIAL_POSITION = Platform.OS === 'ios' ? 7 : 0;
@ -38,9 +37,9 @@ export default class Search extends PureComponent {
tintColorSearch: PropTypes.string,
tintColorDelete: PropTypes.string,
selectionColor: PropTypes.string,
inputStyle: CustomPropTypes.Style,
containerStyle: CustomPropTypes.Style,
cancelButtonStyle: CustomPropTypes.Style,
inputStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
containerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
cancelButtonStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
autoFocus: PropTypes.bool,
placeholder: PropTypes.string,
cancelTitle: PropTypes.oneOfType([

View file

@ -7,12 +7,10 @@ import React, {PureComponent} from 'react';
import {TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, View} from 'react-native';
import PropTypes from 'prop-types';
import CustomPropTypes from '@constants/custom_prop_types';
export default class TouchableWithFeedbackAndroid extends PureComponent {
static propTypes = {
testID: PropTypes.string,
children: CustomPropTypes.Children,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]),
underlayColor: PropTypes.string,
type: PropTypes.oneOf(['native', 'opacity', 'none']),
};

View file

@ -5,12 +5,10 @@ import React, {PureComponent} from 'react';
import {PanResponder, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, View} from 'react-native';
import PropTypes from 'prop-types';
import CustomPropTypes from '@constants/custom_prop_types';
export default class TouchableWithFeedbackIOS extends PureComponent {
static propTypes = {
testID: PropTypes.string,
children: CustomPropTypes.Children,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]),
cancelTouchOnPanning: PropTypes.bool,
type: PropTypes.oneOf(['native', 'opacity', 'none']),
};