From 445f9d694df84bf6a4aedbeae47f8df7baa55c29 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 16 Jun 2018 19:38:51 +0300 Subject: Modal component --- vnext/src/components/LoginButton.js | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'vnext/src/components/LoginButton.js') diff --git a/vnext/src/components/LoginButton.js b/vnext/src/components/LoginButton.js index f35a932d..c332de14 100644 --- a/vnext/src/components/LoginButton.js +++ b/vnext/src/components/LoginButton.js @@ -1,24 +1,40 @@ import React from 'react'; import PropTypes from 'prop-types'; import Icon from './Icon'; +import Modal from './Modal'; export default class LoginButton extends React.Component { constructor(props) { super(props); - window.addEventListener('message', (event) => { - this.props.onAuth(event.data); - }, false); + this.state = { isOpen: false }; } - login(event) { - event.preventDefault(); - 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(); + toggleModal(event) { + event.preventDefault() + this.setState({ + isOpen: !this.state.isOpen + }); } render() { return ( - {this.props.title} + + {this.props.title} + + + Please, introduce yourself: + Login with facebook + Login with VK + Already registered? + + + + + + + + ); } } -- cgit v1.2.3
Please, introduce yourself:
Already registered?