<commit_before>import {Dropdown} from 'reactjs-components';
import React from 'react';

import Icon from './Icon';

const getMenuItems = (children, iconID) => {
  return [
    {
      className: 'hidden',
      html: <Icon id={iconID} color="light-grey" size="mini" />,
      id: 'trigger'
    },
    ...React.Children.map(children, getDropdownItemFromComponent)
  ];
};

const handleItemSelection = (item) => {
  if (item.onItemSelect) {
    item.onItemSelect();
  }
};

const getDropdownItemFromComponent = (child, index) => {
  return {
    onItemSelect: child.props.onItemSelect,
    html: child,
    id: index
  };
};

const PageHeaderActionsMenu = ({anchorRight, children, iconID}) => {
  return (
    <Dropdown
      anchorRight={anchorRight}
      buttonClassName="button button-link button-narrow"
      items={getMenuItems(children, iconID)}
      onItemSelection={handleItemSelection}
      persistentID="trigger"
      transition={true}
      dropdownMenuClassName="dropdown-menu"
      dropdownMenuListClassName="dropdown-menu-list"
      wrapperClassName="dropdown" />
  );
};

PageHeaderActionsMenu.defaultProps = {
  anchorRight: true,
  iconID: 'ellipsis-vertical'
};

PageHeaderActionsMenu.propTypes = {
  // anchorRight gets passed to Dropdown. It's truthy here unlike in the Dropdown.
  anchorRight: React.PropTypes.bool,
  children: React.PropTypes.arrayOf(
    React.PropTypes.shape({
      props: React.PropTypes.shape({
        onItemSelect: React.PropTypes.func
      })
    })
  ),
  iconID: React.PropTypes.string
};

module.exports = PageHeaderActionsMenu;
<commit_msg>Removed light grey styling from page header options dropdown icon<commit_after>import {Dropdown} from 'reactjs-components';
import React from 'react';

import Icon from './Icon';

const getMenuItems = (children, iconID) => {
  return [
    {
      className: 'hidden',
      html: <Icon id={iconID} size="mini" />,
      id: 'trigger'
    },
    ...React.Children.map(children, getDropdownItemFromComponent)
  ];
};

const handleItemSelection = (item) => {
  if (item.onItemSelect) {
    item.onItemSelect();
  }
};

const getDropdownItemFromComponent = (child, index) => {
  return {
    onItemSelect: child.props.onItemSelect,
    html: child,
    id: index
  };
};

const PageHeaderActionsMenu = ({anchorRight, children, iconID}) => {
  return (
    <Dropdown
      anchorRight={anchorRight}
      buttonClassName="button button-link button-narrow"
      items={getMenuItems(children, iconID)}
      onItemSelection={handleItemSelection}
      persistentID="trigger"
      transition={true}
      dropdownMenuClassName="dropdown-menu"
      dropdownMenuListClassName="dropdown-menu-list"
      wrapperClassName="dropdown" />
  );
};

PageHeaderActionsMenu.defaultProps = {
  anchorRight: true,
  iconID: 'ellipsis-vertical'
};

PageHeaderActionsMenu.propTypes = {
  // anchorRight gets passed to Dropdown. It's truthy here unlike in the Dropdown.
  anchorRight: React.PropTypes.bool,
  children: React.PropTypes.arrayOf(
    React.PropTypes.shape({
      props: React.PropTypes.shape({
        onItemSelect: React.PropTypes.func
      })
    })
  ),
  iconID: React.PropTypes.string
};

module.exports = PageHeaderActionsMenu;

{'fraction_non_alphanumeric': 0.12519367833901457, 'fraction_numerical': 0.0, 'mean_word_length': 3.6379310344827585, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '1679135', 'n_tokens_mistral': 984, 'n_tokens_neox': 980, 'n_words': 198}