2016-02-23 11:27:16 +05:30
|
|
|
import React, { Component, PropTypes } from 'react';
|
|
|
|
|
|
|
|
import { connect } from 'react-redux';
|
2016-01-18 10:58:43 +05:30
|
|
|
|
2016-03-13 14:20:09 +05:30
|
|
|
import AppInfo from 'components/auth/appInfo/AppInfo';
|
2016-01-31 18:29:38 +05:30
|
|
|
import PanelTransition from 'components/auth/PanelTransition';
|
2016-01-04 02:48:42 +05:30
|
|
|
|
|
|
|
import styles from './auth.scss';
|
|
|
|
|
2016-02-23 11:27:16 +05:30
|
|
|
class AuthPage extends Component {
|
2016-02-06 16:17:51 +05:30
|
|
|
static displayName = 'AuthPage';
|
2016-02-23 11:27:16 +05:30
|
|
|
static propTypes = {
|
|
|
|
client: PropTypes.shape({
|
|
|
|
id: PropTypes.string.isRequired,
|
|
|
|
name: PropTypes.string.isRequired,
|
|
|
|
description: PropTypes.string.isRequired
|
|
|
|
})
|
|
|
|
};
|
2016-02-06 16:17:51 +05:30
|
|
|
|
|
|
|
state = {
|
|
|
|
isSidebarHidden: false
|
|
|
|
};
|
2016-01-16 17:36:22 +05:30
|
|
|
|
2016-01-04 02:48:42 +05:30
|
|
|
render() {
|
2016-02-23 11:27:16 +05:30
|
|
|
const {isSidebarHidden} = this.state;
|
|
|
|
const {client} = this.props;
|
2016-01-04 02:48:42 +05:30
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2016-02-06 16:17:51 +05:30
|
|
|
<div className={isSidebarHidden ? styles.hiddenSidebar : styles.sidebar}>
|
2016-02-23 11:27:16 +05:30
|
|
|
<AppInfo {...client} onGoToAuth={this.onGoToAuth} />
|
2016-01-04 02:48:42 +05:30
|
|
|
</div>
|
|
|
|
<div className={styles.content}>
|
2016-03-15 11:10:18 +05:30
|
|
|
<PanelTransition {...this.props} />
|
2016-01-04 02:48:42 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2016-02-06 16:17:51 +05:30
|
|
|
|
|
|
|
onGoToAuth = () => {
|
|
|
|
this.setState({
|
|
|
|
isSidebarHidden: true
|
|
|
|
});
|
|
|
|
};
|
2016-01-21 11:59:35 +05:30
|
|
|
}
|
2016-02-23 11:27:16 +05:30
|
|
|
|
|
|
|
|
|
|
|
export default connect((state) => ({
|
|
|
|
client: state.auth.client
|
|
|
|
}))(AuthPage);
|