index.js 759 Bytes
Newer Older
duanledexianxianxian's avatar
init  
duanledexianxianxian committed
1 2 3 4
import React from 'react';
import { SearchBar } from 'antd-mobile';
import Item from './item';

duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
5
import styles from './index.less';
duanledexianxianxian's avatar
init  
duanledexianxianxian committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

const Index = ({ dataSource=[], buttonLable, onClickLike, onClickShare, onClickButton,showCnt }) => {
  const renderItem = () => {
    return dataSource.map(x => (
      <Item
        {...x}
        showCnt={showCnt}
        buttonLable={buttonLable}
        onClickLike={onClickLike}
        onClickShare={onClickShare}
        onClickButton={onClickButton}
      />
    ));
  };
  return (
    <div className={styles.root}>
      <div className="search">
        <SearchBar placeholder="Search" maxLength={8} />
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
24
        <div className={styles.list}>{renderItem()}</div>
duanledexianxianxian's avatar
init  
duanledexianxianxian committed
25 26 27 28 29 30
      </div>
    </div>
  );
};

export default Index;