Skip to content

Commit

Permalink
chore: use prop-types package from npm
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed May 16, 2017
1 parent 9ab96ad commit 6a81813
Show file tree
Hide file tree
Showing 30 changed files with 61 additions and 31 deletions.
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"color": "^0.11.4",
"escape-string-regexp": "^1.0.5",
"expo": "~16.0.0",
"prop-types": "^15.5.10",
"react": "16.0.0-alpha.6",
"react-native": "git+https://github.com/expo/react-native.git#sdk-16.0.0",
"react-native-drawer": "^2.3.0",
Expand Down
5 changes: 3 additions & 2 deletions example/rn-cli.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ module.exports = {
];
},
getBlacklistRE() {
/* eslint-disable prettier/prettier */
return blacklist([
new RegExp(
`^${escape(path.resolve(__dirname, '..', 'node_modules'))}\\/.*$`, // eslint-disable-line prettier/prettier
`^${escape(path.resolve(__dirname, '..', 'node_modules'))}\\/.*$`,
),
new RegExp(
`^${escape(path.resolve(__dirname, '..', 'docs', 'node_modules'))}\\/.*$`, // eslint-disable-line prettier/prettier
`^${escape(path.resolve(__dirname, '..', 'docs', 'node_modules'))}\\/.*$`,
),
]);
},
Expand Down
3 changes: 2 additions & 1 deletion example/src/ExampleList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ListView, Text, StyleSheet } from 'react-native';
import { Colors, TouchableRipple, Divider } from 'react-native-paper';
import ButtonExample from './ButtonExample';
Expand Down
7 changes: 4 additions & 3 deletions example/src/RootNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React from 'react';
import { Platform } from 'react-native';
import { Constants } from 'expo';
import Expo from 'expo';
import { StackNavigator } from 'react-navigation';
import { Colors } from 'react-native-paper';
import ExampleList, { examples } from './ExampleList';
Expand Down Expand Up @@ -33,8 +33,9 @@ export default StackNavigator(
headerTintColor: Colors.white,
headerStyle: {
backgroundColor: Colors.indigo500,
paddingTop: Constants.statusBarHeight,
height: (Platform.OS === 'ios' ? 44 : 56) + Constants.statusBarHeight,
paddingTop: Expo.Constants.statusBarHeight,
height: (Platform.OS === 'ios' ? 44 : 56) +
Expo.Constants.statusBarHeight,
},
},
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"dependencies": {
"color": "^0.11.4",
"prop-types": "^15.5.10",
"react-native-drawer": "^2.3.0"
},
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* @flow */

import color from 'color';
import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { ActivityIndicator, Animated, View, StyleSheet } from 'react-native';
import Icon from './Icon';
import Paper from './Paper';
Expand Down
3 changes: 2 additions & 1 deletion src/components/Card/Card.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { Component, Children, PropTypes } from 'react';
import React, { Component, Children } from 'react';
import PropTypes from 'prop-types';
import {
Animated,
View,
Expand Down
3 changes: 2 additions & 1 deletion src/components/Card/CardActions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PropTypes, Children } from 'react';
import React, { Children } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, View } from 'react-native';

type Props = {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Card/CardContent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, View } from 'react-native';

type Props = {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Card/CardCover.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, View, Image } from 'react-native';
import withTheme from '../../core/withTheme';
import { grey200 } from '../../styles/colors';
Expand Down
3 changes: 2 additions & 1 deletion src/components/Checkbox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Animated, Platform, View, StyleSheet } from 'react-native';
import color from 'color';
import Icon from './Icon';
Expand Down
3 changes: 2 additions & 1 deletion src/components/Divider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, View } from 'react-native';

type Props = {
Expand Down
5 changes: 3 additions & 2 deletions src/components/Drawer/Drawer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* @flow */

import RNDrawer from 'react-native-drawer';
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet } from 'react-native';
import RNDrawer from 'react-native-drawer';
import DrawerItem from './DrawerItem';
import DrawerSection from './DrawerSection';
import { white } from '../../styles/colors';
Expand Down
3 changes: 2 additions & 1 deletion src/components/Drawer/DrawerItem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* @flow */

import color from 'color';
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { View, Text, StyleSheet } from 'react-native';
import Icon from '.././Icon';
import TouchableRipple from '../TouchableRipple';
Expand Down
3 changes: 2 additions & 1 deletion src/components/Drawer/DrawerSection.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* @flow */

import color from 'color';
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { View, Text } from 'react-native';
import Divider from '../Divider';
import withTheme from '../../core/withTheme';
Expand Down
3 changes: 2 additions & 1 deletion src/components/GridView.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Dimensions, ListView, StyleSheet, View } from 'react-native';
import { grey200 } from '../styles/colors';

Expand Down
1 change: 1 addition & 0 deletions src/components/Icon.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* @flow */

// eslint-disable-next-line import/named
export { MaterialIcons as default } from 'react-native-vector-icons';
3 changes: 2 additions & 1 deletion src/components/Paper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, View } from 'react-native';
import * as Colors from '../styles/colors';
import shadow from '../styles/shadow';
Expand Down
3 changes: 2 additions & 1 deletion src/components/Portal/Portal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import { PureComponent, PropTypes } from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { manager } from './PortalHost';

export type PortalProps = {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Portal/PortalHost.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet } from 'react-native';
import type { PortalProps } from './Portal';

Expand Down
3 changes: 2 additions & 1 deletion src/components/Portal/ThemedPortal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { Component, Children, PropTypes } from 'react';
import React, { Component, Children } from 'react';
import PropTypes from 'prop-types';
import Portal from './Portal';
import ThemeProvider from '../../core/ThemeProvider';
import withTheme from '../../core/withTheme';
Expand Down
3 changes: 2 additions & 1 deletion src/components/RadioButton.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PropTypes, Component } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Animated, View, Platform, StyleSheet } from 'react-native';
import color from 'color';
import TouchableRipple from './TouchableRipple';
Expand Down
3 changes: 2 additions & 1 deletion src/components/SearchBar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, TextInput } from 'react-native';
import color from 'color';

Expand Down
3 changes: 2 additions & 1 deletion src/components/TouchableRipple/TouchableRipple.android.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { TouchableNativeFeedback, View, Platform } from 'react-native';

type Props = {
Expand Down
3 changes: 2 additions & 1 deletion src/components/TouchableRipple/TouchableRipple.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { TouchableHighlight, View } from 'react-native';
import color from 'color';

Expand Down
3 changes: 2 additions & 1 deletion src/components/Typography/StyledText.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* @flow */

import color from 'color';
import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Text from './Text';
import withTheme from '../../core/withTheme';
import type { Theme } from '../../types/Theme';
Expand Down
3 changes: 2 additions & 1 deletion src/components/Typography/Text.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Text as NativeText } from 'react-native';
import withTheme from '../../core/withTheme';
import type { Theme } from '../../types/Theme';
Expand Down
3 changes: 2 additions & 1 deletion src/core/Provider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PureComponent, PropTypes, Children } from 'react';
import React, { PureComponent, Children } from 'react';
import PropTypes from 'prop-types';
import ThemeProvider from './ThemeProvider';
import PortalHost from '../components/Portal/PortalHost';
import type { Theme } from '../types/Theme';
Expand Down
3 changes: 2 additions & 1 deletion src/core/ThemeProvider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import { PureComponent, PropTypes, Children } from 'react';
import { PureComponent, Children } from 'react';
import PropTypes from 'prop-types';
import DefaultTheme from '../styles/DefaultTheme';
import type { Theme } from '../types/Theme';

Expand Down
3 changes: 2 additions & 1 deletion src/core/withTheme.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React, { PureComponent, PropTypes } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { theme } from './ThemeProvider';
import type { Theme } from '../types/Theme';

Expand Down

0 comments on commit 6a81813

Please sign in to comment.