|
|
@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { RouteComponentProps, withRouter } from 'react-router';
|
|
|
|
import { RouteComponentProps, withRouter } from 'react-router';
|
|
|
|
import { List, ListItem, ListSubheader, ListDivider } from '../widgets/List';
|
|
|
|
import { List, ListItem, ListSubheader, ListDivider } from '../widgets/List';
|
|
|
|
|
|
|
|
import { Theme, withTheme } from '@material-ui/core/styles';
|
|
|
|
import ActionCode from '@material-ui/icons/Code';
|
|
|
|
import ActionCode from '@material-ui/icons/Code';
|
|
|
|
import ActionHome from '@material-ui/icons/Home';
|
|
|
|
import ActionHome from '@material-ui/icons/Home';
|
|
|
|
import ActionBugReport from '@material-ui/icons/BugReport';
|
|
|
|
import ActionBugReport from '@material-ui/icons/BugReport';
|
|
|
@ -13,7 +14,7 @@ const logo = require('../images/logo.svg');
|
|
|
|
import SideMenuJournals from './SideMenuJournals';
|
|
|
|
import SideMenuJournals from './SideMenuJournals';
|
|
|
|
import ErrorBoundary from '../components/ErrorBoundary';
|
|
|
|
import ErrorBoundary from '../components/ErrorBoundary';
|
|
|
|
|
|
|
|
|
|
|
|
import { routeResolver, getPalette } from '../App';
|
|
|
|
import { routeResolver } from '../App';
|
|
|
|
|
|
|
|
|
|
|
|
import { store, JournalsType, UserInfoData, StoreState, CredentialsData } from '../store';
|
|
|
|
import { store, JournalsType, UserInfoData, StoreState, CredentialsData } from '../store';
|
|
|
|
import { logout } from '../store/actions';
|
|
|
|
import { logout } from '../store/actions';
|
|
|
@ -28,6 +29,7 @@ interface PropsType {
|
|
|
|
type PropsTypeInner = RouteComponentProps<{}> & PropsType & {
|
|
|
|
type PropsTypeInner = RouteComponentProps<{}> & PropsType & {
|
|
|
|
journals: JournalsType;
|
|
|
|
journals: JournalsType;
|
|
|
|
userInfo: UserInfoData;
|
|
|
|
userInfo: UserInfoData;
|
|
|
|
|
|
|
|
theme: Theme;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SideMenu extends React.PureComponent<PropsTypeInner> {
|
|
|
|
class SideMenu extends React.PureComponent<PropsTypeInner> {
|
|
|
@ -48,6 +50,7 @@ class SideMenu extends React.PureComponent<PropsTypeInner> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
|
|
|
|
const { theme } = this.props;
|
|
|
|
const username = (this.props.etesync && this.props.etesync.credentials.email) ?
|
|
|
|
const username = (this.props.etesync && this.props.etesync.credentials.email) ?
|
|
|
|
this.props.etesync.credentials.email
|
|
|
|
this.props.etesync.credentials.email
|
|
|
|
: C.appName;
|
|
|
|
: C.appName;
|
|
|
@ -83,7 +86,7 @@ class SideMenu extends React.PureComponent<PropsTypeInner> {
|
|
|
|
<div style={{ overflowX: 'hidden', width: 250}}>
|
|
|
|
<div style={{ overflowX: 'hidden', width: 250}}>
|
|
|
|
<div className="App-drawer-header">
|
|
|
|
<div className="App-drawer-header">
|
|
|
|
<img className="App-drawer-logo" src={logo} />
|
|
|
|
<img className="App-drawer-logo" src={logo} />
|
|
|
|
<div style={{color: getPalette('alternateTextColor')}} >
|
|
|
|
<div style={{ color: theme.palette.secondary.contrastText }} >
|
|
|
|
{username}
|
|
|
|
{username}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -116,6 +119,6 @@ const mapStateToProps = (state: StoreState, props: PropsType) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default withRouter(connect(
|
|
|
|
export default withTheme()(withRouter(connect(
|
|
|
|
mapStateToProps
|
|
|
|
mapStateToProps
|
|
|
|
)(SideMenu));
|
|
|
|
)(SideMenu)));
|
|
|
|