<commit_before>import React from 'react'
import { connect } from 'react-redux'
import {
  Paper,
  Toolbar,
  ToolbarGroup,
  TextField,
  CircularProgress,
} from 'material-ui'
import { events } from '../redux/actions'

/**
 * Main Application Menu Component
 *
 * @param   {Object}      props     React props to be passed to the component
 * @return  {DOMNode}
 */
class AppMenu extends React.Component {

  static propTypes = {
    filter: React.PropTypes.func.isRequired,
    filterValue: React.PropTypes.string.isRequired,
    syncing: React.PropTypes.bool.isRequired,
  }

  static styles = {
    paper: {
      position: 'fixed',
      width: '100%',
    },

    toolbar: {
      height: '80px',
      paddingTop: '15px',
    }
  }

  onFilterChange(text) {
    this.props.filter(text)
  }

  render() {
    const progressStyle = {
      visibility: this.props.syncing ? 'visible' : 'hidden',
      marginRight: '70px',
    }

    return (
      <Paper
        rounded={false}
        style={AppMenu.styles.paper}
      >
        <Toolbar style={AppMenu.styles.toolbar}>
          <ToolbarGroup>
            <CircularProgress style={progressStyle}/>
            <TextField
              id="events-filter"
              name="events-filter"
              hintText="Filter events..."
              value={this.props.filterValue}
              onChange={event => this.onFilterChange(event.target.value)}
            />
          </ToolbarGroup>
        </Toolbar>
      </Paper>
    )
  }
}

/**
 * Map state to component props
 *
 * @private
 * @param     {Object}    state    Redux state
 * @return    {Object}
 */
function mapState(state) {
  return {
    filterValue: state.events.getIn(['meta', 'filter']),
    syncing: state.events.getIn(['meta', 'syncing']),
  }
}

const mapDispatch = {
  filter: events.filter
}

export default connect(mapState, mapDispatch)(AppMenu)<commit_msg>Switch to AppBar for the main bar<commit_after>import React from 'react'
import { connect } from 'react-redux'
import {
  AppBar,
  ToolbarGroup,
  TextField,
} from 'material-ui'
import { grey300 } from 'material-ui/styles/colors'
import theme from 'material-ui/styles/baseThemes/lightBaseTheme'
import { events } from '../redux/actions'

/**
 * Main Application Menu Component
 *
 * @param   {Object}      props     React props to be passed to the component
 * @return  {DOMNode}
 */
class AppMenu extends React.Component {

  static propTypes = {
    filter: React.PropTypes.func.isRequired,
    filterValue: React.PropTypes.string.isRequired,
  }

  onFilterChange(text) {
    this.props.filter(text)
  }

  render() {
    return (
      <AppBar
        showMenuIconButton={false}
        title=""
        style={{ position: 'fixed', width: '100%' }}
      >
        <ToolbarGroup>
          <TextField
            id="events-filter"
            name="events-filter"
            hintText="Filter events..."
            value={this.props.filterValue}
            onChange={event => this.onFilterChange(event.target.value)}
            hintStyle={{ color: grey300 }}
            inputStyle={{ color: theme.palette.alternateTextColor }}
            underlineFocusStyle={{ borderColor: theme.palette.alternateTextColor }}
          />
        </ToolbarGroup>
      </AppBar>
    )
  }
}

/**
 * Map state to component props
 *
 * @private
 * @param     {Object}    state    Redux state
 * @return    {Object}
 */
function mapState(state) {
  return {
    filterValue: state.events.getIn(['meta', 'filter']),
  }
}

const mapDispatch = {
  filter: events.filter
}

export default connect(mapState, mapDispatch)(AppMenu)
{'fraction_non_alphanumeric': 0.12738853503184713, 'fraction_numerical': 0.004984768762115757, 'mean_word_length': 2.4664107485604605, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 18, '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': '4609393', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1081, 'n_words': 239}