-
-
- {MainDrawerItems}
-
- {SecondaryDrawerItems}
-
-
-
-
-
-
- Settings
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Goodester
-
- 09.15.2018
-
-
- Members:6
-
-
- Now recruiting!
-
-
-
-
-
-
-
-
-
-
-
-
-
- Goodester
-
- 09.15.2018
-
-
- Members:6
-
-
- Now recruiting!
-
-
-
-
-
-
-
-
-
-
-
-
- Notifications
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+export const Settings = ({ classes }) => (
+
)
-Dashboard.propTypes = {
- classes: PropTypes.object.isRequired,
- createTeamMutation: PropTypes.function
+Settings.propTypes = {
+ classes: PropTypes.object.isRequired
}
-const CreateTeamDialogWithMutation = graphql(CreateTeamMutation, {
- name: 'createTeamMutation' // name of the injected prop: this.props.createTeamMutation...
-})(Dashboard)
-
-export default withStyles(styles)(CreateTeamDialogWithMutation)
+export default withStyles(styles)(Settings)
diff --git a/client/src/views/dashboard/teams.js b/client/src/views/dashboard/teams.js
deleted file mode 100644
index 9d223e372..000000000
--- a/client/src/views/dashboard/teams.js
+++ /dev/null
@@ -1,111 +0,0 @@
-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 }) => (
-
-
-
- {MainDrawerItems}
-
- {SecondaryDrawerItems}
-
-
-
-
- Teams
-
-
-
-
-
-
-)
-
-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)
diff --git a/client/src/views/footer/index.js b/client/src/views/footer/index.js
index a7abff6b7..ecbd0c594 100644
--- a/client/src/views/footer/index.js
+++ b/client/src/views/footer/index.js
@@ -55,26 +55,28 @@ const Footer = ({ classes }) => {
Home
-
+
Teams
-
+
About
-
- Support
-
-
+
+
+ Support
+
+
+
Documentation
-
+
Telegram
diff --git a/client/src/views/index.js b/client/src/views/index.js
index a1e5c1f8a..8ff455e85 100644
--- a/client/src/views/index.js
+++ b/client/src/views/index.js
@@ -2,8 +2,10 @@ import NavBar from './navbar'
import Footer from './footer'
import Callback from './callback'
import Home from './home'
+import About from './about'
import Dashboard from './dashboard'
+import Teams from './teams'
import { theme, globalStyles } from './theme'
-export { NavBar, Footer, Callback, Home, Dashboard, theme, globalStyles }
+export { NavBar, Footer, Callback, Home, About, Dashboard, Teams, theme, globalStyles }
diff --git a/client/src/views/navbar/index.js b/client/src/views/navbar/index.js
index 34fd52f5f..ca33893d2 100644
--- a/client/src/views/navbar/index.js
+++ b/client/src/views/navbar/index.js
@@ -20,6 +20,8 @@ import { getItem } from '../../utils/local-storage'
import { LoggedIn } from './LoggedIn'
import { LoggedOut } from './LoggedOut'
+import AALogo from '../../assets/logos/advanced-algos/aa-logo-dark.svg'
+
const AboutLink = props =>
const TeamsLink = props =>
const DashboardLink = props =>
@@ -34,6 +36,9 @@ const styles = theme => ({
root: {
flexGrow: 1
},
+ colorDefault: {
+ color: '#000'
+ },
flex: {
flexGrow: 1
},
@@ -46,6 +51,12 @@ const styles = theme => ({
},
appBar: {
position: 'relative'
+ },
+ img: {
+ margin: 20,
+ display: 'block',
+ maxWidth: 240,
+ maxHeight: 48
}
})
@@ -71,8 +82,9 @@ class NavBar extends Component {
return (
-
+
+
-
-
+
+
{this.state.user !== undefined && this.state.user !== null ? (
diff --git a/client/src/views/teams/components/TeamsDetails.js b/client/src/views/teams/components/TeamsDetails.js
new file mode 100644
index 000000000..5c590a54b
--- /dev/null
+++ b/client/src/views/teams/components/TeamsDetails.js
@@ -0,0 +1,89 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+
+import CssBaseline from '@material-ui/core/CssBaseline'
+import Typography from '@material-ui/core/Typography'
+import Paper from '@material-ui/core/Paper'
+import { withStyles } from '@material-ui/core/styles'
+
+import { Link } from 'react-router-dom'
+
+const styles = theme => ({
+ root: {
+ flexGrow: 1
+ },
+ '@global': {
+ body: {
+ backgroundColor: theme.palette.common.white
+ }
+ },
+ layout: {
+ width: 'auto',
+ marginLeft: theme.spacing.unit * 3,
+ marginRight: theme.spacing.unit * 3,
+ marginBottom: theme.spacing.unit * 6,
+ [theme.breakpoints.up(900 + theme.spacing.unit * 3 * 2)]: {
+ width: 900,
+ marginLeft: 'auto',
+ marginRight: 'auto'
+ }
+ },
+ paper: {
+ marginTop: theme.spacing.unit * 3,
+ marginBottom: theme.spacing.unit * 3,
+ padding: theme.spacing.unit * 2,
+ [theme.breakpoints.up(600 + theme.spacing.unit * 3 * 2)]: {
+ marginTop: theme.spacing.unit * 6,
+ marginBottom: theme.spacing.unit * 6,
+ padding: theme.spacing.unit * 3
+ }
+ },
+ heroContent: {
+ maxWidth: 600,
+ margin: '0 auto',
+ padding: `${theme.spacing.unit * 8}px 0 ${theme.spacing.unit * 6}px`
+ }
+})
+
+const TeamsDetails = ({ classes, team }) => (
+
+
+
+
+
+ ← Back to all teams
+
+ {team.name}
+
+
+ {team.createdAt}
+
+
+ Members: {team.members.length}
+
+
+ Team Admin:
+ {
+ team.members.map(member => {
+ if (member.role === 'OWNER' || member.role === 'ADMIN') {
+ return member.member.alias
+ }
+ })
+ }
+
+
+
+
+
+)
+TeamsDetails.propTypes = {
+ classes: PropTypes.object.isRequired,
+ team: PropTypes.object.isRequired
+}
+
+export default withStyles(styles)(TeamsDetails)
diff --git a/client/src/views/teams/components/TeamsItem.js b/client/src/views/teams/components/TeamsItem.js
new file mode 100644
index 000000000..6b2e20bb1
--- /dev/null
+++ b/client/src/views/teams/components/TeamsItem.js
@@ -0,0 +1,55 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+
+import Grid from '@material-ui/core/Grid'
+import Card from '@material-ui/core/Card'
+import CardActionArea from '@material-ui/core/CardActionArea'
+import CardActions from '@material-ui/core/CardActions'
+import CardContent from '@material-ui/core/CardContent'
+import CardMedia from '@material-ui/core/CardMedia'
+import Button from '@material-ui/core/Button'
+import Typography from '@material-ui/core/Typography'
+
+import { Link } from 'react-router-dom'
+
+export const TeamsItem = ({ classes, team }) => (
+
+
+
+
+
+
+ {team.name}
+
+
+ {team.createdAt}
+
+
+ Members: 1
+
+
+ Now recruiting!
+
+
+
+
+
+
+
+
+
+
+)
+
+TeamsItem.propTypes = {
+ classes: PropTypes.object.isRequired,
+ team: PropTypes.object.isRequired
+}
+
+export default TeamsItem
diff --git a/client/src/views/teams/components/TeamsList.js b/client/src/views/teams/components/TeamsList.js
new file mode 100644
index 000000000..64493cdff
--- /dev/null
+++ b/client/src/views/teams/components/TeamsList.js
@@ -0,0 +1,128 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+import { Query } from 'react-apollo'
+
+import Typography from '@material-ui/core/Typography'
+import Grid from '@material-ui/core/Grid'
+import { withStyles } from '@material-ui/core/styles'
+
+import GET_ALL_TEAMS_QUERY from '../../../graphql/teams/GetAllTeamsQuery'
+
+import { isEmpty } from '../../../utils/js-helpers'
+
+import TeamsItem from './TeamsItem'
+import TeamsDetails from './TeamsDetails'
+
+const styles = theme => ({
+ heroContent: {
+ maxWidth: 600,
+ margin: '0 auto',
+ padding: `${theme.spacing.unit * 8}px 0 ${theme.spacing.unit * 6}px`
+ },
+ cardGrid: {
+ padding: `${theme.spacing.unit * 8}px 0`
+ },
+ card: {
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column'
+ },
+ cardMedia: {
+ paddingTop: '56.25%' // 16:9
+ },
+ cardContent: {
+ flexGrow: 1
+ },
+ buttonRight: {
+ justifyContent: 'flex-end'
+ }
+})
+
+export const TeamsList = ({ classes, match }) => (
+
+ {({ loading, error, data }) => {
+ console.log('GET_ALL_TEAMS: ', loading, error, data, match)
+ let slug = null
+ if (!isEmpty(match.params) && match.params.slug) slug = match.params.slug
+
+ let errors
+ let queryLoader
+ if (error) {
+ errors = error.graphQLErrors.map(({ message }, i) => {
+ return (
+
+ {message}
+
+ )
+ })
+ }
+ if (!loading && !error) {
+ if (data.teams.edges.length > 0) {
+ if (slug !== null) {
+ return (
+
+ {!loading &&
+ data.teams.edges.map(team => {
+ if (team.node.slug === slug) {
+ return (
+
+ )
+ }
+ })}
+ {queryLoader}
+ {errors}
+
+ )
+ } else {
+ return (
+
+
+
+ Teams
+
+
+
+ {!loading &&
+ data.teams.edges.map(team => (
+
+ ))}
+ {queryLoader}
+ {errors}
+
+
+ )
+ }
+ }
+ } else {
+ return (
+
+
+ Loading...
+
+ {queryLoader}
+ {errors}
+
+ )
+ }
+ }}
+
+)
+
+TeamsList.propTypes = {
+ classes: PropTypes.object.isRequired,
+ match: PropTypes.object
+}
+
+export default withStyles(styles)(TeamsList)
diff --git a/client/src/views/teams/index.js b/client/src/views/teams/index.js
new file mode 100644
index 000000000..3c2087d83
--- /dev/null
+++ b/client/src/views/teams/index.js
@@ -0,0 +1,45 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+
+import CssBaseline from '@material-ui/core/CssBaseline'
+import { withStyles } from '@material-ui/core/styles'
+
+import TeamsList from './components/TeamsList'
+
+const styles = theme => ({
+ root: {
+ flexGrow: 1
+ },
+ '@global': {
+ body: {
+ backgroundColor: theme.palette.common.white
+ }
+ },
+ layout: {
+ width: 'auto',
+ marginLeft: theme.spacing.unit * 3,
+ marginRight: theme.spacing.unit * 3,
+ marginBottom: theme.spacing.unit * 6,
+ [theme.breakpoints.up(900 + theme.spacing.unit * 3 * 2)]: {
+ width: 900,
+ marginLeft: 'auto',
+ marginRight: 'auto'
+ }
+ }
+})
+
+const Teams = ({ classes, match }) => (
+
+
+
+
+
+
+)
+
+Teams.propTypes = {
+ classes: PropTypes.object.isRequired,
+ match: PropTypes.object
+}
+
+export default withStyles(styles)(Teams)
diff --git a/client/src/views/theme.js b/client/src/views/theme.js
index 4a2e00ee8..26043dfc0 100644
--- a/client/src/views/theme.js
+++ b/client/src/views/theme.js
@@ -1,10 +1,10 @@
import { createMuiTheme } from '@material-ui/core/styles'
import indigo from '@material-ui/core/colors/indigo'
-import red from '@material-ui/core/colors/red'
+// import red from '@material-ui/core/colors/red'
export const theme = createMuiTheme({
palette: {
- primary: red,
+ primary: { main: '#303036' },
secondary: indigo
},
typography: {
diff --git a/docs/CodeStyle.md b/docs/CodeStyle.md
new file mode 100644
index 000000000..483afda50
--- /dev/null
+++ b/docs/CodeStyle.md
@@ -0,0 +1,5 @@
+# Code Styling and Formatting
+
+```
+npm install --save-dev eslint-config-standard eslint-config-standard-react eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node eslint-plugin-react
+```