AllenYuan

homepage - home - mainview

Apr 22nd, 2020
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // list of articles
  2. import ArticleList from '../ArticleList';
  3.  
  4. import React from 'react';
  5. import { connect } from 'react-redux';
  6.  
  7. // extract articles from state
  8. const mapStateToProps = state => ({
  9.   articles: state.articles
  10. });
  11.  
  12. const MainView = props => {
  13.   return (
  14.     // render a tab saying 'Global Feed'
  15.     <div className="col-md-9">
  16.       <div className="feed-toggle">
  17.         <ul className="nav nav-pills outline-active">
  18.           <li className="nav-item">
  19.             <a
  20.               href=""
  21.               className="nav-link active">
  22.               Global Feed
  23.             </a>
  24.           </li>
  25.         </ul>
  26.       </div>
  27.       {/* render list of articles */}
  28.       <ArticleList
  29.         articles={props.articles}
  30.       />
  31.     </div>
  32.   );
  33. };
  34.  
  35. export default connect(mapStateToProps, () => ({}))(MainView);
Advertisement
Add Comment
Please, Sign In to add comment