diff options
author | 2018-03-02 15:44:24 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:52 +0300 | |
commit | 96c3e2de18b51259ef0a8bd3562056f3d1f151ad (patch) | |
tree | 69bf0ac18932956f3e945077e808b7ba4a3a22a3 /vnext/src/components/LoginButton.js | |
parent | fb44a9cf650889f097701ebf27a8032f3f0fcc20 (diff) |
LoginButton component
Diffstat (limited to 'vnext/src/components/LoginButton.js')
-rw-r--r-- | vnext/src/components/LoginButton.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vnext/src/components/LoginButton.js b/vnext/src/components/LoginButton.js new file mode 100644 index 00000000..cdb62e1a --- /dev/null +++ b/vnext/src/components/LoginButton.js @@ -0,0 +1,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 +}
\ No newline at end of file |