Major refactor

This commit is contained in:
Barry Low committed 2018-09-12 08:56:51 -07:00
1 parent 0ad7b17757
commit 33b91af112
36 files changed
+1370 -253

No files matched your search

@@ -0,0 +1,135 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { withRouter } from 'react-router-dom'
import Button from '@material-ui/core/Button'
import AddIcon from '@material-ui/icons/Add'
import TextField from '@material-ui/core/TextField'
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 { getItem } from '../../../utils/local-storage'
export class CreateTeamDialog extends Component {
constructor (props) {
super(props)
this.handleClickOpen = this.handleClickOpen.bind(this)
this.handleClose = this.handleClose.bind(this)
this.handlePost = this.handlePost.bind(this)
this.slugify = this.slugify.bind(this)
this.handleChange = this.handleChange.bind(this)
this.state = {
open: false,
name: ''
}
}
handleClickOpen () {
this.setState({ open: true })
}
handleClose () {
this.setState({ open: false })
}
handleChange (e) {
this.setState({ name: e.target.value })
}
render () {
console.log(this.props)
return (
<div>
<Button
variant='extendedFab'
aria-label='AddTeam'
className={this.props.classes.button}
onClick={this.handleClickOpen}
>
<AddIcon className={this.props.classes.extendedIcon} />
<Typography variant='subheading'>
Create A Team
</Typography>
</Button>
<Dialog
open={this.state.open}
onClose={this.handleClose}
aria-labelledby='form-dialog-title'
>
<DialogTitle id='form-dialog-title'>Subscribe</DialogTitle>
<DialogContent>
<Typography variant='subheading'>
Team Creation
</Typography>
<DialogContentText>
Name your team!
</DialogContentText>
<TextField
autoFocus
margin='dense'
id='teamname'
label='Team Name'
type='text'
fullWidth
value={this.state.name}
onChange={this.handleChange}
/>
</DialogContent>
<DialogActions>
<Button onClick={this.handleClose} color='primary'>
Cancel
</Button>
<Button onClick={this.handlePost} color='primary'>
Create Team
</Button>
</DialogActions>
</Dialog>
</div>
)
}
slugify (string) {
const a = 'àáäâãåèéëêìíïîòóöôùúüûñçßÿœæŕśńṕẃǵǹḿǘẍźḧ·/_,:;'
const b = 'aaaaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w-]+/g, '') // Remove all non-word characters
.replace(/--+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, '') // Trim - from end of text
}
async handlePost (e) {
e.preventDefault()
const { name } = this.state
const slug = this.slugify(name)
const currentUser = await getItem('user')
let authId = JSON.parse(currentUser)
authId = authId.sub
console.log('createPage cu:', JSON.parse(currentUser))
await this.props.createTeamMutation({
variables: {
name,
slug,
owner: authId
}
})
this.setState({ open: false })
}
}
CreateTeamDialog.propTypes = {
classes: PropTypes.object.isRequired,
createTeamMutation: PropTypes.function
}
export default withRouter(CreateTeamDialog)
@@ -0,0 +1,72 @@
import React from 'react'
import { Link } from 'react-router-dom'
import ListItem from '@material-ui/core/ListItem'
import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText'
import GroupIcon from '@material-ui/icons/Group'
import DashboardIcon from '@material-ui/icons/Dashboard'
import SettingsIcon from '@material-ui/icons/Settings'
import SupervisedUserCircleIcon from '@material-ui/icons/SupervisedUserCircle'
import LibraryBooksIcon from '@material-ui/icons/LibraryBooks'
import SentimentSatisfiedAltIcon from '@material-ui/icons/SentimentSatisfiedAlt'
import AndroidIcon from '@material-ui/icons/Android'
const DashboardLink = props => <Link to='/dashboard' {...props} />
const TeamsLink = props => <Link to='/manage-team' {...props} />
const MembersLink = props => <Link to='/members' {...props} />
const SettingsLink = props => <Link to='/settings' {...props} />
export const MainDrawerItems = (
<div>
<ListItem button component={DashboardLink}>
<ListItemIcon>
<DashboardIcon />
</ListItemIcon>
<ListItemText primary='Dashboard' />
</ListItem>
<ListItem button component={TeamsLink}>
<ListItemIcon>
<GroupIcon />
</ListItemIcon>
<ListItemText primary='Teams' />
</ListItem>
<ListItem button component={MembersLink}>
<ListItemIcon>
<SupervisedUserCircleIcon />
</ListItemIcon>
<ListItemText primary='Members' />
</ListItem>
<ListItem button component={TeamsLink}>
<ListItemIcon>
<AndroidIcon />
</ListItemIcon>
<ListItemText primary='Financial Beings' />
</ListItem>
<ListItem button component={SettingsLink}>
<ListItemIcon>
<SettingsIcon />
</ListItemIcon>
<ListItemText primary='Settings' />
</ListItem>
</div>
)
export const SecondaryDrawerItems = (
<div>
<ListItem button>
<ListItemIcon>
<LibraryBooksIcon />
</ListItemIcon>
<ListItemText primary='Documentation' />
</ListItem>
<ListItem button>
<ListItemIcon>
<SentimentSatisfiedAltIcon />
</ListItemIcon>
<ListItemText primary='Support' />
</ListItem>
</div>
)
export default MainDrawerItems
@@ -0,0 +1,54 @@
import React from 'react'
import Table from '@material-ui/core/Table'
import TableBody from '@material-ui/core/TableBody'
import TableCell from '@material-ui/core/TableCell'
import TableHead from '@material-ui/core/TableHead'
import TableRow from '@material-ui/core/TableRow'
import Paper from '@material-ui/core/Paper'
let id = 0
const createData = (name, calories, fat, carbs, protein) => {
id += 1
return { id, name, calories, fat, carbs, protein }
}
const data = [
createData('Frozen yoghurt', 159, 6.0, 24, 4.0),
createData('Ice cream sandwich', 237, 9.0, 37, 4.3),
createData('Eclair', 262, 16.0, 24, 6.0),
createData('Cupcake', 305, 3.7, 67, 4.3),
createData('Gingerbread', 356, 16.0, 49, 3.9)
]
export const TeamTable = () => (
<Paper>
<Table>
<TableHead>
<TableRow>
<TableCell>Dessert (100g serving)</TableCell>
<TableCell numeric>Calories</TableCell>
<TableCell numeric>Fat (g)</TableCell>
<TableCell numeric>Carbs (g)</TableCell>
<TableCell numeric>Protein (g)</TableCell>
</TableRow>
</TableHead>
<TableBody>
{data.map(n => {
return (
<TableRow key={n.id}>
<TableCell component='th' scope='row'>
{n.name}
</TableCell>
<TableCell numeric>{n.calories}</TableCell>
<TableCell numeric>{n.fat}</TableCell>
<TableCell numeric>{n.carbs}</TableCell>
<TableCell numeric>{n.protein}</TableCell>
</TableRow>
)
})}
</TableBody>
</Table>
</Paper>
)
export default TeamTable
+216
View File
@@ -0,0 +1,216 @@
import React from 'react'
import PropTypes from 'prop-types'
import { graphql } from 'react-apollo'
import Typography from '@material-ui/core/Typography'
import { withStyles } from '@material-ui/core/styles'
import Drawer from '@material-ui/core/Drawer'
import List from '@material-ui/core/List'
import Divider from '@material-ui/core/Divider'
import Grid from '@material-ui/core/Grid'
import Card from '@material-ui/core/Card'
import CardContent from '@material-ui/core/CardContent'
import CardMedia from '@material-ui/core/CardMedia'
import CardActions from '@material-ui/core/CardActions'
import Button from '@material-ui/core/Button'
import { MainDrawerItems, SecondaryDrawerItems } from './components/DrawerLinks'
import { CreateTeamDialog } from './components/CreateTeam'
import { CreateTeamMutation } from '../../graphql/teams/CreateTeamMutation'
import aaweb from '../../assets/AlgonetWebPlatform.jpg'
const drawerWidth = 240
const styles = theme => ({
root: {
display: 'flex'
},
'@global': {
body: {
backgroundColor: theme.palette.common.white
}
},
appBar: {
zIndex: theme.zIndex.drawer + 1
},
drawerPaper: {
position: 'relative',
width: drawerWidth,
whiteSpace: 'nowrap',
zIndex: 1000
},
content: {
flexGrow: 1,
backgroundColor: theme.palette.background.default,
padding: theme.spacing.unit * 3,
height: '100vh',
overflow: 'auto',
width: `calc(90% - ${drawerWidth}px)`
},
appBarSpacer: theme.mixins.toolbar,
tableContainer: {
height: 320
},
card: {
display: 'flex',
width: '100%'
},
cardDetails: {
display: 'flex',
flex: 1
},
cardContent: {
flex: 1
},
cardMedia: {
flex: 1,
width: 160,
height: 160,
justifyContent: 'flex-start'
},
aawebMedia: {
width: '100%',
height: 320
},
buttonRight: {
justifyContent: 'flex-end'
},
extendedIcon: {
marginRight: theme.spacing.unit
}
})
const Dashboard = ({ classes, createTeamMutation, ...props }) => (
<div className={classes.root}>
<Drawer
variant='permanent'
classes={{
paper: classes.drawerPaper
}}
>
<div className={classes.appBarSpacer} />
<List>{MainDrawerItems}</List>
<Divider />
<List>{SecondaryDrawerItems}</List>
</Drawer>
<main className={classes.content}>
<div className={classes.appBarSpacer} />
<Grid container spacing={24} className={classes.cardGrid}>
<Grid item md={6}>
<Typography variant='display1' gutterBottom>
Teams
</Typography>
<Grid container spacing={24} className={classes.cardGrid}>
<Grid item>
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardContent className={classes.createCardContent}>
<CreateTeamDialog classes={classes} createTeamMutation={createTeamMutation} />
</CardContent>
</div>
</Card>
</Grid>
<Grid item>
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardMedia
className={classes.cardMedia}
image='data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22288%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20288%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_164edaf95ee%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A14pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_164edaf95ee%22%3E%3Crect%20width%3D%22288%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2296.32500076293945%22%20y%3D%22118.8%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E' // eslint-disable-line max-len
title='Image title'
/>
<CardContent className={classes.cardContent}>
<Typography variant='headline'>Goodester</Typography>
<Typography variant='subheading' color='textSecondary'>
09.15.2018
</Typography>
<Typography variant='subheading' paragraph>
Members:6
</Typography>
<Typography variant='subheading' color='primary'>
Now recruiting!
</Typography>
</CardContent>
<CardActions>
<Button
size='small'
color='primary'
className={classes.buttonRight}
>
Details
</Button>
</CardActions>
</div>
</Card>
</Grid>
<Grid item>
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardMedia
className={classes.cardMedia}
image='data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22288%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20288%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_164edaf95ee%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A14pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_164edaf95ee%22%3E%3Crect%20width%3D%22288%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2296.32500076293945%22%20y%3D%22118.8%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E' // eslint-disable-line max-len
title='Image title'
/>
<CardContent className={classes.cardContent}>
<Typography variant='headline'>Goodester</Typography>
<Typography variant='subheading' color='textSecondary'>
09.15.2018
</Typography>
<Typography variant='subheading' paragraph>
Members:6
</Typography>
<Typography variant='subheading' color='primary'>
Now recruiting!
</Typography>
</CardContent>
<CardActions>
<Button
size='small'
color='primary'
className={classes.buttonRight}
>
Details
</Button>
</CardActions>
</div>
</Card>
</Grid>
</Grid>
</Grid>
<Grid item md={6}>
<Typography variant='display1' gutterBottom>
Develop
</Typography>
<Grid container spacing={24} className={classes.cardGrid}>
<Grid item md={12}>
<Card className={classes.mainFeaturedPost}>
<CardMedia
className={classes.aawebMedia}
image={aaweb}
title='Image title'
/>
<CardContent>
<Typography variant='title' color='inherit' aligh='right'>
<Button>Start Developing ></Button>
</Typography>
</CardContent>
</Card>
</Grid>
</Grid>
</Grid>
</Grid>
</main>
</div>
)
Dashboard.propTypes = {
classes: PropTypes.object.isRequired,
createTeamMutation: PropTypes.function
}
const CreateTeamDialogWithMutation = graphql(CreateTeamMutation, {
name: 'createTeamMutation' // name of the injected prop: this.props.createTeamMutation...
})(Dashboard)
export default withStyles(styles)(CreateTeamDialogWithMutation)
+111
View File
@@ -0,0 +1,111 @@
import React from 'react'
import PropTypes from 'prop-types'
import { graphql } from 'react-apollo'
import Typography from '@material-ui/core/Typography'
import { withStyles } from '@material-ui/core/styles'
import Drawer from '@material-ui/core/Drawer'
import List from '@material-ui/core/List'
import Divider from '@material-ui/core/Divider'
import { MainDrawerItems, SecondaryDrawerItems } from './components/DrawerLinks'
import { TeamTable } from './components/TeamTable'
import { CreateTeamMutation } from '../../graphql/teams/CreateTeamMutation'
const drawerWidth = 240
const styles = theme => ({
root: {
display: 'flex'
},
'@global': {
body: {
backgroundColor: theme.palette.common.white
}
},
appBar: {
zIndex: theme.zIndex.drawer + 1
},
drawerPaper: {
position: 'relative',
width: drawerWidth,
whiteSpace: 'nowrap',
zIndex: 1000
},
content: {
flexGrow: 1,
backgroundColor: theme.palette.background.default,
padding: theme.spacing.unit * 3,
height: '100vh',
overflow: 'auto',
width: `calc(90% - ${drawerWidth}px)`
},
appBarSpacer: theme.mixins.toolbar,
tableContainer: {
height: 320
},
card: {
display: 'flex',
width: '100%'
},
cardDetails: {
display: 'flex',
flex: 1
},
cardContent: {
flex: 1
},
cardMedia: {
flex: 1,
width: 160,
height: 160,
justifyContent: 'flex-start'
},
aawebMedia: {
width: '100%',
height: 320
},
buttonRight: {
justifyContent: 'flex-end'
},
extendedIcon: {
marginRight: theme.spacing.unit
}
})
const Dashboard = ({ classes, createTeamMutation, ...props }) => (
<div className={classes.root}>
<Drawer
variant='permanent'
classes={{
paper: classes.drawerPaper
}}
>
<div className={classes.appBarSpacer} />
<List>{MainDrawerItems}</List>
<Divider />
<List>{SecondaryDrawerItems}</List>
</Drawer>
<main className={classes.content}>
<div className={classes.appBarSpacer} />
<Typography variant='display1' gutterBottom>
Members
</Typography>
<div className={classes.tableContainer}>
<TeamTable />
</div>
</main>
</div>
)
Dashboard.propTypes = {
classes: PropTypes.object.isRequired,
createTeamMutation: PropTypes.function
}
const CreateTeamDialogWithMutation = graphql(CreateTeamMutation, {
name: 'createTeamMutation' // name of the injected prop: this.props.createTeamMutation...
})(Dashboard)
export default withStyles(styles)(CreateTeamDialogWithMutation)
+210
View File
@@ -0,0 +1,210 @@
import React from 'react'
import PropTypes from 'prop-types'
import { graphql } from 'react-apollo'
import Typography from '@material-ui/core/Typography'
import { withStyles } from '@material-ui/core/styles'
import Drawer from '@material-ui/core/Drawer'
import List from '@material-ui/core/List'
import Divider from '@material-ui/core/Divider'
import Grid from '@material-ui/core/Grid'
import Card from '@material-ui/core/Card'
import CardContent from '@material-ui/core/CardContent'
import CardMedia from '@material-ui/core/CardMedia'
import CardActions from '@material-ui/core/CardActions'
import Button from '@material-ui/core/Button'
import { MainDrawerItems, SecondaryDrawerItems } from './components/DrawerLinks'
import { TeamTable } from './components/TeamTable'
import { CreateTeamDialog } from './components/CreateTeam'
import { CreateTeamMutation } from '../../graphql/teams/CreateTeamMutation'
const drawerWidth = 240
const styles = theme => ({
root: {
display: 'flex'
},
'@global': {
body: {
backgroundColor: theme.palette.common.white
}
},
appBar: {
zIndex: theme.zIndex.drawer + 1
},
drawerPaper: {
position: 'relative',
width: drawerWidth,
whiteSpace: 'nowrap',
zIndex: 1000
},
content: {
flexGrow: 1,
backgroundColor: theme.palette.background.default,
padding: theme.spacing.unit * 3,
height: '100vh',
overflow: 'auto',
width: `calc(90% - ${drawerWidth}px)`
},
appBarSpacer: theme.mixins.toolbar,
tableContainer: {
height: 320
},
card: {
display: 'flex',
width: '100%'
},
cardDetails: {
display: 'flex',
flex: 1
},
cardContent: {
flex: 1
},
cardMedia: {
flex: 1,
width: 160,
height: 160,
justifyContent: 'flex-start'
},
aawebMedia: {
width: '100%',
height: 320
},
buttonRight: {
justifyContent: 'flex-end'
},
extendedIcon: {
marginRight: theme.spacing.unit
}
})
const Dashboard = ({ classes, createTeamMutation, ...props }) => (
<div className={classes.root}>
<Drawer
variant='permanent'
classes={{
paper: classes.drawerPaper
}}
>
<div className={classes.appBarSpacer} />
<List>{MainDrawerItems}</List>
<Divider />
<List>{SecondaryDrawerItems}</List>
</Drawer>
<main className={classes.content}>
<div className={classes.appBarSpacer} />
<Grid container spacing={24} className={classes.cardGrid}>
<Grid item md={6}>
<Typography variant='display1' gutterBottom>
Settings
</Typography>
<Grid container spacing={24} className={classes.cardGrid}>
<Grid item>
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardContent className={classes.createCardContent}>
<CreateTeamDialog classes={classes} createTeamMutation={createTeamMutation} />
</CardContent>
</div>
</Card>
</Grid>
<Grid item>
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardMedia
className={classes.cardMedia}
image='data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22288%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20288%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_164edaf95ee%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A14pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_164edaf95ee%22%3E%3Crect%20width%3D%22288%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2296.32500076293945%22%20y%3D%22118.8%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E' // eslint-disable-line max-len
title='Image title'
/>
<CardContent className={classes.cardContent}>
<Typography variant='headline'>Goodester</Typography>
<Typography variant='subheading' color='textSecondary'>
09.15.2018
</Typography>
<Typography variant='subheading' paragraph>
Members:6
</Typography>
<Typography variant='subheading' color='primary'>
Now recruiting!
</Typography>
</CardContent>
<CardActions>
<Button
size='small'
color='primary'
className={classes.buttonRight}
>
Details
</Button>
</CardActions>
</div>
</Card>
</Grid>
<Grid item>
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardMedia
className={classes.cardMedia}
image='data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22288%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20288%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_164edaf95ee%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A14pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_164edaf95ee%22%3E%3Crect%20width%3D%22288%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2296.32500076293945%22%20y%3D%22118.8%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E' // eslint-disable-line max-len
title='Image title'
/>
<CardContent className={classes.cardContent}>
<Typography variant='headline'>Goodester</Typography>
<Typography variant='subheading' color='textSecondary'>
09.15.2018
</Typography>
<Typography variant='subheading' paragraph>
Members:6
</Typography>
<Typography variant='subheading' color='primary'>
Now recruiting!
</Typography>
</CardContent>
<CardActions>
<Button
size='small'
color='primary'
className={classes.buttonRight}
>
Details
</Button>
</CardActions>
</div>
</Card>
</Grid>
</Grid>
</Grid>
<Grid item md={6}>
<Typography variant='display1' gutterBottom>
Notifications
</Typography>
<Grid container spacing={24} className={classes.cardGrid}>
<Grid item md={12}>
<Card className={classes.mainFeaturedPost}>
<CardContent>
<Typography variant='title' color='inherit' aligh='right'>
<Button>Start Developing ></Button>
</Typography>
</CardContent>
</Card>
</Grid>
</Grid>
</Grid>
</Grid>
</main>
</div>
)
Dashboard.propTypes = {
classes: PropTypes.object.isRequired,
createTeamMutation: PropTypes.function
}
const CreateTeamDialogWithMutation = graphql(CreateTeamMutation, {
name: 'createTeamMutation' // name of the injected prop: this.props.createTeamMutation...
})(Dashboard)
export default withStyles(styles)(CreateTeamDialogWithMutation)
+111
View File
@@ -0,0 +1,111 @@
import React from 'react'
import PropTypes from 'prop-types'
import { graphql } from 'react-apollo'
import Typography from '@material-ui/core/Typography'
import { withStyles } from '@material-ui/core/styles'
import Drawer from '@material-ui/core/Drawer'
import List from '@material-ui/core/List'
import Divider from '@material-ui/core/Divider'
import { MainDrawerItems, SecondaryDrawerItems } from './components/DrawerLinks'
import { TeamTable } from './components/TeamTable'
import { CreateTeamMutation } from '../../graphql/teams/CreateTeamMutation'
const drawerWidth = 240
const styles = theme => ({
root: {
display: 'flex'
},
'@global': {
body: {
backgroundColor: theme.palette.common.white
}
},
appBar: {
zIndex: theme.zIndex.drawer + 1
},
drawerPaper: {
position: 'relative',
width: drawerWidth,
whiteSpace: 'nowrap',
zIndex: 1000
},
content: {
flexGrow: 1,
backgroundColor: theme.palette.background.default,
padding: theme.spacing.unit * 3,
height: '100vh',
overflow: 'auto',
width: `calc(90% - ${drawerWidth}px)`
},
appBarSpacer: theme.mixins.toolbar,
tableContainer: {
height: 320
},
card: {
display: 'flex',
width: '100%'
},
cardDetails: {
display: 'flex',
flex: 1
},
cardContent: {
flex: 1
},
cardMedia: {
flex: 1,
width: 160,
height: 160,
justifyContent: 'flex-start'
},
aawebMedia: {
width: '100%',
height: 320
},
buttonRight: {
justifyContent: 'flex-end'
},
extendedIcon: {
marginRight: theme.spacing.unit
}
})
const Dashboard = ({ classes, createTeamMutation, ...props }) => (
<div className={classes.root}>
<Drawer
variant='permanent'
classes={{
paper: classes.drawerPaper
}}
>
<div className={classes.appBarSpacer} />
<List>{MainDrawerItems}</List>
<Divider />
<List>{SecondaryDrawerItems}</List>
</Drawer>
<main className={classes.content}>
<div className={classes.appBarSpacer} />
<Typography variant='display1' gutterBottom>
Teams
</Typography>
<div className={classes.tableContainer}>
<TeamTable />
</div>
</main>
</div>
)
Dashboard.propTypes = {
classes: PropTypes.object.isRequired,
createTeamMutation: PropTypes.function
}
const CreateTeamDialogWithMutation = graphql(CreateTeamMutation, {
name: 'createTeamMutation' // name of the injected prop: this.props.createTeamMutation...
})(Dashboard)
export default withStyles(styles)(CreateTeamDialogWithMutation)