import React from 'react';
import NavigationMenu from './NavigationMenu';
import Projects from './Projects/ProjectContents'
import ProjectsList from './Projects/ProjectsList';


class ContentArea extends React.Component {

    
    state = {
        currentVisible: null,
    }

    constructor(props)
    {
      super(props);
      this.setState({currentVisible:null});
      this.elementVisible = this.elementVisible.bind(this);
    }

    elementVisible(iElement)
    {   
        if(iElement.intersect != 0)
        {
            this.setState({currentVisible: iElement})
        }
    }

    render() {
      return (
      <React.Fragment>
            <NavigationMenu visible={this.state.currentVisible} projects={Projects}></NavigationMenu>
            <div className="top-spacer"></div>
            <ProjectsList parentComponent={this} projects={Projects}> Projets </ProjectsList>
        </React.Fragment>);
    }
  }

export default ContentArea