-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #773 from kevinhughes27/admin-next-layout
Admin next layout
- Loading branch information
Showing
17 changed files
with
377 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,44 @@ | ||
import * as React from 'react'; | ||
import Button from '@material-ui/core/Button'; | ||
import Dialog from '@material-ui/core/Dialog'; | ||
import DialogActions from '@material-ui/core/DialogActions'; | ||
import DialogContent from '@material-ui/core/DialogContent'; | ||
import DialogContentText from '@material-ui/core/DialogContentText'; | ||
import DialogTitle from '@material-ui/core/DialogTitle'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import withStyles, { WithStyles, StyleRulesCallback } from '@material-ui/core/styles/withStyles'; | ||
import withRoot from './withRoot'; | ||
import { withStyles, WithStyles } from '@material-ui/core/styles'; | ||
import { App as styles } from './assets/jss/styles'; | ||
import withTheme from './withTheme'; | ||
|
||
const styles: StyleRulesCallback<'root'> = theme => ({ | ||
root: { | ||
paddingTop: theme.spacing.unit * 20, | ||
textAlign: 'center', | ||
}, | ||
}); | ||
import TopBar from './layout/TopBar'; | ||
import SideBar from './layout/SideBar'; | ||
|
||
interface IState { | ||
open: boolean; | ||
interface Props extends WithStyles<typeof styles> {} | ||
|
||
interface State { | ||
navOpen: boolean; | ||
}; | ||
|
||
class Index extends React.Component<WithStyles<'root'>, IState> { | ||
class App extends React.Component<Props, State> { | ||
public state = { | ||
open: false, | ||
navOpen: false, | ||
}; | ||
|
||
public handleClose = () => { | ||
this.setState({ | ||
open: false, | ||
}); | ||
public openNav = () => { | ||
this.setState({navOpen: true}); | ||
}; | ||
|
||
public handleClick = () => { | ||
this.setState({ | ||
open: true, | ||
}); | ||
public closeNave = () => { | ||
this.setState({navOpen: false}); | ||
}; | ||
|
||
public render() { | ||
public render () { | ||
const { classes } = this.props; | ||
|
||
return ( | ||
<div className={this.props.classes.root}> | ||
<Dialog open={this.state.open} onClose={this.handleClose}> | ||
<DialogTitle>Super Secret Password</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText>1-2-3-4-5</DialogContentText> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button color="primary" onClick={this.handleClose}> | ||
OK | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
<Typography variant="display1" gutterBottom={true}> | ||
Material-UI | ||
</Typography> | ||
<Typography variant="subheading" gutterBottom={true}> | ||
example project | ||
</Typography> | ||
<Button variant="raised" color="secondary" onClick={this.handleClick}> | ||
Super Secret Password | ||
</Button> | ||
<div className={classes.root}> | ||
<TopBar openNav={this.openNav} /> | ||
<SideBar | ||
open={this.state.navOpen} | ||
handleOpen={this.openNav} | ||
handleClose={this.closeNave} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default withRoot(withStyles(styles)<{}>(Index)); | ||
export default withTheme(withStyles(styles)(App)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const App = { | ||
root: { | ||
flexGrow: 1, | ||
} | ||
}; | ||
|
||
const TopBar = { | ||
title: { | ||
flex: 1, | ||
color: 'white' | ||
}, | ||
menuButton: { | ||
color: 'white', | ||
marginLeft: -12, | ||
marginRight: 20, | ||
}, | ||
}; | ||
|
||
const UserMenu = {}; | ||
|
||
const SideBar = {}; | ||
|
||
const NavItems = { | ||
list: { | ||
width: 250, | ||
} | ||
}; | ||
|
||
export { | ||
App, | ||
TopBar, | ||
UserMenu, | ||
SideBar, | ||
NavItems | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import * as React from 'react'; | ||
import { withStyles, WithStyles } from '@material-ui/core/styles' | ||
import { NavItems as styles } from '../assets/jss/styles'; | ||
|
||
import List from '@material-ui/core/List'; | ||
import ListItem from '@material-ui/core/ListItem'; | ||
import ListItemIcon from '@material-ui/core/ListItemIcon'; | ||
import ListItemText from '@material-ui/core/ListItemText'; | ||
import Divider from '@material-ui/core/Divider'; | ||
|
||
import { | ||
faHome, | ||
faUsers, | ||
faSitemap, | ||
faMapSigns, | ||
faCalendar, | ||
faList | ||
} from '@fortawesome/free-solid-svg-icons' | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
|
||
interface Props extends WithStyles<typeof styles> {} | ||
|
||
class NavItems extends React.Component<Props> { | ||
public render() { | ||
const { classes } = this.props; | ||
|
||
return ( | ||
<div className={classes.list}> | ||
<List> | ||
<div> | ||
<ListItem button> | ||
<ListItemIcon> | ||
<FontAwesomeIcon icon={faHome} /> | ||
</ListItemIcon> | ||
<ListItemText primary="Home" /> | ||
</ListItem> | ||
<ListItem button> | ||
<ListItemIcon> | ||
<FontAwesomeIcon icon={faUsers} /> | ||
</ListItemIcon> | ||
<ListItemText primary="Teams" /> | ||
</ListItem> | ||
<ListItem button> | ||
<ListItemIcon> | ||
<FontAwesomeIcon icon={faSitemap} /> | ||
</ListItemIcon> | ||
<ListItemText primary="Division" /> | ||
</ListItem> | ||
<ListItem button> | ||
<ListItemIcon> | ||
<FontAwesomeIcon icon={faMapSigns} /> | ||
</ListItemIcon> | ||
<ListItemText primary="Fields" /> | ||
</ListItem> | ||
<ListItem button> | ||
<ListItemIcon> | ||
<FontAwesomeIcon icon={faCalendar} /> | ||
</ListItemIcon> | ||
<ListItemText primary="Schedule" /> | ||
</ListItem> | ||
</div> | ||
</List> | ||
<Divider/> | ||
<List> | ||
<div> | ||
<ListItem button> | ||
<ListItemIcon> | ||
<FontAwesomeIcon icon={faList} /> | ||
</ListItemIcon> | ||
<ListItemText primary="Games" /> | ||
</ListItem> | ||
</div> | ||
</List> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default withStyles(styles)(NavItems); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as React from 'react'; | ||
import { withStyles, WithStyles } from '@material-ui/core/styles'; | ||
import { SideBar as styles } from '../assets/jss/styles'; | ||
|
||
import SwipeableDrawer from '@material-ui/core/SwipeableDrawer'; | ||
import NavItems from './NavItems'; | ||
|
||
interface Props extends WithStyles<typeof styles> { | ||
open: boolean, | ||
handleOpen: (event: React.SyntheticEvent<{}>) => void, | ||
handleClose: (event: React.SyntheticEvent<{}>) => void | ||
} | ||
|
||
class SideBar extends React.Component<Props> { | ||
public render() { | ||
return ( | ||
<SwipeableDrawer | ||
open={this.props.open} | ||
onClose={this.props.handleClose} | ||
onOpen={this.props.handleOpen} | ||
> | ||
<div | ||
tabIndex={0} | ||
role="button" | ||
onClick={this.props.handleClose} | ||
onKeyDown={this.props.handleClose} | ||
> | ||
<NavItems /> | ||
</div> | ||
</SwipeableDrawer> | ||
) | ||
} | ||
} | ||
|
||
export default withStyles(styles)(SideBar); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from 'react'; | ||
import { withStyles, WithStyles } from '@material-ui/core/styles'; | ||
import { TopBar as styles } from '../assets/jss/styles'; | ||
|
||
import AppBar from '@material-ui/core/AppBar'; | ||
import Toolbar from '@material-ui/core/Toolbar'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import MenuIcon from '@material-ui/icons/Menu'; | ||
import UserMenu from './UserMenu'; | ||
|
||
interface Props extends WithStyles<typeof styles> { | ||
openNav: (event: React.SyntheticEvent<{}>) => void, | ||
} | ||
|
||
class TopBar extends React.Component<Props> { | ||
public render () { | ||
const { classes } = this.props; | ||
|
||
return ( | ||
<AppBar position="static"> | ||
<Toolbar> | ||
<IconButton className={classes.menuButton} aria-label="Menu" onClick={this.props.openNav}> | ||
<MenuIcon /> | ||
</IconButton> | ||
<Typography variant="title" className={classes.title}> | ||
Ultimate Tournament | ||
</Typography> | ||
<UserMenu /> | ||
</Toolbar> | ||
</AppBar> | ||
); | ||
} | ||
} | ||
|
||
export default withStyles(styles)(TopBar); |
Oops, something went wrong.