mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-11 01:22:49 +00:00
client - use mobx as state container
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { UserStore } from '../../stores/user-store';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
userStore?: UserStore;
|
||||
}
|
||||
|
||||
interface State {}
|
||||
@@ -12,14 +15,17 @@ const oauthUrl: string =
|
||||
? ''
|
||||
: 'https://us.battle.net/oauth/authorize?redirect_uri=https://localhost/oauth&scope=wow.profile&client_id=2pfsnmd57svcpr5c93k7zb5zrug29xvp&response_type=code';
|
||||
|
||||
@inject('userStore')
|
||||
@observer
|
||||
export class LoginButton extends React.Component<Props, State> {
|
||||
|
||||
login() {
|
||||
window.open(oauthUrl, '_blank', 'resizeable=yes, height=900, width=1200');
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div {...this.props}>
|
||||
<div className={this.props.className}>
|
||||
<img src={require('../../assets/login-bot-left.gif')} />
|
||||
<img src={require('../../assets/login-bot-login.gif')} style={{ cursor: 'pointer' }} onClick={this.login.bind(this)} />
|
||||
<img src={require('../../assets/login-bot-right.gif')} />
|
||||
|
||||
Reference in New Issue
Block a user