diff --git a/app/views/ReadReceiptView/index.js b/app/views/ReadReceiptView/index.js index d407b342..f611cbc1 100644 --- a/app/views/ReadReceiptView/index.js +++ b/app/views/ReadReceiptView/index.js @@ -1,13 +1,12 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FlatList, Text, View } from 'react-native'; +import { FlatList, Text, View, RefreshControl } from 'react-native'; import { dequal } from 'dequal'; import moment from 'moment'; import { connect } from 'react-redux'; import * as List from '../../containers/List'; import Avatar from '../../containers/Avatar'; -import ActivityIndicator from '../../containers/ActivityIndicator'; import * as HeaderButton from '../../containers/HeaderButton'; import I18n from '../../i18n'; import RocketChat from '../../lib/rocketchat'; @@ -85,12 +84,16 @@ class ReadReceiptView extends React.Component { }; renderEmpty = () => { + const { loading } = this.state; const { theme } = this.props; + if (loading) { + return null; + } return ( - {I18n.t('No_Read_Receipts')} + {I18n.t('No_Read_Receipts')} ); }; @@ -107,9 +110,15 @@ class ReadReceiptView extends React.Component { {item?.user?.name} - {time} + {time} - {`@${item.user.username}`} + {`@${item.user.username}`} ); @@ -119,30 +128,25 @@ class ReadReceiptView extends React.Component { const { receipts, loading } = this.state; const { theme } = this.props; - if (!loading && receipts.length === 0) { - return this.renderEmpty(); - } - return ( - {loading ? ( - - ) : ( - item._id} - /> - )} + } + keyExtractor={item => item._id} + /> ); } diff --git a/app/views/ReadReceiptView/styles.js b/app/views/ReadReceiptView/styles.js index dbf31e6a..e6af153e 100644 --- a/app/views/ReadReceiptView/styles.js +++ b/app/views/ReadReceiptView/styles.js @@ -8,9 +8,14 @@ export default StyleSheet.create({ alignItems: 'center', justifyContent: 'center' }, + emptyText: { + fontSize: 16, + ...sharedStyles.textRegular + }, item: { flex: 1, flexDirection: 'row', + alignItems: 'center', justifyContent: 'space-between' }, separator: { @@ -20,6 +25,14 @@ export default StyleSheet.create({ ...sharedStyles.textRegular, fontSize: 17 }, + username: { + ...sharedStyles.textMedium, + fontSize: 14 + }, + time: { + ...sharedStyles.textRegular, + fontSize: 12 + }, infoContainer: { flex: 1, marginLeft: 10