Skip to content
Snippets Groups Projects
loginButton.js 761 B
Newer Older
Orlando Piñero's avatar
Orlando Piñero committed
import React, { Component } from "react";
import Button from "react-bootstrap/esm/Button";
Orlando Piñero's avatar
Orlando Piñero committed
import { connect } from "react-redux";

Orlando Piñero's avatar
Orlando Piñero committed
import { getShowLoginDialogAction } from "../state/AuthenticationActions";
Orlando Piñero's avatar
Orlando Piñero committed
class loginButton extends Component {

    constructor(props) {
        super(props);
        this.showLoginDialog = this.showLoginDialog.bind(this)
    }

    showLoginDialog() {
        const dispatch = this.props.dispatch;
Orlando Piñero's avatar
Orlando Piñero committed
        dispatch(getShowLoginDialogAction())
Orlando Piñero's avatar
Orlando Piñero committed
    }

    render() {
        return (
            <div>
Orlando Piñero's avatar
Orlando Piñero committed
                <Button variant="light" onClick={this.showLoginDialog} id="OpenLoginDialogButton">
Orlando Piñero's avatar
Orlando Piñero committed
                    Login
                </Button>
            </div>
        )
    }
}

export default connect()(loginButton)