constructLoginOrEdit() {
    let result = "";
    if (!this.state.validatedToken) {
      result = (
        <Dropdown.Item eventKey="4" onSelect={this.handleLoginModalShow}>
          Login
        </Dropdown.Item>
      );
    } else {
      result = (
        <Dropdown.Item eventKey="5" onSelect={this.handleEditToggle}>
          <Form>
            <Form.Check
              type="switch"
              id="edit-switch"
              label="Edit"
              checked={this.state.allowEdit ? true : false}
              onChange={this.handleLoginModalShow}
            />
          </Form>
        </Dropdown.Item>
      );
    }
    return result;
  }
// change menu item between login and edit
change menu item between login and edit
change menu item between login and edit
constructLoginOrEdit() {
    let result = "";
    if (!this.state.validatedToken) {
      result = (
        <Dropdown.Item eventKey="4" onSelect={this.handleLoginModalShow}>
          Login
        </Dropdown.Item>
      );
    } else {
      result = (
        <Dropdown.Item eventKey="5" onSelect={this.handleEditToggle}>
          <Form>
            <Form.Check
              type="switch"
              id="edit-switch"
              label="Edit"
              checked={this.state.allowEdit ? true : false}
              onChange={this.handleLoginModalShow}
            />
          </Form>
        </Dropdown.Item>
      );
    }
    return result;
  }
constructLoginOrEdit ( ) { let result = "" ; if ( ! this . state . validatedToken ) { result = ( < Dropdown . Item eventKey = "4" onSelect = { this . handleLoginModalShow } > 
          Login
         < / Dropdown . Item > ) ; } else { result = ( < Dropdown . Item eventKey = "5" onSelect = { this . handleEditToggle } > < Form > < Form . Check type = "switch" id = "edit-switch" label = "Edit" checked = { this . state . allowEdit ? true : false } onChange = { this . handleLoginModalShow } / > < / Form > < / Dropdown . Item > ) ; } return result ; }
change menu item between login and edit
change menu item between login and edit