Authored by 张丽霞

个人中心列表为空时样式展示

  1 +'use strict';
  2 +
  3 +import React, {Component} from 'react'
  4 +import {
  5 + StyleSheet,
  6 + View,
  7 + Text,
  8 +} from 'react-native';
  9 +
  10 +export default class EmptyListTip extends Component {
  11 +
  12 + static propTypes = {
  13 + text: React.PropTypes.string,
  14 + };
  15 +
  16 + static defaultProps = {
  17 + text: '你还没有发布过帖子',
  18 + };
  19 +
  20 + render() {
  21 + return (
  22 + <View style={styles.container}>
  23 + <Text style={styles.text}>{this.props.text}</Text>
  24 + </View>
  25 + );
  26 + }
  27 +}
  28 +
  29 +const styles = StyleSheet.create({
  30 + container: {
  31 + flexDirection: 'row',
  32 + justifyContent: 'center',
  33 + alignItems: 'center',
  34 + height: 200,
  35 + },
  36 + indicator: {
  37 +
  38 + },
  39 + text: {
  40 + marginLeft: 10,
  41 + textAlign: 'center',
  42 + color:'#b0b0b0',
  43 + fontSize: 17,
  44 + },
  45 +});
@@ -12,6 +12,7 @@ import SectionTabBar from '../section/SectionTabBar'; @@ -12,6 +12,7 @@ import SectionTabBar from '../section/SectionTabBar';
12 import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator'; 12 import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator';
13 import UserNavBar from './UserNavBar'; 13 import UserNavBar from './UserNavBar';
14 import TimerMixin from 'react-timer-mixin'; 14 import TimerMixin from 'react-timer-mixin';
  15 +import EmptyListTip from './EmptyListTip';
15 16
16 const { 17 const {
17 View, 18 View,
@@ -348,8 +349,7 @@ export default class User extends React.Component { @@ -348,8 +349,7 @@ export default class User extends React.Component {
348 }} 349 }}
349 renderFooter={() => { 350 renderFooter={() => {
350 if (endReached) { 351 if (endReached) {
351 - return <LoadMoreIndicator  
352 - isVisible={true} 352 + return <EmptyListTip
353 text={endReachedText} 353 text={endReachedText}
354 /> 354 />
355 } else { 355 } else {