blob: cdb62e1a5bfd1ff0acfc9ae37f816387650e7daa (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import React from 'react'
import PropTypes from 'prop-types'
export default class LoginButton extends React.Component {
constructor(props) {
super(props);
window.addEventListener("message", (event) => {
this.props.onAuth(event.data);
}, false);
}
login() {
let loginWindow = window.open("https://juick.com/login?redirect=false", "Login to Juick", "width=400,height=300,resizeable=no,menubar=no,toolbar=no,scrollbars=no");
loginWindow.window.focus();
}
render() {
return (
<div onClick={this.login}>{this.props.title}</div>
)
}
};
LoginButton.propTypes = {
title: PropTypes.string.isRequired,
onAuth: PropTypes.func.isRequired
}
|