mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-15 01:38:59 +05:30
51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
import React, { Component, PropTypes } from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import AppInfo from 'components/auth/AppInfo';
|
|
import PanelTransition from 'components/auth/PanelTransition';
|
|
|
|
import styles from './auth.scss';
|
|
|
|
class AuthPage extends Component {
|
|
static displayName = 'AuthPage';
|
|
static propTypes = {
|
|
client: PropTypes.shape({
|
|
id: PropTypes.string.isRequired,
|
|
name: PropTypes.string.isRequired,
|
|
description: PropTypes.string.isRequired
|
|
})
|
|
};
|
|
|
|
state = {
|
|
isSidebarHidden: false
|
|
};
|
|
|
|
render() {
|
|
const {isSidebarHidden} = this.state;
|
|
const {client} = this.props;
|
|
|
|
return (
|
|
<div>
|
|
<div className={isSidebarHidden ? styles.hiddenSidebar : styles.sidebar}>
|
|
<AppInfo {...client} onGoToAuth={this.onGoToAuth} />
|
|
</div>
|
|
<div className={styles.content}>
|
|
<PanelTransition {...this.props} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
onGoToAuth = () => {
|
|
this.setState({
|
|
isSidebarHidden: true
|
|
});
|
|
};
|
|
}
|
|
|
|
|
|
export default connect((state) => ({
|
|
client: state.auth.client
|
|
}))(AuthPage);
|