import { AppBar, Button, IconButton, Theme, Toolbar, Typography, WithStyles, withStyles } from '@material-ui/core'; import MenuIcon from '@material-ui/icons/Menu'; import cx from 'classnames'; import * as React from 'react'; import { RouteHelper } from '../routes/route-helper'; const styles = (theme: Theme) => ({ menuButton: { marginLeft: 12, marginRight: 36, }, hide: { display: 'none', }, appBar: { zIndex: theme.zIndex.drawer + 1, transition: theme.transitions.create(['width', 'margin'], { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.leavingScreen, }), }, appBarShift: { marginLeft: 200, width: `calc(100% - ${200}px)`, transition: theme.transitions.create(['width', 'margin'], { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.enteringScreen, }), }, title: { paddingLeft: 10, }, loginButton: { position: 'absolute' as 'absolute', bottom: theme.spacing(2), right: theme.spacing(2), }, }); interface Props extends WithStyles { open: boolean; handleDrawerOpen?: () => void; showDrawer?: boolean; r: RouteHelper; } const PageTitle: React.FC = ({ open, classes, handleDrawerOpen, showDrawer, r }) => ( {showDrawer && ( )} Test Nest {r.isNotAuthenticated() && ( )} {r.isAuthenticated() && ( )} ); export default withStyles(styles)(PageTitle);