import React, { Component } from 'react';
import RulePopup from './rulePopup/index';
import CoursePopup from './coursePopup/index';
import './index.scss';

class BlessingPrehead extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isRule: false,
      isCourse: true
    };
  }

  handleToHide = (key) => {
    let obj = {};
    obj[key] = false;
    this.setState({
      ...obj
    });
  }

  render() {
    const { isRule, isCourse } = this.state;
    return (
      <div>
        22222
        
        {
          isRule && 
          <RulePopup handleToHide={() => this.handleToHide('isRule')} />
        }
        {
          isCourse &&
          <CoursePopup handleToHide={() => this.handleToHide('isCourse')} />
        }
      </div>
    );
  }
}

export default BlessingPrehead;