Feature.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import React from "react";
  2. import {Link} from 'react-router-dom';
  3. import {FeatureWrapper, FeatureTitle} from '../style';
  4. import {Row, Col} from 'antd';
  5. import {getrand} from "../../../lib/public";
  6. const featureList = (props) => {
  7. const {featureList, ListImg} = props;
  8. const list = featureList.toJS();
  9. return (
  10. <Row className='top-feature-row' gutter={16}>
  11. {
  12. list.map((item, index) => {
  13. return (
  14. <Col className="top-feature-v2" key={index} xs={24} sm={24} md={8} lg={8} xl={8}>
  15. <div className='top-feature-item'>
  16. <Link to={'/article/' + item.id}>
  17. <div className='img-box'>
  18. <img src={item.thumbnail || ListImg[getrand(0, ListImg.length - 1)].img}
  19. alt=""/>
  20. </div>
  21. <div className='info'>
  22. <h3 className='ellipsis'>{item.title}</h3>
  23. <p className='ellipsis-two'>{item.summary}</p>
  24. </div>
  25. </Link>
  26. </div>
  27. </Col>
  28. )
  29. })
  30. }
  31. </Row>
  32. )
  33. };
  34. const Feature =(props)=> {
  35. return (
  36. <FeatureWrapper>
  37. <FeatureTitle>
  38. <h1><i className='iconfont icon-anchor'/><span> START:DASH!!</span></h1>
  39. </FeatureTitle>
  40. {featureList(props)}
  41. </FeatureWrapper>
  42. )
  43. };
  44. export default Feature;