Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions components/DropDownMenu/DropDownModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
LayoutAnimation,
Dimensions,
} from 'react-native';
import PropTypes from 'prop-types';
import _ from 'lodash';

import { Button } from '../Button';
Expand All @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion components/GridRow.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -35,7 +36,7 @@ class GridRow extends React.Component {
}

GridRow.propTypes = {
columns: React.PropTypes.number.isRequired,
columns: PropTypes.number.isRequired,
...RNView.propTypes,
};

Expand Down
2 changes: 1 addition & 1 deletion components/HorizontalPager/HorizontalPager.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {
Component,
PropTypes,
} from 'react';
import PropTypes from 'prop-types';

import {
ScrollView,
Expand Down
9 changes: 5 additions & 4 deletions components/HorizontalPager/Page.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import { View } from '../../index';

Expand All @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion components/ImageGallery/ImageGalleryBase.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import _ from 'lodash';

Expand Down
7 changes: 4 additions & 3 deletions components/ImageGalleryOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion components/ImagePreview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {
PropTypes,
Component,
} from 'react';
import {
Expand All @@ -8,6 +7,7 @@ import {
Image,
TouchableOpacity,
} from 'react-native';
import PropTypes from 'prop-types';

import Icon from 'react-native-vector-icons/MaterialIcons';

Expand Down
7 changes: 4 additions & 3 deletions components/InlineGallery.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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,
Expand Down
25 changes: 13 additions & 12 deletions components/ListView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
View,
ListView as RNListView,
Expand Down Expand Up @@ -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
};

Expand Down
11 changes: 6 additions & 5 deletions components/NavigationBar/NavigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Platform,
View,
} from 'react-native';
import PropTypes from 'prop-types';

import _ from 'lodash';

Expand Down Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion components/PageIndicators.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {
Component,
PropTypes,
} from 'react';
import PropTypes from 'prop-types';

import { connectStyle } from '@shoutem/theme';
import { View } from './View';
Expand Down
3 changes: 2 additions & 1 deletion components/RichMedia.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Html } from '../html';

export default function RichMedia({ body }) {
Expand All @@ -7,5 +8,5 @@ export default function RichMedia({ body }) {
}

RichMedia.propTypes = {
body: React.PropTypes.string.isRequired,
body: PropTypes.string.isRequired,
};
5 changes: 3 additions & 2 deletions components/ScrollView/ScrollDriverProvider.js
Original file line number Diff line number Diff line change
@@ -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';
/**
Expand All @@ -9,7 +10,7 @@ import * as _ from 'lodash';
*/
export class ScrollDriverProvider extends Component {
static childContextTypes = {
driverProvider: React.PropTypes.object,
driverProvider: PropTypes.object,
animationDriver: DriverShape,
};

Expand All @@ -18,7 +19,7 @@ export class ScrollDriverProvider extends Component {
};

static propTypes = {
children: React.PropTypes.node,
children: PropTypes.node,
driver: DriverShape,
};

Expand Down
3 changes: 2 additions & 1 deletion components/ScrollView/ScrollView.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -14,7 +15,7 @@ class ScrollView extends Component {

static contextTypes = {
animationDriver: DriverShape,
driverProvider: React.PropTypes.object,
driverProvider: PropTypes.object,
};

static childContextTypes = {
Expand Down
3 changes: 2 additions & 1 deletion components/ShareButton.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {
Component,
} from 'react';
import PropTypes from 'prop-types';

import { Alert } from 'react-native';

Expand All @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion components/Spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {
ActivityIndicator,
} from 'react-native';
import PropTypes from 'prop-types';

import { connectStyle } from '@shoutem/theme';

Expand All @@ -24,7 +25,7 @@ class Spinner extends React.Component {
}

Spinner.propTypes = {
style: React.PropTypes.object,
style: PropTypes.object,
};

const StyledSpinner = connectStyle('shoutem.ui.Spinner', {
Expand Down
3 changes: 2 additions & 1 deletion components/Switch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {
Component,
} from 'react';
import PropTypes from 'prop-types';

import { TouchableWithoutFeedback } from 'react-native';

Expand All @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion components/TextInput.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -28,7 +29,7 @@ class TextInput extends Component {

TextInput.propTypes = {
...RNTextInput.propTypes,
style: React.PropTypes.object,
style: PropTypes.object,
};

const AnimatedTextInput = connectAnimation(TextInput);
Expand Down
3 changes: 2 additions & 1 deletion components/Touchable.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 2 additions & 1 deletion components/TouchableNativeFeedback.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
5 changes: 2 additions & 3 deletions components/Video/Video.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {
PropTypes,
} from 'react';
import React from 'react';
import PropTypes from 'prop-types';

import {
View,
Expand Down
3 changes: 2 additions & 1 deletion components/View.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -35,7 +36,7 @@ class View extends Component {

View.propTypes = {
...RNView.propTypes,
style: React.PropTypes.object,
style: PropTypes.object,
};

const AnimatedView = connectAnimation(View);
Expand Down
Loading