accounts-frontend/src/pages/auth/AuthPage.jsx

51 lines
1.2 KiB
React
Raw Normal View History

2016-02-23 11:27:16 +05:30
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import AppInfo from 'components/auth/appInfo/AppInfo';
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 {
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
})
};
state = {
isSidebarHidden: false
};
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>
<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}>
<PanelTransition {...this.props} />
2016-01-04 02:48:42 +05:30
</div>
</div>
);
}
onGoToAuth = () => {
this.setState({
isSidebarHidden: true
});
};
}
2016-02-23 11:27:16 +05:30
export default connect((state) => ({
client: state.auth.client
}))(AuthPage);