From fb0d77e30d13788e18ed188a1f17f009172bf297 Mon Sep 17 00:00:00 2001 From: JM Myers Date: Thu, 26 Oct 2017 20:04:28 -0400 Subject: [PATCH] Force update - Merge branch with latest changes from new-design --- src/app/Sidebar/RightSidebar.js | 73 ++++++++------------------------- 1 file changed, 17 insertions(+), 56 deletions(-) diff --git a/src/app/Sidebar/RightSidebar.js b/src/app/Sidebar/RightSidebar.js index 344727fca7..0221a10862 100644 --- a/src/app/Sidebar/RightSidebar.js +++ b/src/app/Sidebar/RightSidebar.js @@ -2,7 +2,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Route, Switch } from 'react-router-dom'; -import people from '../../helpers/people'; import { getIsAuthenticated, getAuthenticatedUser, @@ -10,15 +9,13 @@ import { getRecommendations, } from '../../reducers'; import { updateRecommendations } from '../../user/userActions'; -import { - getFollowingList, -} from '../../reducers'; import InterestingPeople from '../../components/Sidebar/InterestingPeople'; import InterestingPeopleWithAPI from '../../components/Sidebar/InterestingPeopleWithAPI'; -import PostRecommendation from '../../components/Sidebar/PostRecommendation'; import StartNow from '../../components/Sidebar/StartNow'; import SignUp from '../../components/Sidebar/SignUp'; +import PostRecommendation from '../../components/Sidebar/PostRecommendation'; +@connect( state => ({ authenticated: getIsAuthenticated(state), authenticatedUser: getAuthenticatedUser(state), @@ -29,18 +26,11 @@ import SignUp from '../../components/Sidebar/SignUp'; updateRecommendations, }, ) -@connect(state => ({ - authenticated: getIsAuthenticated(state), - authenticatedUser: getAuthenticatedUser(state), - authFetching: getIsAuthFetching(state), - followingList: getFollowingList(state), export default class RightSidebar extends React.Component { static propTypes = { authenticated: PropTypes.bool.isRequired, authenticatedUser: PropTypes.shape().isRequired, isAuthFetching: PropTypes.bool.isRequired, - authFetching: PropTypes.bool.isRequired, - followingList: PropTypes.arrayOf(PropTypes.string).isRequired, showPostRecommendation: PropTypes.bool, recommendations: PropTypes.arrayOf(PropTypes.shape({ name: PropTypes.string })).isRequired, updateRecommendations: PropTypes.func, @@ -49,70 +39,41 @@ export default class RightSidebar extends React.Component { static defaultProps = { showPostRecommendation: false, updateRecommendations: () => {}, + }; handleInterestingPeopleRefresh = () => this.props.updateRecommendations(); -======= - constructor(props) { - super(props); - this.state = { - randomPeople: this.getRandomPeople(), - }; - } - - getRandomPeople = () => - people - .reduce((res, item) => { - if (!this.props.followingList.includes(item)) { - res.push({ name: item }); - } - return res; - }, []) - .sort(() => 0.5 - Math.random()) - .slice(0, 5); - - handleRefreshInterestingPeople = () => - this.setState({ - randomPeople: this.getRandomPeople(), - }); render() { - const { authenticated, authenticatedUser, authFetching, showPostRecommendation } = this.props; + const { authenticated, authenticatedUser, showPostRecommendation, isAuthFetching } = this.props; + return (
{!authenticated && } + authenticated && + } + /> + (
{authenticatedUser.last_root_post === '1970-01-01T00:00:00' && } -<<<<<<< 3aa813af336a1228402490e4ca53a76fb88b6ca9 - -======= {authenticated && } ->>>>>>> Hide Interesting People for unauthenticated users
)} /> - - authenticated && - } - />
- {showPostRecommendation && } + {showPostRecommendation && }
); }