Put username on the upper right corner.

master
Tom Hacohen 7 years ago
parent 38cb4170ed
commit 43127dc53f

@ -8,6 +8,7 @@ import AppBar from 'material-ui/AppBar';
import Drawer from 'material-ui/Drawer'; import Drawer from 'material-ui/Drawer';
import IconButton from 'material-ui/IconButton'; import IconButton from 'material-ui/IconButton';
import { List, ListItem } from 'material-ui/List'; import { List, ListItem } from 'material-ui/List';
import FlatButton from 'material-ui/FlatButton';
import Subheader from 'material-ui/Subheader'; import Subheader from 'material-ui/Subheader';
import Divider from 'material-ui/Divider'; import Divider from 'material-ui/Divider';
import ActionCode from 'material-ui/svg-icons/action/code'; import ActionCode from 'material-ui/svg-icons/action/code';
@ -75,7 +76,7 @@ class App extends React.Component {
}; };
props: { props: {
credentials?: store.CredentialsData; credentials?: store.CredentialsType;
}; };
constructor(props: any) { constructor(props: any) {
@ -101,6 +102,10 @@ class App extends React.Component {
} }
render() { render() {
const username = (this.props.credentials && this.props.credentials.value) ?
<FlatButton label={this.props.credentials.value.credentials.email} />
: undefined;
return ( return (
<MuiThemeProvider muiTheme={muiTheme}> <MuiThemeProvider muiTheme={muiTheme}>
<HashRouter> <HashRouter>
@ -108,6 +113,7 @@ class App extends React.Component {
<AppBar <AppBar
title={C.appName} title={C.appName}
iconElementLeft={<IconButton onClick={this.toggleDrawer}><NavigationMenu /></IconButton>} iconElementLeft={<IconButton onClick={this.toggleDrawer}><NavigationMenu /></IconButton>}
iconElementRight={username}
/> />
<Drawer <Drawer
docked={false} docked={false}

Loading…
Cancel
Save