Skip to content

Commit 9e3064d

Browse files
CRNS-49 and CRNS-50: Adding proptypes for some missed components
1 parent 207366e commit 9e3064d

File tree

7 files changed

+46
-0
lines changed

7 files changed

+46
-0
lines changed

src/components/CommandsItem.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Text } from 'react-native';
33
import styled from '@stream-io/styled-components';
4+
import PropTypes from 'prop-types';
45

56
const Container = styled.View`
67
flex-direction: column;
@@ -20,6 +21,12 @@ const Title = styled.Text`
2021
`;
2122

2223
export class CommandsItem extends React.Component {
24+
static propTypes = {
25+
name: PropTypes.string,
26+
args: PropTypes.string,
27+
description: PropTypes.string,
28+
};
29+
2330
render() {
2431
const {
2532
item: { name, args, description },

src/components/DateSeparator.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import styled from '@stream-io/styled-components';
33
import Moment from 'moment';
44
import { themed } from '../styles/theme';
5+
import PropTypes from 'prop-types';
56

67
const Container = styled.View`
78
display: flex;
@@ -45,6 +46,11 @@ const Date = styled.Text`
4546

4647
export const DateSeparator = themed(
4748
class DateSeparator extends React.PureComponent {
49+
static propTypes = {
50+
message: PropTypes.object.isRequired,
51+
formatDate: PropTypes.func,
52+
};
53+
4854
static themePath = 'messageList.dateSeparator';
4955

5056
render() {

src/components/EventIndicator.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import styled from '@stream-io/styled-components';
33
import Moment from 'moment';
44
import { Avatar } from './Avatar';
5+
import PropTypes from 'prop-types';
56

67
const Date = styled.Text`
78
font-size: 10;
@@ -58,4 +59,8 @@ const EventIndicator = ({ event }) => {
5859
return null;
5960
};
6061

62+
EventIndicator.propTypes = {
63+
event: PropTypes.object,
64+
};
65+
6166
export { EventIndicator };

src/components/IconSquare.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { View, TouchableOpacity, Image } from 'react-native';
3+
import PropTypes from 'prop-types';
34

45
export const IconSquare = ({ icon, onPress }) => {
56
if (onPress)
@@ -28,3 +29,8 @@ export const IconSquare = ({ icon, onPress }) => {
2829
</View>
2930
);
3031
};
32+
33+
IconSquare.propTypes = {
34+
icon: PropTypes.string,
35+
onPress: PropTypes.func,
36+
};

src/components/LoadingErrorIndicator.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { Text } from 'react-native';
3+
import PropTypes from 'prop-types';
34

45
export const LoadingErrorIndicator = ({ listType }) => {
56
let Loader;
@@ -17,3 +18,7 @@ export const LoadingErrorIndicator = ({ listType }) => {
1718

1819
return Loader;
1920
};
21+
22+
LoadingErrorIndicator.propTypes = {
23+
listType: PropTypes.oneOf(['channel', 'message', 'default']),
24+
};

src/components/MentionsItem.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { Avatar } from './Avatar';
3+
import PropTypes from 'prop-types';
34

45
import styled from '@stream-io/styled-components';
56
import { themed } from '../styles/theme';
@@ -34,3 +35,9 @@ export const MentionsItem = themed(
3435
}
3536
},
3637
);
38+
39+
MentionsItem.propTypes = {
40+
name: PropTypes.string,
41+
icon: PropTypes.string,
42+
id: PropTypes.string,
43+
};

src/components/SuggestionsProvider.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { View, FlatList, findNodeHandle } from 'react-native';
44
import { SuggestionsContext } from '../context';
55

66
import styled from '@stream-io/styled-components';
7+
import PropTypes from 'prop-types';
78

89
const Wrapper = styled.TouchableOpacity`
910
position: absolute;
@@ -164,6 +165,15 @@ class SuggestionsView extends React.PureComponent {
164165
super(props);
165166
}
166167

168+
static propTypes = {
169+
active: PropTypes.bool,
170+
marginLeft: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
171+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
172+
suggestions: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
173+
backdropHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
174+
handleDismiss: PropTypes.func,
175+
suggestionsTitle: PropTypes.string,
176+
};
167177
renderHeader = () => <SuggestionsHeader />;
168178
renderItem = ({ item }) => {
169179
const {

0 commit comments

Comments
 (0)