<commit_before>import React, { Component } from 'react';
import './index.scss';

// Containers
import Header from './Header';
import SideBar from './SideBar';
import Content from './Content';

import categories from './../data/categories.json';

class Container extends Component {
	constructor(props) {
		super(props);

		categories.sort((a, b) => a.title < b.title ? -1 : 1);

		this.state = {
			categories,
			selectedCategory: null,
			selectedCourse: null
		};

		this.filterCategory = this.filterCategory.bind(this);
		this.selectCategory = this.selectCategory.bind(this);
		this.selectCourse = this.selectCourse.bind(this);
	}

	filterCategory(value) {
		const filteredCategories = categories.filter(category => category.title.toLowerCase().match(value.toLowerCase()));

		this.setState({ categories: filteredCategories });
	}

	selectCourse(course) {
		this.setState({ selectedCourse: course });
	}

	selectCategory(category) {
		this.setState({ selectedCategory: category, selectedCourse: null });
	}<commit_msg>fix - close side bar on mobile<commit_after>import React, { Component } from 'react';
import './index.scss';

// Containers
import Header from './Header';
import SideBar from './SideBar';
import Content from './Content';

import categories from './../data/categories.json';

class Container extends Component {
	constructor(props) {
		super(props);

		categories.sort((a, b) => a.title < b.title ? -1 : 1);

		this.state = {
			categories,
			selectedCategory: null,
			selectedCourse: null
		};

		this.filterCategory = this.filterCategory.bind(this);
		this.selectCategory = this.selectCategory.bind(this);
		this.selectCourse = this.selectCourse.bind(this);
	}

	filterCategory(value) {
		const filteredCategories = categories.filter(category => category.title.toLowerCase().match(value.toLowerCase()));

		this.setState({ categories: filteredCategories });
	}

	selectCourse(course) {
		this.setState({ selectedCourse: course });
	}

	selectCategory(category) {
		this.setState({ selectedCategory: category, selectedCourse: null });
		document.querySelector('.sidebar').classList.remove('open');
		document.querySelector('#menu-button').classList.remove('active');
	}
{'fraction_non_alphanumeric': 0.14683082535339717, 'fraction_numerical': 0.001823985408116735, 'mean_word_length': 4.713541666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2332580', 'n_tokens_mistral': 673, 'n_tokens_neox': 621, 'n_words': 139}