text: import React, { Component } from 'react'
  import { connect } from 'react-redux'
  import{ signIn } from '../../store/actions/authActions'
  import { Redirect } from 'react-router-dom'
  
  class SignIn extends Component {
     state = {
       email: '',
       password: ''  
     }
     handleChange = (e) => {
         this.setState({
         [e.target.id]: e.target.value               //för kunna registrera email
         })
  //console.log(e) det här har använts i början
     }
     handleSubmit = (e) => {
         e.preventDefault();                          //för att kunna registrera password
         this.props.signIn(this.state)
        // console.log(this.state)   andra omgång skrevs såhär
  //console.log(e) det skrev såhär i början
     }
     render() {
       const { authError, auth } = this.props;
       if(auth.uid) return <Redirect to='/' />
      return (
        <div className="container">
          <form onSubmit={this.handleSubmit} className="white">
            <h5 className="grey-text text-darken-3">Sign in</h5>
              <div className="input-field">
                <label htmlFor="email">Email</label>
                <input type="email" id="email" onChange={this.handleChange}/>
              </div>
              <div className="input-field">
              <label htmlFor="password">Password</label>
              <input type="password" id="password" onChange={this.handleChange}/>
            </div>
            <div className="input-field">
                <button className="btn pink lighten-1 zdepth-0">Login</button>
                <div className="red-text center">
                  { authError ? <p>{authError}</p> : null }
                </div>
            </div>
          </form>
        </div>
      )
    }
  }
  
  const mapStateToProps = (state) => {
    return {
      authError: state.auth.authError,
      auth: state.firebase.auth
    }
  }
  const mapDispatchToProps = (dispatch) => {
    return {
      signIn: (creds) => dispatch(signIn(creds))
    }
  }
  export default connect(mapStateToProps, mapDispatchToProps)(SignIn)
  
  
  // Se kommentar i index.html angående sign ins script src effekt