text: import React, { Component } from "react";
  import { Link } from "react-router-dom";
  import "./PageStyle.css";
  
  class Register extends Component {
    constructor(props) {
      super(props);
  
      this.state = {
        firstname: "",
        lastname: "",
        email: "",
        password: "",
      };
  
      this.update = this.update.bind(this);
  
      this.displayLogin = this.displayLogin.bind(this);
    }
  
    update(e) {
      let name = e.target.name;
      let value = e.target.value;
      this.setState({
        [name]: value,
      });
    }
  
    displayLogin(e) {
      e.preventDefault();
      console.log("You have successfully registered");
      console.log(this.state);
      this.setState({
        firstname: "",
        lastname: "",
        email: "",
        password: "",
      });
    }
  
    render() {
      return (
        <center>
          <div className="page-background">
            <form onSubmit={this.displayLogin}>
              <h2 className="title-text">REMEDIUM</h2>
              <h2 className="title-text">Register</h2>
  
              <div className="name">
                <input
                  type="text"
                  placeholder="First Name"
                  name="fisrtname"
                  value={this.state.firstname}
                  onChange={this.update}
                />
              </div>
              <div className="name">
                <input
                  type="text"
                  placeholder="Last Name"
                  name="lastname"
                  value={this.state.lastname}
                  onChange={this.update}
                />
              </div>
  
              <div className="email">
                <input
                  type="text"
                  placeholder="Enter your email"
                  name="email"
                  value={this.state.email}
                  onChange={this.update}
                />
              </div>
  
              <div className="password">
                <input
                  type="password"
                  placeholder="Password"
                  name="password"
                  value={this.state.password}
                  onChange={this.update}
                />
              </div>
  
              <div className="password">
                <input
                  type="password"
                  placeholder="Confirm Password"
                  name="password1"
                />
              </div>
  
              <input type="submit" value="Login" />
            </form>
  
            <Link to="/">Login Here</Link>
          </div>
        </center>
      );
    }
  }
  
  export default Register;
  