1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 21:06:42 +07:00

receiving window messages

This commit is contained in:
Fedor Katurov 2019-11-02 18:45:58 +07:00
parent f7b8b56b53
commit 49bccb96c1
8 changed files with 68 additions and 37 deletions

View file

@ -13,6 +13,7 @@ import { DIALOGS } from '~/redux/modal/constants';
import { pick } from 'ramda';
import { Icon } from '~/components/input/Icon';
import { getURL } from '~/utils/dom';
import { API } from '~/constants/api';
const mapStateToProps = state => ({
user: pick(['username', 'is_user', 'photo'])(selectUser(state)),
@ -27,6 +28,9 @@ type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {
const HeaderUnconnected: FC<IProps> = memo(({ user: { username, is_user, photo }, showDialog }) => {
const onLogin = useCallback(() => showDialog(DIALOGS.LOGIN), [showDialog]);
const onSocialLogin = useCallback(() => {
window.open(API.USER.VKONTAKTE_LOGIN, '', 'width=600,height=400');
}, []);
return (
<div className={style.container}>
@ -36,6 +40,7 @@ const HeaderUnconnected: FC<IProps> = memo(({ user: { username, is_user, photo }
<div className={style.plugs}>
<Link to="/">flow</Link>
<a onClick={onSocialLogin}>SOCIAL</a>
</div>
{is_user && (