<commit_before>import * as React from 'react';
import { StatelessComponent } from 'react';

import './AppHeader.css';
import AppBar from 'material-ui/AppBar';
import Toolbar from 'material-ui/Toolbar';
import Typography from 'material-ui/Typography';
import Tabs, { Tab } from 'material-ui/Tabs';
import { RouteComponentProps, withRouter } from 'react-router';

const logo = require('./logo.svg');

const getActiveMenuIndex = (pathname: string) => {
  if (pathname.startsWith('/404')) {
    return 4;
  } else if (pathname.startsWith('/time')) {
    return 3;
  } else if (pathname.startsWith('/about')) {
    return 2;
  } else if (pathname.startsWith('/home')) {
    return 1;
  } else {
    return 0;
  }
};

const AppHeader: StatelessComponent<RouteComponentProps<{}>> = (props) => (
  <div className="App-header">
    <AppBar position="static" color="default">
      <Toolbar>
        <img src={logo} className="App-logo" alt="logo"/>
        <Typography type="title" color="inherit" style={{width: '50%'}}>
          <span className="app-title">Welcome to React</span>
        </Typography>
        <Tabs value={getActiveMenuIndex(props.location.pathname)}>
          <Tab label="Main Page" onClick={() => props.history.push('/')}/>
          <Tab label="Home" onClick={() => props.history.push('/home')}/>
          <Tab label="About" onClick={() => props.history.push('/about')}/>
          <Tab label="Time" onClick={() => props.history.push('/time')}/>
          <Tab label="404" onClick={() => props.history.push('/404')}/>
        </Tabs>
      </Toolbar>
    </AppBar>
  </div>
);

export default withRouter(AppHeader);<commit_msg>hide menu on small screen<commit_after>import * as React from 'react';
import { StatelessComponent } from 'react';

import './AppHeader.css';
import AppBar from 'material-ui/AppBar';
import Toolbar from 'material-ui/Toolbar';
import Typography from 'material-ui/Typography';
import Tabs, { Tab } from 'material-ui/Tabs';
import { RouteComponentProps, withRouter } from 'react-router';
import Hidden from 'material-ui/Hidden';

const logo = require('./logo.svg');

const getActiveMenuIndex = (pathname: string) => {
  if (pathname.startsWith('/404')) {
    return 4;
  } else if (pathname.startsWith('/time')) {
    return 3;
  } else if (pathname.startsWith('/about')) {
    return 2;
  } else if (pathname.startsWith('/home')) {
    return 1;
  } else {
    return 0;
  }
};

const AppHeader: StatelessComponent<RouteComponentProps<{}>> = (props) => (
  <div className="App-header">
    <AppBar position="static" color="default">
      <Toolbar>
        <img src={logo} className="App-logo" alt="logo"/>
        <Typography type="title" color="inherit" style={{width: '50%'}}>
          <span className="app-title">Welcome to React</span>
        </Typography>
        <Hidden smDown={true}>
          <Tabs value={getActiveMenuIndex(props.location.pathname)}>
            <Tab label="Main Page" onClick={() => props.history.push('/')}/>
            <Tab label="Home" onClick={() => props.history.push('/home')}/>
            <Tab label="About" onClick={() => props.history.push('/about')}/>
            <Tab label="Time" onClick={() => props.history.push('/time')}/>
            <Tab label="404" onClick={() => props.history.push('/404')}/>
          </Tabs>
        </Hidden>
      </Toolbar>
    </AppBar>
  </div>
);

export default withRouter((AppHeader));
{'fraction_non_alphanumeric': 0.18643570170287727, 'fraction_numerical': 0.009395184967704051, 'mean_word_length': 3.4304291287386217, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 59, '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': '3309606', 'n_tokens_mistral': 1055, 'n_tokens_neox': 1053, 'n_words': 242}