This commit is contained in:
Guilherme Gazzo 2018-02-14 19:26:15 -02:00
parent 6a1d9a3c7d
commit 40cb3e536b
No known key found for this signature in database
GPG Key ID: 1F85C9AD922D0829
6 changed files with 1548 additions and 730 deletions

View File

@ -33,10 +33,12 @@ exports[`render channel 1`] = `
style={ style={
Array [ Array [
Object { Object {
"alignItems": "center", "alignItems": "flex-start",
"borderBottomColor": "#ddd",
"borderBottomWidth": 0.5,
"flexDirection": "row", "flexDirection": "row",
"paddingHorizontal": 16, "paddingHorizontal": 16,
"paddingVertical": 10, "paddingVertical": 12,
}, },
undefined, undefined,
] ]
@ -53,8 +55,8 @@ exports[`render channel 1`] = `
Object { Object {
"backgroundColor": "#00BCD4", "backgroundColor": "#00BCD4",
"borderRadius": 4, "borderRadius": 4,
"height": 40, "height": 56,
"width": 40, "width": 56,
}, },
undefined, undefined,
] ]
@ -75,7 +77,7 @@ exports[`render channel 1`] = `
"color": "#ffffff", "color": "#ffffff",
}, },
Object { Object {
"fontSize": 20, "fontSize": 28,
}, },
], ],
Object { Object {
@ -93,44 +95,89 @@ exports[`render channel 1`] = `
style={ style={
Object { Object {
"flex": 1, "flex": 1,
"height": "100%",
"marginLeft": 16, "marginLeft": 16,
"marginRight": 4, "marginRight": 4,
} }
} }
> >
<Text <View
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"fontSize": 16,
},
undefined,
]
}
>
general
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={ style={
Object { Object {
"color": "#888", "alignItems": "center",
"flex": 1, "flex": 1,
"fontSize": 10, "flexDirection": "row",
"justifyContent": "center",
"width": "100%",
} }
} }
> >
Nov 10 <Text
</Text> accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"color": "#444",
"flex": 1,
"fontSize": 18,
"fontWeight": "bold",
"marginRight": 8,
}
}
>
general
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"alignItems": "center",
"color": "#888",
"fontSize": 10,
"justifyContent": "center",
}
}
>
Nov 10
</Text>
</View>
<View
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"width": "100%",
}
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"flexShrink": 1,
"fontSize": 16,
"marginRight": 8,
},
undefined,
]
}
>
</Text>
</View>
</View> </View>
</View> </View>
</View> </View>
@ -170,10 +217,12 @@ exports[`render no icon 1`] = `
style={ style={
Array [ Array [
Object { Object {
"alignItems": "center", "alignItems": "flex-start",
"borderBottomColor": "#ddd",
"borderBottomWidth": 0.5,
"flexDirection": "row", "flexDirection": "row",
"paddingHorizontal": 16, "paddingHorizontal": 16,
"paddingVertical": 10, "paddingVertical": 12,
}, },
undefined, undefined,
] ]
@ -190,8 +239,8 @@ exports[`render no icon 1`] = `
Object { Object {
"backgroundColor": "#3F51B5", "backgroundColor": "#3F51B5",
"borderRadius": 4, "borderRadius": 4,
"height": 40, "height": 56,
"width": 40, "width": 56,
}, },
undefined, undefined,
] ]
@ -212,7 +261,7 @@ exports[`render no icon 1`] = `
"color": "#ffffff", "color": "#ffffff",
}, },
Object { Object {
"fontSize": 20, "fontSize": 28,
}, },
], ],
Object { Object {
@ -230,44 +279,89 @@ exports[`render no icon 1`] = `
style={ style={
Object { Object {
"flex": 1, "flex": 1,
"height": "100%",
"marginLeft": 16, "marginLeft": 16,
"marginRight": 4, "marginRight": 4,
} }
} }
> >
<Text <View
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"fontSize": 16,
},
undefined,
]
}
>
name
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={ style={
Object { Object {
"color": "#888", "alignItems": "center",
"flex": 1, "flex": 1,
"fontSize": 10, "flexDirection": "row",
"justifyContent": "center",
"width": "100%",
} }
} }
> >
Nov 10 <Text
</Text> accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"color": "#444",
"flex": 1,
"fontSize": 18,
"fontWeight": "bold",
"marginRight": 8,
}
}
>
name
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"alignItems": "center",
"color": "#888",
"fontSize": 10,
"justifyContent": "center",
}
}
>
Nov 10
</Text>
</View>
<View
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"width": "100%",
}
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"flexShrink": 1,
"fontSize": 16,
"marginRight": 8,
},
undefined,
]
}
>
</Text>
</View>
</View> </View>
</View> </View>
</View> </View>
@ -307,10 +401,12 @@ exports[`render private group 1`] = `
style={ style={
Array [ Array [
Object { Object {
"alignItems": "center", "alignItems": "flex-start",
"borderBottomColor": "#ddd",
"borderBottomWidth": 0.5,
"flexDirection": "row", "flexDirection": "row",
"paddingHorizontal": 16, "paddingHorizontal": 16,
"paddingVertical": 10, "paddingVertical": 12,
}, },
undefined, undefined,
] ]
@ -327,8 +423,8 @@ exports[`render private group 1`] = `
Object { Object {
"backgroundColor": "#FF9800", "backgroundColor": "#FF9800",
"borderRadius": 4, "borderRadius": 4,
"height": 40, "height": 56,
"width": 40, "width": 56,
}, },
undefined, undefined,
] ]
@ -349,7 +445,7 @@ exports[`render private group 1`] = `
"color": "#ffffff", "color": "#ffffff",
}, },
Object { Object {
"fontSize": 20, "fontSize": 28,
}, },
], ],
Object { Object {
@ -367,44 +463,89 @@ exports[`render private group 1`] = `
style={ style={
Object { Object {
"flex": 1, "flex": 1,
"height": "100%",
"marginLeft": 16, "marginLeft": 16,
"marginRight": 4, "marginRight": 4,
} }
} }
> >
<Text <View
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"fontSize": 16,
},
undefined,
]
}
>
private-group
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={ style={
Object { Object {
"color": "#888", "alignItems": "center",
"flex": 1, "flex": 1,
"fontSize": 10, "flexDirection": "row",
"justifyContent": "center",
"width": "100%",
} }
} }
> >
Nov 10 <Text
</Text> accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"color": "#444",
"flex": 1,
"fontSize": 18,
"fontWeight": "bold",
"marginRight": 8,
}
}
>
private-group
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"alignItems": "center",
"color": "#888",
"fontSize": 10,
"justifyContent": "center",
}
}
>
Nov 10
</Text>
</View>
<View
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"width": "100%",
}
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"flexShrink": 1,
"fontSize": 16,
"marginRight": 8,
},
undefined,
]
}
>
</Text>
</View>
</View> </View>
</View> </View>
</View> </View>
@ -445,10 +586,12 @@ exports[`render unread +999 1`] = `
style={ style={
Array [ Array [
Object { Object {
"alignItems": "center", "alignItems": "flex-start",
"borderBottomColor": "#ddd",
"borderBottomWidth": 0.5,
"flexDirection": "row", "flexDirection": "row",
"paddingHorizontal": 16, "paddingHorizontal": 16,
"paddingVertical": 10, "paddingVertical": 12,
}, },
undefined, undefined,
] ]
@ -465,8 +608,8 @@ exports[`render unread +999 1`] = `
Object { Object {
"backgroundColor": "#3F51B5", "backgroundColor": "#3F51B5",
"borderRadius": 4, "borderRadius": 4,
"height": 40, "height": 56,
"width": 40, "width": 56,
}, },
undefined, undefined,
] ]
@ -482,7 +625,7 @@ exports[`render unread +999 1`] = `
"color": "#ffffff", "color": "#ffffff",
}, },
Object { Object {
"fontSize": 20, "fontSize": 28,
}, },
] ]
} }
@ -495,65 +638,112 @@ exports[`render unread +999 1`] = `
style={ style={
Object { Object {
"flex": 1, "flex": 1,
"height": "100%",
"marginLeft": 16, "marginLeft": 16,
"marginRight": 4, "marginRight": 4,
} }
} }
> >
<Text <View
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"fontSize": 16,
},
undefined,
]
}
>
name
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={ style={
Object { Object {
"color": "#888", "alignItems": "center",
"flex": 1, "flex": 1,
"fontSize": 10, "flexDirection": "row",
"justifyContent": "center",
"width": "100%",
} }
} }
> >
Nov 10 <Text
</Text> accessible={true}
</View> allowFontScaling={true}
<Text ellipsizeMode="tail"
accessible={true} numberOfLines={1}
allowFontScaling={true} style={
ellipsizeMode="tail" Object {
style={ "color": "#444",
Object { "flex": 1,
"backgroundColor": "#1d74f5", "fontSize": 18,
"borderRadius": 3, "fontWeight": "bold",
"color": "#fff", "marginRight": 8,
"fontSize": 14, }
"minWidth": 20, }
"overflow": "hidden", >
"paddingHorizontal": 5, name
"paddingVertical": 2, </Text>
"textAlign": "center", <Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"alignItems": "center",
"color": "#888",
"fontSize": 10,
"justifyContent": "center",
}
}
>
Nov 10
</Text>
</View>
<View
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"width": "100%",
}
} }
} >
> <Text
999+ accessible={true}
</Text> allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"flexShrink": 1,
"fontSize": 16,
"marginRight": 8,
},
undefined,
]
}
>
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
style={
Object {
"alignItems": "center",
"backgroundColor": "#1d74f5",
"borderRadius": 4,
"color": "#fff",
"fontSize": 14,
"justifyContent": "center",
"minWidth": 25,
"overflow": "hidden",
"paddingHorizontal": 5,
"paddingVertical": 4,
"textAlign": "center",
}
}
>
999+
</Text>
</View>
</View>
</View> </View>
</View> </View>
</View> </View>
@ -592,10 +782,12 @@ exports[`render unread 1`] = `
style={ style={
Array [ Array [
Object { Object {
"alignItems": "center", "alignItems": "flex-start",
"borderBottomColor": "#ddd",
"borderBottomWidth": 0.5,
"flexDirection": "row", "flexDirection": "row",
"paddingHorizontal": 16, "paddingHorizontal": 16,
"paddingVertical": 10, "paddingVertical": 12,
}, },
undefined, undefined,
] ]
@ -612,8 +804,8 @@ exports[`render unread 1`] = `
Object { Object {
"backgroundColor": "#3F51B5", "backgroundColor": "#3F51B5",
"borderRadius": 4, "borderRadius": 4,
"height": 40, "height": 56,
"width": 40, "width": 56,
}, },
undefined, undefined,
] ]
@ -629,7 +821,7 @@ exports[`render unread 1`] = `
"color": "#ffffff", "color": "#ffffff",
}, },
Object { Object {
"fontSize": 20, "fontSize": 28,
}, },
] ]
} }
@ -642,65 +834,112 @@ exports[`render unread 1`] = `
style={ style={
Object { Object {
"flex": 1, "flex": 1,
"height": "100%",
"marginLeft": 16, "marginLeft": 16,
"marginRight": 4, "marginRight": 4,
} }
} }
> >
<Text <View
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"fontSize": 16,
},
undefined,
]
}
>
name
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={ style={
Object { Object {
"color": "#888", "alignItems": "center",
"flex": 1, "flex": 1,
"fontSize": 10, "flexDirection": "row",
"justifyContent": "center",
"width": "100%",
} }
} }
> >
Nov 10 <Text
</Text> accessible={true}
</View> allowFontScaling={true}
<Text ellipsizeMode="tail"
accessible={true} numberOfLines={1}
allowFontScaling={true} style={
ellipsizeMode="tail" Object {
style={ "color": "#444",
Object { "flex": 1,
"backgroundColor": "#1d74f5", "fontSize": 18,
"borderRadius": 3, "fontWeight": "bold",
"color": "#fff", "marginRight": 8,
"fontSize": 14, }
"minWidth": 20, }
"overflow": "hidden", >
"paddingHorizontal": 5, name
"paddingVertical": 2, </Text>
"textAlign": "center", <Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"alignItems": "center",
"color": "#888",
"fontSize": 10,
"justifyContent": "center",
}
}
>
Nov 10
</Text>
</View>
<View
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"width": "100%",
}
} }
} >
> <Text
1 accessible={true}
</Text> allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"flexShrink": 1,
"fontSize": 16,
"marginRight": 8,
},
undefined,
]
}
>
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
style={
Object {
"alignItems": "center",
"backgroundColor": "#1d74f5",
"borderRadius": 4,
"color": "#fff",
"fontSize": 14,
"justifyContent": "center",
"minWidth": 25,
"overflow": "hidden",
"paddingHorizontal": 5,
"paddingVertical": 4,
"textAlign": "center",
}
}
>
1
</Text>
</View>
</View>
</View> </View>
</View> </View>
</View> </View>
@ -739,10 +978,12 @@ exports[`renders correctly 1`] = `
style={ style={
Array [ Array [
Object { Object {
"alignItems": "center", "alignItems": "flex-start",
"borderBottomColor": "#ddd",
"borderBottomWidth": 0.5,
"flexDirection": "row", "flexDirection": "row",
"paddingHorizontal": 16, "paddingHorizontal": 16,
"paddingVertical": 10, "paddingVertical": 12,
}, },
undefined, undefined,
] ]
@ -759,8 +1000,8 @@ exports[`renders correctly 1`] = `
Object { Object {
"backgroundColor": "#3F51B5", "backgroundColor": "#3F51B5",
"borderRadius": 4, "borderRadius": 4,
"height": 40, "height": 56,
"width": 40, "width": 56,
}, },
undefined, undefined,
] ]
@ -776,7 +1017,7 @@ exports[`renders correctly 1`] = `
"color": "#ffffff", "color": "#ffffff",
}, },
Object { Object {
"fontSize": 20, "fontSize": 28,
}, },
] ]
} }
@ -789,44 +1030,89 @@ exports[`renders correctly 1`] = `
style={ style={
Object { Object {
"flex": 1, "flex": 1,
"height": "100%",
"marginLeft": 16, "marginLeft": 16,
"marginRight": 4, "marginRight": 4,
} }
} }
> >
<Text <View
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"fontSize": 16,
},
undefined,
]
}
>
name
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={ style={
Object { Object {
"color": "#888", "alignItems": "center",
"flex": 1, "flex": 1,
"fontSize": 10, "flexDirection": "row",
"justifyContent": "center",
"width": "100%",
} }
} }
> >
Nov 10 <Text
</Text> accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"color": "#444",
"flex": 1,
"fontSize": 18,
"fontWeight": "bold",
"marginRight": 8,
}
}
>
name
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Object {
"alignItems": "center",
"color": "#888",
"fontSize": 10,
"justifyContent": "center",
}
}
>
Nov 10
</Text>
</View>
<View
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"width": "100%",
}
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "#444",
"flex": 1,
"flexShrink": 1,
"fontSize": 16,
"marginRight": 8,
},
undefined,
]
}
>
</Text>
</View>
</View> </View>
</View> </View>
</View> </View>

File diff suppressed because it is too large Load Diff

View File

@ -92,7 +92,7 @@ const RocketChat = {
reduxStore.dispatch(connectFailure()); reduxStore.dispatch(connectFailure());
}); });
// this.ddp.on('connected', () => this.ddp.subscribe('activeUsers', null, false)); this.ddp.on('connected', () => this.ddp.subscribe('activeUsers', null, false));
this.ddp.on('users', (ddpMessage) => { this.ddp.on('users', (ddpMessage) => {
if (ddpMessage.collection === 'users') { if (ddpMessage.collection === 'users') {
@ -128,9 +128,6 @@ const RocketChat = {
const sub = database.objects('subscriptions').filtered('rid == $0', data._id)[0]; const sub = database.objects('subscriptions').filtered('rid == $0', data._id)[0];
database.write(() => { database.write(() => {
sub.roomUpdatedAt = data._updatedAt; sub.roomUpdatedAt = data._updatedAt;
if (data.lastMessage) {
// data.lastMessage.url = data.lastMessage.url || [];
}
sub.lastMessage = data.lastMessage; sub.lastMessage = data.lastMessage;
sub.ro = data.ro; sub.ro = data.ro;
}); });
@ -432,9 +429,6 @@ const RocketChat = {
const room = rooms.find(({ _id }) => _id === subscription.rid); const room = rooms.find(({ _id }) => _id === subscription.rid);
if (room) { if (room) {
subscription.roomUpdatedAt = room._updatedAt; subscription.roomUpdatedAt = room._updatedAt;
// if (room.lastMessage) {
// room.lastMessage.url = room.lastMessage.url || [];
// }
subscription.lastMessage = room.lastMessage; subscription.lastMessage = room.lastMessage;
subscription.ro = room.ro; subscription.ro = room.ro;
} }

View File

@ -100,6 +100,7 @@ export default class RoomItem extends React.PureComponent {
static propTypes = { static propTypes = {
type: PropTypes.string.isRequired, type: PropTypes.string.isRequired,
name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
StoreLastMessage: PropTypes.bool,
_updatedAt: PropTypes.instanceOf(Date), _updatedAt: PropTypes.instanceOf(Date),
lastMessage: PropTypes.object, lastMessage: PropTypes.object,
favorite: PropTypes.bool, favorite: PropTypes.bool,
@ -115,6 +116,18 @@ export default class RoomItem extends React.PureComponent {
return <Avatar text={name} baseUrl={baseUrl} size={56} type={type} />; return <Avatar text={name} baseUrl={baseUrl} size={56} type={type} />;
} }
get lastMessage() {
const {
lastMessage
} = this.props;
if (!this.props.StoreLastMessage) {
return '';
}
return lastMessage ? `${ lastMessage.u.username }: ${ emojify(lastMessage.msg, { output: 'unicode' }) }` : 'No Message';
}
formatDate = date => moment(date).calendar(null, { formatDate = date => moment(date).calendar(null, {
lastDay: '[Yesterday]', lastDay: '[Yesterday]',
sameDay: 'h:mm A', sameDay: 'h:mm A',
@ -124,13 +137,11 @@ export default class RoomItem extends React.PureComponent {
render() { render() {
const { const {
favorite, alert, unread, userMentions, name, lastMessage, _updatedAt favorite, alert, unread, userMentions, name, _updatedAt
} = this.props; } = this.props;
const date = this.formatDate(_updatedAt); const date = this.formatDate(_updatedAt);
console.log('do we have a last message?', lastMessage);
let accessibilityLabel = name; let accessibilityLabel = name;
if (unread === 1) { if (unread === 1) {
accessibilityLabel += `, ${ unread } alert`; accessibilityLabel += `, ${ unread } alert`;
@ -154,11 +165,7 @@ export default class RoomItem extends React.PureComponent {
{_updatedAt ? <Text style={styles.update} ellipsizeMode='tail' numberOfLines={1}>{ date }</Text> : null} {_updatedAt ? <Text style={styles.update} ellipsizeMode='tail' numberOfLines={1}>{ date }</Text> : null}
</View> </View>
<View style={styles.row}> <View style={styles.row}>
<Text style={[styles.lastMessage, alert && styles.alert]} ellipsizeMode='tail' numberOfLines={1}>{this.lastMessage}</Text>
<Text style={[styles.lastMessage, alert && styles.alert]} ellipsizeMode='tail' numberOfLines={1}>{!this.props.StoreLastMessage ? '' : lastMessage ? `${ lastMessage.u.username }: ${ emojify(lastMessage.msg, { output: 'unicode' }) }` : 'No Message'}</Text>
{renderNumber(unread, userMentions)} {renderNumber(unread, userMentions)}
</View> </View>
</View> </View>

View File

@ -90,11 +90,11 @@ export default class RoomView extends React.Component {
this.rooms.addListener(this.updateRoom); this.rooms.addListener(this.updateRoom);
} }
componentWillReceiveProps(nextProps) { // componentWillReceiveProps(nextProps) {
if (this.props.layoutAnimation !== nextProps.layoutAnimation) { // // if (this.props.layoutAnimation !== nextProps.layoutAnimation) {
LayoutAnimation.spring(); // // LayoutAnimation.spring();
} // // }
} // }
shouldComponentUpdate(nextProps, nextState) { shouldComponentUpdate(nextProps, nextState) {
return !(equal(this.props, nextProps) && equal(this.state, nextState)); return !(equal(this.props, nextProps) && equal(this.state, nextState));
} }

View File

@ -3,7 +3,7 @@ import { ListView } from 'realm/react-native';
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Icon from 'react-native-vector-icons/Ionicons'; import Icon from 'react-native-vector-icons/Ionicons';
import { Platform, View, TextInput, SafeAreaView } from 'react-native'; import { Platform, View, TextInput, SafeAreaView, LayoutAnimation } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as actions from '../../actions'; import * as actions from '../../actions';
import * as server from '../../actions/connect'; import * as server from '../../actions/connect';
@ -69,7 +69,9 @@ export default class RoomsListView extends React.Component {
this.search(props.searchText); this.search(props.searchText);
} }
} }
componentWillUpdate() {
LayoutAnimation.easeInEaseOut();
}
componentWillUnmount() { componentWillUnmount() {
this.data.removeAllListeners(); this.data.removeAllListeners();
} }