<commit_before>import React, { Component } from 'react'
import { Link, withRouter } from 'react-router-dom'
import { connect } from 'react-redux'

import MediaModal from './Media/MediaModal'
import VRUploader from './Media/VRUploader'
import Uploader from './Media/Uploader'
import NewQuizModal from './Quiz/NewQuizModal'

class SideBar extends Component {
  constructor(props) {
    super(props)
    this.state = {
      activeTab: [false, false, false, false],
      uid: null,
      mediaType: '',
      mediaModal: false,
      updateModal: false,
      quizModal: false
    }

    this.toggleQuizModal = this.toggleQuizModal.bind(this)
  }

  handleMediaModal = (e) => {
    this.setState({ mediaModal: !this.state.mediaModal })
  }
  handleUpdateModal = (e) => {
    this.setState({ updateModal: !this.state.updateModal })
  }
  toggleQuizModal() {
    this.setState({ quizModal: !this.state.quizModal })
  }

  toggleAcitveTab(index) {
    const activeState = [...this.state.activeTab]
      .map((item, i) => i === index || false)

    this.setState({ activeTab: activeState })
  }

  render() {
    const activeTab = this.state.activeTab
    const mediaType = this.state.mediaType

    console.log('sidebar props', this.props)
    return (
      <div>
        {this.state.mediaModal && 
          <MediaModal handleModal={this.handleMediaModal}<commit_msg>fix bug in sidebar binding<commit_after>import React, { Component } from 'react'
import { Link, withRouter } from 'react-router-dom'
import { connect } from 'react-redux'

import MediaModal from './Media/MediaModal'
import VRUploader from './Media/VRUploader'
import Uploader from './Media/Uploader'
import NewQuizModal from './Quiz/NewQuizModal'

class SideBar extends Component {
  constructor(props) {
    super(props)
    this.state = {
      activeTab: [false, false, false, false],
      uid: null,
      mediaType: '',
      mediaModal: false,
      updateModal: false,
      quizModal: false
    }
  }

  handleMediaModal = (e) => {
    this.setState({ mediaModal: !this.state.mediaModal })
  }

  handleUpdateModal = (e) => {
    this.setState({ updateModal: !this.state.updateModal })
  }

  toggleQuizModal = () => {
    this.setState({ quizModal: !this.state.quizModal })
  }

  toggleAcitveTab = index => {
    const activeState = [...this.state.activeTab]
      .map((item, i) => i === index || false)

    this.setState({ activeTab: activeState })
  }

  render() {
    const activeTab = this.state.activeTab
    const mediaType = this.state.mediaType

    console.log('sidebar props', this.props)
    return (
      <div>
        {this.state.mediaModal && 
          <MediaModal handleModal={this.handleMediaModal}
{'fraction_non_alphanumeric': 0.13283858998144712, 'fraction_numerical': 0.0, 'mean_word_length': 3.1349693251533743, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '105729', 'n_tokens_mistral': 851, 'n_tokens_neox': 839, 'n_words': 190}