diff --git a/app/lib/methods/getCustomEmojis.js b/app/lib/methods/getCustomEmojis.js index a82aae586..48fea4e4c 100644 --- a/app/lib/methods/getCustomEmojis.js +++ b/app/lib/methods/getCustomEmojis.js @@ -15,9 +15,6 @@ const getLastMessage = () => { export default async function() { try { - if (!this.ddp.status) { - return; - } const lastMessage = getLastMessage(); let emojis = await this.ddp.call('listEmojiCustom'); emojis = emojis.filter(emoji => !lastMessage || emoji._updatedAt > lastMessage); diff --git a/app/static/images/message_empty.png b/app/static/images/message_empty.png new file mode 100644 index 000000000..d07e5dcf3 Binary files /dev/null and b/app/static/images/message_empty.png differ diff --git a/app/views/RoomView/ListView.js b/app/views/RoomView/ListView.js index a4cf6c7f3..f55fa43f7 100644 --- a/app/views/RoomView/ListView.js +++ b/app/views/RoomView/ListView.js @@ -1,7 +1,6 @@ import { ListView as OldList } from 'realm/react-native'; import React from 'react'; -import cloneReferencedElement from 'react-clone-referenced-element'; -import { ScrollView, ListView as OldList2 } from 'react-native'; +import { ScrollView, ListView as OldList2, ImageBackground } from 'react-native'; import moment from 'moment'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; @@ -63,22 +62,24 @@ export class List extends React.Component { }, 1000); render() { - return ( item._id} - onEndReachedThreshold={100} - renderFooter={this.props.renderFooter} - renderHeader={() => } - onEndReached={() => this.props.onEndReached(this.data[this.data.length - 1])} - dataSource={this.dataSource} - renderRow={(item, previousItem) => this.props.renderRow(item, previousItem)} - initialListSize={1} - pageSize={20} - testID='room-view-messages' - {...scrollPersistTaps} - />); + return ( + item._id} + onEndReachedThreshold={100} + renderFooter={this.props.renderFooter} + renderHeader={() => } + onEndReached={() => this.props.onEndReached(this.data[this.data.length - 1])} + dataSource={this.dataSource} + renderRow={(item, previousItem) => this.props.renderRow(item, previousItem)} + initialListSize={1} + pageSize={20} + testID='room-view-messages' + {...scrollPersistTaps} + /> + ); } } @@ -170,16 +171,22 @@ export class ListView extends OldList2 { onKeyboardDidHide: undefined }); - return cloneReferencedElement( - , - { - ref: this._setScrollComponentRef, - onContentSizeChange: this._onContentSizeChange, - onLayout: this._onLayout - }, - header, - bodyComponents, - footer, + const image = data.length === 0 ? require('../../static/images/message_empty.png') : null; + return ( + [ + , + + {header} + {bodyComponents} + {footer} + + ] ); } } diff --git a/app/views/RoomView/index.js b/app/views/RoomView/index.js index 362d23bff..e824b9aa9 100644 --- a/app/views/RoomView/index.js +++ b/app/views/RoomView/index.js @@ -271,10 +271,10 @@ export default class RoomView extends LoggedView { }; renderHeader = () => { - if (this.state.end) { - return {I18n.t('Start_of_conversation')}; + if (!this.state.end) { + return {I18n.t('Loading_messages_ellipsis')}; } - return {I18n.t('Loading_messages_ellipsis')}; + return null; } renderList = () => { diff --git a/app/views/RoomView/styles.js b/app/views/RoomView/styles.js index 439f2fe99..ab37be0c4 100644 --- a/app/views/RoomView/styles.js +++ b/app/views/RoomView/styles.js @@ -47,5 +47,10 @@ export default StyleSheet.create({ }, loading: { flex: 1 + }, + imageBackground: { + width: '100%', + height: '100%', + position: 'absolute' } }); diff --git a/package.json b/package.json index 98e21fb4b..a3b7365f4 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "moment": "^2.22.2", "prop-types": "^15.6.2", "react": "^16.4.1", - "react-clone-referenced-element": "^1.0.1", "react-emojione": "^5.0.0", "react-native": "^0.56.0", "react-native-actionsheet": "^2.4.2",