import React, { Component } from "react";
import { connect } from "react-redux";
// import * as actions from "../../actions/adminMainPageActions";
import AdminHeader from "../../components/adminHeader/adminHeader";
import PhotogalaryForm from "../../components/adminPhotogalary/adminPhotogalaryReduxForm";
import { showSidebar } from "../../actions/show-sidebar";
// import {eventFormInitialValue} from "../../state/addEventInitialValue"

class AdminAddPhotogalarytPage extends Component {
    // state = { 
    //     eventFormInitialValue
    //  };

    // componentDidMount() {
	//     this.props.getEvents();
    // }
    
    componentDidMount() {
        this.props.showSidebar()
      }
    
      componentWillUnmount() {
        this.props.showSidebar()
      }

    render() {
        const {
            eventTypes,
            // eventList
        } = this.props

        // console.log('eventList', eventList)

		// console.log("initialValues", this.state.eventFormInitialValue);
		return (
            <>
                <AdminHeader />
                <div className="photogalary-form">
                    <div className="photogalary-form__content">
                        <h2 className="photogalary-form__form-title">ADD EVENT PHOTOGALARY</h2>
                        <PhotogalaryForm eventTypes={eventTypes}/>
                    </div>
                </div>
            </>
		);
	}
}

const mapStateToProps = state => ({
    // eventList: state.adminMainPageReducer.eventList,
    eventTypes: state.adminMainPageReducer.eventTypes
});

export default connect(
    mapStateToProps, 
    { showSidebar }
)(AdminAddPhotogalarytPage);