<commit_before>import React from "react";
import { bindActionCreators } from "redux";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import injectSheet from "react-jss";

import { closeSidebar } from "../actions";
import { getTopLevelSections } from "../../sections/selectors";

const styles = {
  divider: {
    background: "#ddd",
    border: 0,
    height: "1px",
    margin: 0,
  },
  sidebarSectionLink: {
    borderRadius: "3px",
    color: "#000",
    display: "block",
    fontFamily: "Circular Std",
    fontSize: "15px",
    fontWeight: "500",
    margin: "8px 0",
    padding: "8px 0 8px 11px",
    textAlign: "left",
    width: "100%",
    "&:active": {
      color: "#000",
      textDecoration: "none",
    },
    "&:focus": {
      color: "#000",
      textDecoration: "none",
    },
    "&:hover": {
      background: "rgba(84, 153, 232, 0.26)",
      color: "#000",
      textDecoration: "none",
    },
  },
};

const SidebarContent = ({
  classes,
  session,
  topLevelSections,
  closeSidebar,
}) => {
  let sidebarElements = [];
  sidebarElements.push(
    <Link
      className={classes.sidebarSectionLink}
      key={-1}
      onClick={closeSidebar}
      to={"/"}
    >
      Home
    </Link>,
  );
  Object.values(topLevelSections).map(section => {
    if (section.name === "10/31 Terror Attack") {
      return;
    }
    sidebarElements.push(
      <Link
        className={classes.sidebarSectionLink}
        key={section.id}
        onClick={closeSidebar}
        to={section.permalink}
      >
        {section.name}
      </Link>,
    );
    /* We want a line separating the writing sections from the non-writing
     * sections and one separating the non-writing sections from the user
     * account options.
     */
    if (section.name === "Sports" /* || section.name === "Photo"*/) {
      sidebarElements.push(
        <hr className={classes.divider} key={section.id + 100} />,
      );
    }
  });
  if (session.userId) {
    sidebarElements.push(
      <Link
        className={classes.sidebarSectionLink}
        key={-2}
        onClick={closeSidebar}
        to="/myaccount/profile"
      >
        Profile
      </Link>,
    );
  } else {
    sidebarElements.push(
      <Link
        className={classes.sidebarSectionLink}
        key={-2}
        onClick={closeSidebar}
        to="/myaccount"
      >
        Log In
      </Link>,
    );
  }
  return <div>{sidebarElements}</div>;
};

const mapStateToProps = state => ({
  isSidebarOpen: state.core.isSidebarOpen,
  session: state.accounts.session,
  topLevelSections: getTopLevelSections(state),
});

const mapDispatchToProps = dispatch => {
  return bindActionCreators({ closeSidebar }, dispatch);
};

export default connect(mapStateToProps, mapDispatchToProps)(
  injectSheet(styles)(SidebarContent),
);
<commit_msg>rm unnecessary prop in sidebarcontent<commit_after>import React from "react";
import { bindActionCreators } from "redux";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import injectSheet from "react-jss";

import { closeSidebar } from "../actions";
import { getTopLevelSections } from "../../sections/selectors";

const styles = {
  divider: {
    background: "#ddd",
    border: 0,
    height: "1px",
    margin: 0,
  },
  sidebarSectionLink: {
    borderRadius: "3px",
    color: "#000",
    display: "block",
    fontFamily: "Circular Std",
    fontSize: "15px",
    fontWeight: "500",
    margin: "8px 0",
    padding: "8px 0 8px 11px",
    textAlign: "left",
    width: "100%",
    "&:active": {
      color: "#000",
      textDecoration: "none",
    },
    "&:focus": {
      color: "#000",
      textDecoration: "none",
    },
    "&:hover": {
      background: "rgba(84, 153, 232, 0.26)",
      color: "#000",
      textDecoration: "none",
    },
  },
};

const SidebarContent = ({
  classes,
  session,
  topLevelSections,
  closeSidebar,
}) => {
  let sidebarElements = [];
  sidebarElements.push(
    <Link
      className={classes.sidebarSectionLink}
      key={-1}
      onClick={closeSidebar}
      to={"/"}
    >
      Home
    </Link>,
  );
  Object.values(topLevelSections).map(section => {
    if (section.name === "10/31 Terror Attack") {
      return;
    }
    sidebarElements.push(
      <Link
        className={classes.sidebarSectionLink}
        key={section.id}
        onClick={closeSidebar}
        to={section.permalink}
      >
        {section.name}
      </Link>,
    );
    /* We want a line separating the writing sections from the non-writing
     * sections and one separating the non-writing sections from the user
     * account options.
     */
    if (section.name === "Sports" /* || section.name === "Photo"*/) {
      sidebarElements.push(
        <hr className={classes.divider} key={section.id + 100} />,
      );
    }
  });
  if (session.userId) {
    sidebarElements.push(
      <Link
        className={classes.sidebarSectionLink}
        key={-2}
        onClick={closeSidebar}
        to="/myaccount/profile"
      >
        Profile
      </Link>,
    );
  } else {
    sidebarElements.push(
      <Link
        className={classes.sidebarSectionLink}
        key={-2}
        onClick={closeSidebar}
        to="/myaccount"
      >
        Log In
      </Link>,
    );
  }
  return <div>{sidebarElements}</div>;
};

const mapStateToProps = state => ({
  session: state.accounts.session,
  topLevelSections: getTopLevelSections(state),
});

const mapDispatchToProps = dispatch => {
  return bindActionCreators({ closeSidebar }, dispatch);
};

export default connect(mapStateToProps, mapDispatchToProps)(
  injectSheet(styles)(SidebarContent),
);

{'fraction_non_alphanumeric': 0.15048458149779737, 'fraction_numerical': 0.018325991189427314, 'mean_word_length': 2.5630885122410545, 'pattern_counts': {'":': 6, '<': 25, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '407976', 'n_tokens_mistral': 1871, 'n_tokens_neox': 1789, 'n_words': 386}