import React, { Component } from "react"; import { Button, Header, Modal, Icon, Responsive } from "semantic-ui-react"; import { connect } from "react-redux"; import { RemoteService } from "../remote"; import { appActions } from "../storeActions"; //import { update } from "immutability-helper"; class HostModal extends Component { constructor(props) { super(props); this.state = this.initialState; this.saveGuestSettings = this.saveGuestSettings.bind(this); } get initialState() { return { //INITIAL STATE HERE }; } setInitialState() { this.setState(this.initialState); } changeSomething = (event) => { let nam = event.target.name; let val = event.target.value; this.setState({ [nam]: val }); }; closeModal = (e) => { this.setState({ openModal: false }); }; openModal = (e) => { this.setState({ openModal: true }); }; saveGuestSettings() {} render() { return ( {this.type === "new" ? ( ) : ( )}
Select guests

Spaghetti!

); } } const setActiveHost = (activeHost) => { return (dispatch) => dispatch(appActions.setActiveHost(activeHost)); }; const mapStateToProps = (state, ownProps) => ({ hostss: ownProps.id ? state.hostss[ownProps.id] : null, }); const HostModalContainer = connect( mapStateToProps, { ...RemoteService, setActiveHost }, null, { forwardRef: true } )(HostModal); export default HostModalContainer;