<commit_before>import React             from 'react'
import Mixer             from './mixer'
import CallLog           from './call-log'
import Inbox             from './inbox'
import Toastr            from './toastr'
import SendMessageDialog from './send-message-dialog'
import CallDialog        from './call-dialog'

import { connect } 
  from 'react-redux'

import AppBar   
  from 'material-ui/lib/app-bar'
import Tabs 
  from 'material-ui/lib/tabs/tabs'
import Tab 
  from 'material-ui/lib/tabs/tab'
import FloatingActionButton 
  from 'material-ui/lib/floating-action-button'
import Badge 
  from 'material-ui/lib/badge'

import IconCommunicationDialpad
  from 'material-ui/lib/svg-icons/communication/dialpad'
import IconCommunicationMessage
  from 'material-ui/lib/svg-icons/communication/message'

class App extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      tab     : 'mixer',
      opacity : 0,
      dialog  : null,
      message : null,
    }
  }
  activateTab(tab) {
    this.setState({ tab })
  }
  renderAppBar() {
    return (
      <AppBar title='The Box' />
    )
  }
  renderDialog() {
    const { dialog, message } = this.state
    const { mixer : { channelList }, sendMessage } = this.props
    return (
      <div>
        <CallDialog 
          channels    = {channelList}
          onClose     = {() => this.setState({dialog: null})} 
          open        = {'call' == dialog} 
          sendMessage = {sendMessage}
        />
        <SendMessageDialog 
          channels    = {channelList}
          onClose     = {() => this.setState({dialog: null})} 
          open        = {['send-message', 'forward-message', 'reply-to-message'].indexOf(dialog) > -1} 
          dialog      = {dialog}
          message     = {message}
          sendMessage = {sendMessage}
        />
      </div>
    )
  }
  renderTabs() {
    const { tab } = this.state
    const { sendMessage, inbox : { unreadCount } } = this.props
    return (
      <Tabs value={tab}>
        <Tab
          onActive = {() => this.activateTab('mixer')}
          icon     = {<span><i className='material-icons'>volume_up</i></span>}
          label    = 'Mixer' 
          value    = 'mixer'>
          <Mixer />
        </Tab>
        <Tab
          onActive = {() => this.activateTab('inbox')}
          icon     = {
            <span>
              <i className='material-icons'>message</i>
              {!!unreadCount && (
                <Badge
                  style        = {styles.badge}
                  badgeContent = {unreadCount}
                  primary      = {true}>
                </Badge>
              )}
            </span>
          }
          label    = 'Inbox' 
          value    = 'inbox'>
          <Inbox 
            onReply     = {message => this.setState({dialog: 'reply-to-message', message})}
            onForward   = {message => this.setState({dialog: 'forward-message', message})}
            sendMessage = {sendMessage} 
          />
        </Tab>
        <Tab
          onActive = {() => this.activateTab('call_log')}
          icon     = {<span><i className='material-icons'>history</i></span>}
          label    = 'Call log' 
          value    = 'call_log'>
          <CallLog />
        </Tab>
      </Tabs>
    )
  }
  renderFAB() {
    switch (this.state.tab) {
      case 'mixer':
        return (
          <FloatingActionButton 
            onClick = {() => this.setState({dialog: 'call'})}
            style   = {styles.fab}>
            <IconCommunicationDialpad />
          </FloatingActionButton>
        )
      case 'inbox':
        return (
          <FloatingActionButton 
            onClick = {() => this.setState({dialog: 'send-message', message: null})}
            style   = {styles.fab}>
            <IconCommunicationMessage />
          </FloatingActionButton>
        )
      case 'call_log':
      default:
        return (
          <span />
        )
    }
  }
  componentDidMount() {
    window.setTimeout(() => this.setState({opacity: 1}), 100)
  }
  render() {
    const { opacity } = this.state
    return (
      <div style={{opacity, ...styles.component}}>
        {::this.renderDialog()}
        {::this.renderAppBar()}
        {::this.renderTabs()}
        {::this.renderFAB()}
      </div>
    )
  }
}

const styles = {
  component: { 
    WebkitTransition : 'opacity 1s',
    transition       : 'opacity 1s',
    width            : '100%',
    marginBottom     : '100px',
  },
  fab: {
    position         : 'fixed',
    bottom           : '30px',
    right            : '30px',
  },
  badge: {
    position         : 'absolute',
    marginTop        : '15px',
  },
}

const AppComponent = connect(state => ({
  inbox : state.inbox,
  app   : state.app,
  mixer : state.mixer,
}))(App)

export default AppComponent<commit_msg>inline connect call to export statement<commit_after>import React             from 'react'
import Mixer             from './mixer'
import CallLog           from './call-log'
import Inbox             from './inbox'
import Toastr            from './toastr'
import SendMessageDialog from './send-message-dialog'
import CallDialog        from './call-dialog'

import { connect } 
  from 'react-redux'
import { reset } 
  from 'redux-form'

import AppBar   
  from 'material-ui/lib/app-bar'
import Tabs 
  from 'material-ui/lib/tabs/tabs'
import Tab 
  from 'material-ui/lib/tabs/tab'
import FloatingActionButton 
  from 'material-ui/lib/floating-action-button'
import Badge 
  from 'material-ui/lib/badge'

import IconCommunicationDialpad
  from 'material-ui/lib/svg-icons/communication/dialpad'
import IconCommunicationMessage
  from 'material-ui/lib/svg-icons/communication/message'

class App extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      tab     : 'mixer',
      opacity : 0,
      dialog  : null,
      message : null,
    }
  }
  activateTab(tab) {
    this.setState({ tab })
  }
  renderAppBar() {
    return (
      <AppBar title='VoxBox' />
    )
  }
  renderDialog() {
    const { dialog, message } = this.state
    const { mixer : { channelList }, sendMessage } = this.props
    return (
      <div>
        <CallDialog 
          channels    = {channelList}
          onClose     = {() => this.setState({dialog: null})} 
          open        = {'call' == dialog} 
          sendMessage = {sendMessage}
        />
        <SendMessageDialog 
          channels    = {channelList}
          onClose     = {() => this.setState({dialog: null})} 
          open        = {['send-message', 'forward-message', 'reply-to-message'].indexOf(dialog) > -1} 
          dialog      = {dialog}
          message     = {message}
          sendMessage = {sendMessage}
        />
      </div>
    )
  }
  renderTabs() {
    const { tab } = this.state
    const { dispatch, sendMessage, inbox : { unreadCount } } = this.props
    return (
      <Tabs value={tab}>
        <Tab
          onActive = {() => this.activateTab('mixer')}
          icon     = {<span><i className='material-icons'>volume_up</i></span>}
          label    = 'Mixer' 
          value    = 'mixer'>
          <Mixer />
        </Tab>
        <Tab
          onActive = {() => this.activateTab('inbox')}
          icon     = {
            <span>
              <i className='material-icons'>message</i>
              {!!unreadCount && (
                <Badge
                  style        = {styles.badge}
                  badgeContent = {unreadCount}
                  primary      = {true}>
                </Badge>
              )}
            </span>
          }
          label    = 'Inbox' 
          value    = 'inbox'>
          <Inbox 
            onReply     = {message => this.setState({dialog: 'reply-to-message', message})}
            onForward   = {message => this.setState({dialog: 'forward-message', message})}
            sendMessage = {sendMessage} 
          />
        </Tab>
        <Tab
          onActive = {() => this.activateTab('call_log')}
          icon     = {<span><i className='material-icons'>history</i></span>}
          label    = 'Call log' 
          value    = 'call_log'>
          <CallLog />
        </Tab>
      </Tabs>
    )
  }
  renderFAB() {
    switch (this.state.tab) {
      case 'mixer':
        return (
          <FloatingActionButton 
            onClick = {() => this.setState({dialog: 'call'})}
            style   = {styles.fab}>
            <IconCommunicationDialpad />
          </FloatingActionButton>
        )
      case 'inbox':
        return (
          <FloatingActionButton 
            onClick = {() => {
	      this.setState({dialog: 'send-message'});
	      dispatch(reset('sendSMS'))
	    }}
            style = {styles.fab}>
            <IconCommunicationMessage />
          </FloatingActionButton>
        )
      case 'call_log':
      default:
        return (
          <span />
        )
    }
  }
  componentDidMount() {
    window.setTimeout(() => this.setState({opacity: 1}), 100)
  }
  render() {
    const { opacity } = this.state
    return (
      <div style={{opacity, ...styles.component}}>
        {::this.renderDialog()}
        {::this.renderAppBar()}
        {::this.renderTabs()}
        {::this.renderFAB()}
      </div>
    )
  }
}

const styles = {
  component: { 
    WebkitTransition : 'opacity 1s',
    transition       : 'opacity 1s',
    width            : '100%',
    marginBottom     : '100px',
  },
  fab: {
    position         : 'fixed',
    bottom           : '30px',
    right            : '30px',
  },
  badge: {
    position         : 'absolute',
    marginTop        : '15px',
  },
}

export default connect(state => ({
  inbox : state.inbox,
  app   : state.app,
  mixer : state.mixer,
}))(App)

{'fraction_non_alphanumeric': 0.13900563813429012, 'fraction_numerical': 0.004100461301896463, 'mean_word_length': 1.6510869565217392, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 105, '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': '3365288', 'n_tokens_mistral': 2966, 'n_tokens_neox': 2907, 'n_words': 574}