diff --git a/components/DropDownMenu/DropDownModal.js b/components/DropDownMenu/DropDownModal.js index 49f3cdcb..bf3ae6e4 100644 --- a/components/DropDownMenu/DropDownModal.js +++ b/components/DropDownMenu/DropDownModal.js @@ -7,6 +7,7 @@ import { LayoutAnimation, Dimensions, } from 'react-native'; +import PropTypes from 'prop-types'; import _ from 'lodash'; import { Button } from '../Button'; @@ -31,45 +32,45 @@ class DropDownModal extends Component { /** * Callback that is called when dropdown option is selected */ - onOptionSelected: React.PropTypes.func, + onOptionSelected: PropTypes.func, /** * Collection of objects which will be shown as options in DropDownMenu */ - options: React.PropTypes.array.isRequired, + options: PropTypes.array.isRequired, /** * Selected option that will be shown. */ - selectedOption: React.PropTypes.any.isRequired, + selectedOption: PropTypes.any.isRequired, /** * Key name that represents option's string value, * and it will be displayed to the user in the UI */ - titleProperty: React.PropTypes.string.isRequired, + titleProperty: PropTypes.string.isRequired, /** * Key name that represents option's value */ - valueProperty: React.PropTypes.string.isRequired, + valueProperty: PropTypes.string.isRequired, /** * Number of options shown without scroll. * Can be set trough DropDown style.visibleOptions. * Prop definition overrides style. */ - visibleOptions: React.PropTypes.number, + visibleOptions: PropTypes.number, /** * Optional render function, for every item in the list. * Input parameter should be shaped as one of the items from the * options object */ - renderOption: React.PropTypes.func, + renderOption: PropTypes.func, /** * Visibility flag, controling the modal visibility */ - visible: React.PropTypes.bool, + visible: PropTypes.bool, /** * Callback that is called when modal should be closed */ - onClose: React.PropTypes.func, - style: React.PropTypes.object, + onClose: PropTypes.func, + style: PropTypes.object, }; static defaultProps = { diff --git a/components/GridRow.js b/components/GridRow.js index e8dc8067..a3ec3208 100644 --- a/components/GridRow.js +++ b/components/GridRow.js @@ -1,5 +1,6 @@ import React, { Children } from 'react'; import { View as RNView } from 'react-native'; +import PropTypes from 'prop-types'; import _ from 'lodash'; import { View } from './View'; @@ -35,7 +36,7 @@ class GridRow extends React.Component { } GridRow.propTypes = { - columns: React.PropTypes.number.isRequired, + columns: PropTypes.number.isRequired, ...RNView.propTypes, }; diff --git a/components/HorizontalPager/HorizontalPager.js b/components/HorizontalPager/HorizontalPager.js index a56fea65..9ae16fd1 100644 --- a/components/HorizontalPager/HorizontalPager.js +++ b/components/HorizontalPager/HorizontalPager.js @@ -1,7 +1,7 @@ import React, { Component, - PropTypes, } from 'react'; +import PropTypes from 'prop-types'; import { ScrollView, diff --git a/components/HorizontalPager/Page.js b/components/HorizontalPager/Page.js index c331b28e..dfe37981 100644 --- a/components/HorizontalPager/Page.js +++ b/components/HorizontalPager/Page.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { View } from '../../index'; @@ -9,10 +10,10 @@ import { View } from '../../index'; */ export class Page extends Component { static propTypes = { - isActive: React.PropTypes.bool.isRequired, - width: React.PropTypes.number.isRequired, - style: React.PropTypes.object, - children: React.PropTypes.node, + isActive: PropTypes.bool.isRequired, + width: PropTypes.number.isRequired, + style: PropTypes.object, + children: PropTypes.node, }; shouldComponentUpdate(nextProps) { diff --git a/components/ImageGallery/ImageGalleryBase.js b/components/ImageGallery/ImageGalleryBase.js index 006d2e44..f5ed7826 100644 --- a/components/ImageGallery/ImageGalleryBase.js +++ b/components/ImageGallery/ImageGalleryBase.js @@ -1,4 +1,5 @@ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import _ from 'lodash'; diff --git a/components/ImageGalleryOverlay.js b/components/ImageGalleryOverlay.js index 92cd5e67..2c55e6dd 100644 --- a/components/ImageGalleryOverlay.js +++ b/components/ImageGalleryOverlay.js @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import { ScrollView, } from 'react-native'; +import PropTypes from 'prop-types'; import { connectStyle } from '@shoutem/theme'; import { connectAnimation } from '@shoutem/animation'; @@ -23,9 +24,9 @@ const DESCRIPTION_LENGTH_TRIM_LIMIT = 90; */ class ImageGalleryOverlay extends Component { static propTypes = { - title: React.PropTypes.string, - description: React.PropTypes.string, - style: React.PropTypes.object, + title: PropTypes.string, + description: PropTypes.string, + style: PropTypes.object, }; constructor(props) { diff --git a/components/ImagePreview.js b/components/ImagePreview.js index 2f1a140c..2c86c8e6 100644 --- a/components/ImagePreview.js +++ b/components/ImagePreview.js @@ -1,5 +1,4 @@ import React, { - PropTypes, Component, } from 'react'; import { @@ -8,6 +7,7 @@ import { Image, TouchableOpacity, } from 'react-native'; +import PropTypes from 'prop-types'; import Icon from 'react-native-vector-icons/MaterialIcons'; diff --git a/components/InlineGallery.js b/components/InlineGallery.js index bee3748e..161df25c 100644 --- a/components/InlineGallery.js +++ b/components/InlineGallery.js @@ -1,4 +1,5 @@ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import _ from 'lodash'; import { connectStyle } from '@shoutem/theme'; @@ -14,8 +15,8 @@ class InlineGallery extends Component { // Array containing objects with image data (shape defined below) data: PropTypes.arrayOf( PropTypes.shape({ - source: React.PropTypes.shape({ - uri: React.PropTypes.string, + source: PropTypes.shape({ + uri: PropTypes.string, }), }), ).isRequired, diff --git a/components/ListView.js b/components/ListView.js index 86a1454d..59678d79 100644 --- a/components/ListView.js +++ b/components/ListView.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { View, ListView as RNListView, @@ -65,18 +66,18 @@ class ListDataSource { class ListView extends React.Component { static propTypes = { - autoHideHeader: React.PropTypes.bool, - style: React.PropTypes.object, - data: React.PropTypes.array, - loading: React.PropTypes.bool, - onLoadMore: React.PropTypes.func, - onRefresh: React.PropTypes.func, - getSectionId: React.PropTypes.func, - renderRow: React.PropTypes.func, - renderHeader: React.PropTypes.func, - renderFooter: React.PropTypes.func, - renderSectionHeader: React.PropTypes.func, - scrollDriver: React.PropTypes.object, + autoHideHeader: PropTypes.bool, + style: PropTypes.object, + data: PropTypes.array, + loading: PropTypes.bool, + onLoadMore: PropTypes.func, + onRefresh: PropTypes.func, + getSectionId: PropTypes.func, + renderRow: PropTypes.func, + renderHeader: PropTypes.func, + renderFooter: PropTypes.func, + renderSectionHeader: PropTypes.func, + scrollDriver: PropTypes.object, // TODO(Braco) - add render separator }; diff --git a/components/NavigationBar/NavigationBar.js b/components/NavigationBar/NavigationBar.js index f6cbb660..d42719cc 100644 --- a/components/NavigationBar/NavigationBar.js +++ b/components/NavigationBar/NavigationBar.js @@ -5,6 +5,7 @@ import { Platform, View, } from 'react-native'; +import PropTypes from 'prop-types'; import _ from 'lodash'; @@ -55,11 +56,11 @@ function setStatusBarStyle(backgroundColor) { // eslint-disable-next-line react/prefer-stateless-function class NavigationBar extends Component { static propTypes = { - leftComponent: React.PropTypes.node, - centerComponent: React.PropTypes.node, - rightComponent: React.PropTypes.node, - style: React.PropTypes.object, - id: React.PropTypes.string, + leftComponent: PropTypes.node, + centerComponent: PropTypes.node, + rightComponent: PropTypes.node, + style: PropTypes.object, + id: PropTypes.string, }; static defaultProps = { diff --git a/components/PageIndicators.js b/components/PageIndicators.js index 9c3a21da..42a78e1f 100644 --- a/components/PageIndicators.js +++ b/components/PageIndicators.js @@ -1,7 +1,7 @@ import React, { Component, - PropTypes, } from 'react'; +import PropTypes from 'prop-types'; import { connectStyle } from '@shoutem/theme'; import { View } from './View'; diff --git a/components/RichMedia.js b/components/RichMedia.js index e31c64f8..c48d7597 100644 --- a/components/RichMedia.js +++ b/components/RichMedia.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { Html } from '../html'; export default function RichMedia({ body }) { @@ -7,5 +8,5 @@ export default function RichMedia({ body }) { } RichMedia.propTypes = { - body: React.PropTypes.string.isRequired, + body: PropTypes.string.isRequired, }; diff --git a/components/ScrollView/ScrollDriverProvider.js b/components/ScrollView/ScrollDriverProvider.js index d1b67188..15c2493e 100644 --- a/components/ScrollView/ScrollDriverProvider.js +++ b/components/ScrollView/ScrollDriverProvider.js @@ -1,4 +1,5 @@ import React, { Component, Children } from 'react'; +import PropTypes from 'prop-types'; import { DriverShape, ScrollDriver } from '@shoutem/animation'; import * as _ from 'lodash'; /** @@ -9,7 +10,7 @@ import * as _ from 'lodash'; */ export class ScrollDriverProvider extends Component { static childContextTypes = { - driverProvider: React.PropTypes.object, + driverProvider: PropTypes.object, animationDriver: DriverShape, }; @@ -18,7 +19,7 @@ export class ScrollDriverProvider extends Component { }; static propTypes = { - children: React.PropTypes.node, + children: PropTypes.node, driver: DriverShape, }; diff --git a/components/ScrollView/ScrollView.js b/components/ScrollView/ScrollView.js index 9d19de44..e5ac70bb 100644 --- a/components/ScrollView/ScrollView.js +++ b/components/ScrollView/ScrollView.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { Animated } from 'react-native'; import { connectStyle } from '@shoutem/theme'; import _ from 'lodash'; @@ -14,7 +15,7 @@ class ScrollView extends Component { static contextTypes = { animationDriver: DriverShape, - driverProvider: React.PropTypes.object, + driverProvider: PropTypes.object, }; static childContextTypes = { diff --git a/components/ShareButton.js b/components/ShareButton.js index 0f2d945c..51b99c4c 100644 --- a/components/ShareButton.js +++ b/components/ShareButton.js @@ -1,6 +1,7 @@ import React, { Component, } from 'react'; +import PropTypes from 'prop-types'; import { Alert } from 'react-native'; @@ -13,7 +14,7 @@ import { Icon } from './Icon'; const USER_CANCELLED_ERROR = 'User did not share'; -const { func, string } = React.PropTypes; +const { func, string } = PropTypes; const showErrorMessage = (error) => { if (error.error === USER_CANCELLED_ERROR) { diff --git a/components/Spinner.js b/components/Spinner.js index 21c09aed..ad3f49c5 100644 --- a/components/Spinner.js +++ b/components/Spinner.js @@ -2,6 +2,7 @@ import React from 'react'; import { ActivityIndicator, } from 'react-native'; +import PropTypes from 'prop-types'; import { connectStyle } from '@shoutem/theme'; @@ -24,7 +25,7 @@ class Spinner extends React.Component { } Spinner.propTypes = { - style: React.PropTypes.object, + style: PropTypes.object, }; const StyledSpinner = connectStyle('shoutem.ui.Spinner', { diff --git a/components/Switch.js b/components/Switch.js index 9d86b25c..adae1581 100644 --- a/components/Switch.js +++ b/components/Switch.js @@ -1,6 +1,7 @@ import React, { Component, } from 'react'; +import PropTypes from 'prop-types'; import { TouchableWithoutFeedback } from 'react-native'; @@ -9,7 +10,7 @@ import { View } from '@shoutem/ui'; import { connectStyle } from '@shoutem/theme'; import { connectAnimation, TimingDriver } from '@shoutem/animation'; -const { bool, func, object, shape } = React.PropTypes; +const { bool, func, object, shape } = PropTypes; class Switch extends Component { static propTypes = { diff --git a/components/TextInput.js b/components/TextInput.js index 28ecd2b3..b885c1aa 100644 --- a/components/TextInput.js +++ b/components/TextInput.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { TextInput as RNTextInput } from 'react-native'; +import PropTypes from 'prop-types'; import { connectStyle } from '@shoutem/theme'; import { connectAnimation } from '@shoutem/animation'; @@ -28,7 +29,7 @@ class TextInput extends Component { TextInput.propTypes = { ...RNTextInput.propTypes, - style: React.PropTypes.object, + style: PropTypes.object, }; const AnimatedTextInput = connectAnimation(TextInput); diff --git a/components/Touchable.js b/components/Touchable.js index e40134c6..2a634599 100644 --- a/components/Touchable.js +++ b/components/Touchable.js @@ -1,5 +1,6 @@ -import React, { PropTypes } from 'react'; +import React from 'react'; import { Platform } from 'react-native'; +import PropTypes from 'prop-types'; import { connectStyle } from '@shoutem/theme'; diff --git a/components/TouchableNativeFeedback.js b/components/TouchableNativeFeedback.js index efb72403..46dd6ea0 100644 --- a/components/TouchableNativeFeedback.js +++ b/components/TouchableNativeFeedback.js @@ -1,4 +1,5 @@ -import React, { PropTypes } from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native'; import { connectStyle } from '@shoutem/theme'; diff --git a/components/Video/Video.js b/components/Video/Video.js index 068adc3c..ffc248a8 100644 --- a/components/Video/Video.js +++ b/components/Video/Video.js @@ -1,6 +1,5 @@ -import React, { - PropTypes, -} from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; import { View, diff --git a/components/View.js b/components/View.js index 5590db44..81985202 100644 --- a/components/View.js +++ b/components/View.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { View as RNView } from 'react-native'; import { connectStyle } from '@shoutem/theme'; @@ -35,7 +36,7 @@ class View extends Component { View.propTypes = { ...RNView.propTypes, - style: React.PropTypes.object, + style: PropTypes.object, }; const AnimatedView = connectAnimation(View); diff --git a/examples/RestaurantsApp/app/App.js b/examples/RestaurantsApp/app/App.js index 4538e657..607b17d0 100644 --- a/examples/RestaurantsApp/app/App.js +++ b/examples/RestaurantsApp/app/App.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { @@ -12,9 +13,9 @@ import RestaurantDetails from './RestaurantDetails'; class App extends Component { static propTypes = { - onNavigateBack: React.PropTypes.func.isRequired, - navigationState: React.PropTypes.object, - scene: React.PropTypes.object, + onNavigateBack: PropTypes.func.isRequired, + navigationState: PropTypes.object, + scene: PropTypes.object, }; constructor(props) { diff --git a/examples/RestaurantsApp/app/RestaurantDetails.js b/examples/RestaurantsApp/app/RestaurantDetails.js index 4368f65c..bef1b96b 100644 --- a/examples/RestaurantsApp/app/RestaurantDetails.js +++ b/examples/RestaurantsApp/app/RestaurantDetails.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { ScrollView, Icon, @@ -19,7 +20,7 @@ import { export default class RestaurantDetails extends Component { static propTypes = { - restaurant: React.PropTypes.object, + restaurant: PropTypes.object, }; render() { diff --git a/examples/RestaurantsApp/app/RestaurantsList.js b/examples/RestaurantsApp/app/RestaurantsList.js index 5faa248a..7b02f33c 100644 --- a/examples/RestaurantsApp/app/RestaurantsList.js +++ b/examples/RestaurantsApp/app/RestaurantsList.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { Image, ListView, @@ -19,7 +20,7 @@ import { navigatePush } from './redux'; class RestaurantsList extends Component { static propTypes = { - onButtonPress: React.PropTypes.func, + onButtonPress: PropTypes.func, }; constructor(props) { diff --git a/examples/components/Stage.js b/examples/components/Stage.js index f11dd9a6..39ba1a85 100644 --- a/examples/components/Stage.js +++ b/examples/components/Stage.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { View, Text } from 'react-native'; @@ -14,8 +15,8 @@ function Stage({ title, children }) { } Stage.propTypes = { - title: React.PropTypes.string, - children: React.PropTypes.node, + title: PropTypes.string, + children: PropTypes.node, }; const styles = { diff --git a/html/Html.js b/html/Html.js index 04e3953e..64876623 100644 --- a/html/Html.js +++ b/html/Html.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { Platform, InteractionManager } from 'react-native'; +import PropTypes from 'prop-types'; import _ from 'lodash'; import { View, Spinner } from '@shoutem/ui'; @@ -20,9 +21,9 @@ const defaultElementSettings = { class Html extends Component { static propTypes = { - body: React.PropTypes.string.isRequired, - renderElement: React.PropTypes.func, - style: React.PropTypes.object, + body: PropTypes.string.isRequired, + renderElement: PropTypes.func, + style: PropTypes.object, }; /** @@ -152,12 +153,12 @@ class Html extends Component { } export const ElementPropTypes = { - childElements: React.PropTypes.array, - renderElement: React.PropTypes.func, - inlineStyle: React.PropTypes.string, - children: React.PropTypes.oneOfType([ - React.PropTypes.arrayOf(React.PropTypes.node), - React.PropTypes.node, + childElements: PropTypes.array, + renderElement: PropTypes.func, + inlineStyle: PropTypes.string, + children: PropTypes.oneOfType([ + PropTypes.arrayOf(PropTypes.node), + PropTypes.node, ]), }; diff --git a/html/components/Gallery.js b/html/components/Gallery.js index 4f361dd3..65b7dcfc 100644 --- a/html/components/Gallery.js +++ b/html/components/Gallery.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { InlineGallery } from '../../components/InlineGallery'; @@ -9,7 +10,7 @@ import { InlineGallery } from '../../components/InlineGallery'; export default class Gallery extends Component { static propTypes = { ...InlineGallery.propTypes, - handlePhotoPress: React.PropTypes.func, + handlePhotoPress: PropTypes.func, }; constructor(props) { diff --git a/html/components/Image.js b/html/components/Image.js index 85d0abf8..832fa94f 100644 --- a/html/components/Image.js +++ b/html/components/Image.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { Image as RNImage } from 'react-native'; import { connectStyle } from '@shoutem/theme'; import _ from 'lodash'; @@ -15,8 +16,8 @@ import { Lightbox } from '../../components/Lightbox'; export default class HtmlImage extends Component { static propTypes = { ...RNImage.propTypes, - lightbox: React.PropTypes.bool, - allowUpscale: React.PropTypes.bool, + lightbox: PropTypes.bool, + allowUpscale: PropTypes.bool, }; static defaultProps = { diff --git a/html/elements/A.js b/html/elements/A.js index 2853798e..4910a307 100644 --- a/html/elements/A.js +++ b/html/elements/A.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { Linking } from 'react-native'; import { connectStyle } from '@shoutem/theme'; import _ from 'lodash'; @@ -10,8 +11,8 @@ import { Inline } from './Inline'; class A extends React.Component { static propTypes = { ...ElementPropTypes, - handleLinkPress: React.PropTypes.func, - href: React.PropTypes.string, + handleLinkPress: PropTypes.func, + href: PropTypes.string, }; constructor(props, context) { diff --git a/html/elements/Inline.js b/html/elements/Inline.js index 7218e8be..f1ae34bb 100644 --- a/html/elements/Inline.js +++ b/html/elements/Inline.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import _ from 'lodash'; import { View } from '../../components/View'; @@ -135,8 +136,8 @@ export class Inline extends React.Component { static propTypes = { ...ElementPropTypes, - onPress: React.PropTypes.func, - onLineBreak: React.PropTypes.func, + onPress: PropTypes.func, + onLineBreak: PropTypes.func, }; static defaultProps = { diff --git a/html/elements/Video.js b/html/elements/Video.js index 70ef30e2..d400a7a4 100644 --- a/html/elements/Video.js +++ b/html/elements/Video.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { View } from '../../components/View'; import { Video as UIVideo } from '../../components/Video'; import Image from '../components/Image'; @@ -24,9 +25,9 @@ function Video({ src, thumbnailUrl, style }) { } Video.propTypes = { - src: React.PropTypes.string, - thumbnail_url: React.PropTypes.string, - style: React.PropTypes.object, + src: PropTypes.string, + thumbnail_url: PropTypes.string, + style: PropTypes.object, }; Video.defaultProps = { diff --git a/html/elements/list/Li.js b/html/elements/list/Li.js index 5a8df646..aba1b546 100644 --- a/html/elements/list/Li.js +++ b/html/elements/list/Li.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { View } from '../../../components/View'; import { ElementPropTypes } from '../../Html'; @@ -27,7 +28,7 @@ function Li({ element, renderElement, style }) { Li.propTypes = { ...ElementPropTypes, - prefix: React.PropTypes.element, + prefix: PropTypes.element, }; export default Li; diff --git a/html/elements/list/Ol.js b/html/elements/list/Ol.js index 2f6388e2..c8cb8c7b 100644 --- a/html/elements/list/Ol.js +++ b/html/elements/list/Ol.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { View } from '../../../components/View'; import { Text } from '../../../components/Text'; @@ -27,8 +28,8 @@ export function Ol({ style, childElements, type, renderElement }) { Ol.propTypes = { ...ElementPropTypes, - style: React.PropTypes.object, - type: React.PropTypes.string, + style: PropTypes.object, + type: PropTypes.string, }; export default combineMappers(mapElementProps)(Ol); diff --git a/html/elements/list/Ul.js b/html/elements/list/Ul.js index 04fbf0f0..984df39c 100644 --- a/html/elements/list/Ul.js +++ b/html/elements/list/Ul.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { Text } from '@shoutem/ui'; import { View } from '../../../components/View'; @@ -25,7 +26,7 @@ export function Ul({ style, childElements, renderElement }) { Ul.propTypes = { ...ElementPropTypes, - style: React.PropTypes.object, + style: PropTypes.object, }; export default combineMappers(mapElementProps)(Ul); diff --git a/navigation/CardStack.js b/navigation/CardStack.js index e82c6098..cc84e06b 100644 --- a/navigation/CardStack.js +++ b/navigation/CardStack.js @@ -1,4 +1,5 @@ import React, { PureComponent } from 'react'; +import PropTypes from 'prop-types'; import { InteractionManager, } from 'react-native'; @@ -23,17 +24,17 @@ import { RNCardStack } from './RNCardStack'; class CardStack extends PureComponent { static propTypes = { ...RNCardStack.propTypes, - renderNavBar: React.PropTypes.func, + renderNavBar: PropTypes.func, // Controls whether native animation driver will be used // for screen transitions or not. - useNativeAnimations: React.PropTypes.bool, + useNativeAnimations: PropTypes.bool, // Controls whether the navigation bar should be rendered, // together with the screen, or should it be global for the // entire app. - inlineNavigationBar: React.PropTypes.bool, - style: React.PropTypes.shape({ + inlineNavigationBar: PropTypes.bool, + style: PropTypes.shape({ cardStack: RNCardStack.propTypes.style, - card: React.PropTypes.any, + card: PropTypes.any, }), }; @@ -43,14 +44,14 @@ class CardStack extends PureComponent { }; static contextTypes = { - getNavBarProps: React.PropTypes.func, - getScene: React.PropTypes.func, + getNavBarProps: PropTypes.func, + getScene: PropTypes.func, }; static childContextTypes = { - setNavBarProps: React.PropTypes.func, - getNavBarProps: React.PropTypes.func, - clearNavBarProps: React.PropTypes.func, + setNavBarProps: PropTypes.func, + getNavBarProps: PropTypes.func, + clearNavBarProps: PropTypes.func, }; constructor(props, context) { diff --git a/navigation/NavigationBar.js b/navigation/NavigationBar.js index c96c2691..e3b50ea8 100644 --- a/navigation/NavigationBar.js +++ b/navigation/NavigationBar.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import _ from 'lodash'; import { DriverShape } from '@shoutem/animation'; import { connectStyle } from '@shoutem/theme'; @@ -18,21 +19,21 @@ class NavigationBar extends Component { /** * If `true`, the navigation bar will not be rendered. */ - hidden: React.PropTypes.bool, + hidden: PropTypes.bool, /** * Use the child navigation bar instead, if `true` * the parent navigation bar will be hidden, and * the navigation bar props will be merged with the * props of the child navigation bar instead. */ - child: React.PropTypes.bool, + child: PropTypes.bool, }; static contextTypes = { animationDriver: DriverShape, - getScene: React.PropTypes.func.isRequired, - setNavBarProps: React.PropTypes.func.isRequired, - clearNavBarProps: React.PropTypes.func.isRequired, + getScene: PropTypes.func.isRequired, + setNavBarProps: PropTypes.func.isRequired, + clearNavBarProps: PropTypes.func.isRequired, }; constructor(props, context) { diff --git a/navigation/NavigationBarView.js b/navigation/NavigationBarView.js index 760f7964..c2801277 100644 --- a/navigation/NavigationBarView.js +++ b/navigation/NavigationBarView.js @@ -1,4 +1,5 @@ import React, { PureComponent } from 'react'; +import PropTypes from 'prop-types'; import _ from 'lodash'; import tinyColor from 'tinycolor2'; @@ -63,24 +64,24 @@ class NavigationBarView extends PureComponent { /** * The title to display in the navigation bar. */ - title: React.PropTypes.string, + title: PropTypes.string, /** * If this prop exists, and has a valid link, * a share control will be rendered as the right * component of the navigation bar. */ - share: React.PropTypes.shape({ - title: React.PropTypes.string, - text: React.PropTypes.string, - link: React.PropTypes.string, + share: PropTypes.shape({ + title: PropTypes.string, + text: PropTypes.string, + link: PropTypes.string, }), - style: React.PropTypes.object, - useNativeAnimations: React.PropTypes.bool, + style: PropTypes.object, + useNativeAnimations: PropTypes.bool, // Whether the navigation bar is rendered inline // with the screen. - inline: React.PropTypes.bool, - hidden: React.PropTypes.bool, - child: React.PropTypes.bool, + inline: PropTypes.bool, + hidden: PropTypes.bool, + child: PropTypes.bool, }; static defaultProps = { @@ -91,8 +92,8 @@ class NavigationBarView extends PureComponent { }; static contextTypes = { - transformProps: React.PropTypes.func.isRequired, - getNavBarProps: React.PropTypes.func.isRequired, + transformProps: PropTypes.func.isRequired, + getNavBarProps: PropTypes.func.isRequired, }; componentWillReceiveProps(nextProps) { diff --git a/navigation/SceneProvider.js b/navigation/SceneProvider.js index 02312145..fd29083f 100644 --- a/navigation/SceneProvider.js +++ b/navigation/SceneProvider.js @@ -1,16 +1,17 @@ import React, { Children, Component } from 'react'; +import PropTypes from 'prop-types'; /** * Provides the current navigation scene to child components. */ export class SceneProvider extends Component { static propTypes = { - children: React.PropTypes.node, - scene: React.PropTypes.object.isRequired, + children: PropTypes.node, + scene: PropTypes.object.isRequired, }; static childContextTypes = { - getScene: React.PropTypes.func.isRequired, + getScene: PropTypes.func.isRequired, }; constructor(props, context) { diff --git a/package.json b/package.json index 37e4017e..b2007f35 100644 --- a/package.json +++ b/package.json @@ -3,24 +3,25 @@ "version": "0.21.3", "description": "Styleable set of components for React Native applications", "dependencies": { - "@shoutem/animation": "~0.11.0", - "@shoutem/theme": "~0.10.0", + "@shoutem/animation": "github:shoutem/animation#6b35a9b13910dc5f71215a7ad5757a06ca3c01a1", + "@shoutem/theme": "github:shoutem/theme.git#develop", "babel-plugin-transform-decorators-legacy": "~1.3.4", - "buffer": "~4.5.1", - "events": "1.1.0", + "buffer": "^5.0.7", + "events": "^1.1.1", "html-entities": "~1.2.0", "htmlparser2": "~3.9.0", - "lodash": "~4.15.0", - "qs": "~4.0.0", - "react-native-lightbox": "shoutem/react-native-lightbox#4e58b9b1aca166142d69b161ff511efc3358ff9f", - "react-native-linear-gradient": "~2.0.0", + "lodash": "^4.17.4", + "prop-types": "^15.5.10", + "qs": "^6.5.1", + "react-native-lightbox": "0.7.0", + "react-native-linear-gradient": "^2.3.0", + "react-native-navigation-experimental-compat": "1.1.0", + "react-native-photo-view": "^1.4.0", "react-native-share": "~1.0.19", - "react-native-transformable-image": "shoutem/react-native-transformable-image#7d15395ec3857571711a12bc08f24f3a96ff1cde", - "react-native-vector-icons": "~4.0.0", - "react-native-photo-view": "~1.2.0", - "react-native-navigation-experimental-compat": "1.0.0", + "react-native-transformable-image": "applications-developer/react-native-transformable-image", + "react-native-vector-icons": "^4.4.0", "stream": "0.0.2", - "tinycolor2": "~1.3.0" + "tinycolor2": "^1.4.1" }, "peerDependencies": { "react": "^15.0.0", @@ -28,14 +29,14 @@ }, "devDependencies": { "babel": "^6.3.26", - "babel-preset-react-native": "^1.9.0", - "chai": "^3.4.1", + "babel-preset-react-native": "^4.0.0", + "chai": "^4.1.2", "deep-freeze": "0.0.1", "enzyme": "^2.0.0-rc1", - "mocha": "^2.3.4", + "mocha": "^3.5.3", "react-addons-test-utils": "^15.3.1", "react-dom": "^15.3.1", - "react-native-mock": "^0.2.5" + "react-native-mock": "^0.3.1" }, "scripts": { "test": "mocha -R spec --require test-utils/setup.js --require react-native-mock/mock.js --compilers js:babel-core/register $(find . -name '*.spec.js' ! -ipath '*node_modules*')" diff --git a/theme.js b/theme.js index aafcb9b8..f171a1e0 100644 --- a/theme.js +++ b/theme.js @@ -338,30 +338,30 @@ export default (variables = defaultThemeVariables) => ({ 'shoutem.ui.Heading': { [INCLUDE]: ['text'], - ...variables.heading, lineHeight: 30, + ...variables.heading, }, 'shoutem.ui.Title': { [INCLUDE]: ['text'], - ...variables.title, lineHeight: 25, + ...variables.title, }, 'shoutem.ui.Subtitle': { [INCLUDE]: ['text'], - ...variables.subtitle, lineHeight: 18, + ...variables.subtitle, }, 'shoutem.ui.Caption': { [INCLUDE]: ['text'], - ...variables.caption, lineHeight: 16, letterSpacing: 0.5, + ...variables.caption, }, 'shoutem.ui.Text': {