diff --git a/client/src/components/AddUserNextButton.js b/client/src/components/AddUserNextButton.js deleted file mode 100644 index 0597a761e..000000000 --- a/client/src/components/AddUserNextButton.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { withStyles } from '@material-ui/core/styles'; -import Button from '@material-ui/core/Button'; - -const styles = theme => ({ - button: { - margin: theme.spacing.unit, - }, - input: { - display: 'none', - }, -}); - -function AddUserNextButton(props) { - const { classes } = props; - return ( -
- -
- ); -} - -AddUserNextButton.propTypes = { - classes: PropTypes.object.isRequired, -}; - -export default withStyles(styles)(AddUserNextButton); diff --git a/client/src/components/Callback.js b/client/src/components/Callback.js deleted file mode 100644 index a7437659d..000000000 --- a/client/src/components/Callback.js +++ /dev/null @@ -1,13 +0,0 @@ -import React, { Component } from 'react' - -class Callback extends Component { - render() { - return ( -
- Authenticating... -
- ) - } -} - -export default Callback diff --git a/client/src/components/LoggedInUserMenu.js b/client/src/components/LoggedInUserMenu.js deleted file mode 100644 index 692af39ff..000000000 --- a/client/src/components/LoggedInUserMenu.js +++ /dev/null @@ -1,98 +0,0 @@ -import React, { Component } from 'react' -import toRenderProps from 'recompose/toRenderProps' -import withState from 'recompose/withState' -import { Link } from 'react-router-dom' -import {compose} from 'react-apollo' - -// Materia UI - -import { withStyles } from '@material-ui/core/styles' -import Button from '@material-ui/core/Button' -import Menu from '@material-ui/core/Menu' -import MenuItem from '@material-ui/core/MenuItem' - -// Images -import GithubLogo from '../img/github-head-negative.png' -import EmailIcon from '../img/email.png' -import ProfileIcon from '@material-ui/icons/Person' -import LogoutIcon from '@material-ui/icons/DirectionsWalk' - -const UserLink = props => -const LogoutLink = props => - -const WithState = toRenderProps(withState('anchorEl', 'updateAnchorEl', null)) - -const styles = { - img: { - margin: 20, - display: 'block', - maxWidth: 15, - maxHeight: 15 - } -} - -class LoggedInUserMenu extends Component { - - constructor (props) { - super(props) - this.state = { - user: {} - } - } - - displayIdentityProvider () { - const { classes } = this.props - switch (this.props.identityProvider) { - case 'github': - return ( - Github - ) - break - case 'auth0': - return ( - Auth0 - ) - break - default: - - } - } - - render () { - const { classes } = this.props - return ( - - {({ anchorEl, updateAnchorEl }) => { - const open = Boolean(anchorEl) - const handleClose = () => { - updateAnchorEl(null) - } - - return ( - - - -
Profile
-
Logout
-
-
- ) - }} -
- ) - } -} - -export default compose( - withStyles(styles) -)(LoggedInUserMenu) diff --git a/client/src/views/footer/index.js b/client/src/views/footer/index.js deleted file mode 100644 index dc9fd728f..000000000 --- a/client/src/views/footer/index.js +++ /dev/null @@ -1,160 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import { NavLink } from 'react-router-dom' -import { withStyles } from '@material-ui/core/styles' -import classNames from 'classnames' -import Typography from '@material-ui/core/Typography' -import Grid from '@material-ui/core/Grid' - -import aalogo from '../../assets/logos/advanced-algos/aa-logo-vert.svg' - -const styles = theme => ({ - '@global': { - body: { - backgroundColor: theme.palette.common.white - } - }, - layout: { - width: 'auto', - marginTop: theme.spacing.unit * 7, - marginLeft: theme.spacing.unit * 3, - marginRight: theme.spacing.unit * 3, - [theme.breakpoints.up(1200 + theme.spacing.unit * 3 * 2)]: { - width: 1200, - marginLeft: 'auto', - marginRight: 'auto' - } - }, - footer: { - borderTop: `1px solid ${theme.palette.divider}`, - padding: `${theme.spacing.unit * 6}px 0` - }, - footerContainer: { - marginRight: theme.spacing.unit * 8, - marginLeft: theme.spacing.unit * 8 - }, - footerLink: { - textDecoration: 'none' - } -}) - -const Footer = ({ classes }) => { - return ( - - ) -} - -Footer.propTypes = { - classes: PropTypes.object.isRequired -} - -export default withStyles(styles)(Footer) diff --git a/client/src/views/index.js b/client/src/views/index.js deleted file mode 100644 index f6e4afc13..000000000 --- a/client/src/views/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// 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, -// About, -// Dashboard, -// Teams, -// theme, -// globalStyles -} diff --git a/client/src/views/navbar/LoggedIn.js b/client/src/views/navbar/LoggedIn.js deleted file mode 100644 index e8408d1b6..000000000 --- a/client/src/views/navbar/LoggedIn.js +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import { graphql } from 'react-apollo' - -import LoggedInMenu from './LoggedInMenu' - -import { GetCurrentMember } from '../../graphql/members' - -import { isDefined } from '../../utils/js-helpers' - -export const LoggedIn = props => { - let { data, user, auth } = props - console.log('LoggedIn :', data, user) - let displayName = 'No Display Name' - - if (isDefined(user.alias)) { - displayName = user.alias - } - - if (isDefined(user.nickname)) { - displayName = user.nickname - } - - if (isDefined(user.firstName)) { - displayName = user.firstName - } - - if (isDefined(user.firstName) && isDefined(user.lastName)) { - displayName = user.firstName + ' ' + user.lastName - } - - return ( -
-

- -

-
- ) -} - -LoggedIn.propTypes = { - data: PropTypes.object, - user: PropTypes.object.isRequired, - auth: PropTypes.object.isRequired -} - -export default graphql(GetCurrentMember)(LoggedIn) // This binds the querty to the component diff --git a/client/src/views/navbar/LoggedInMenu.js b/client/src/views/navbar/LoggedInMenu.js deleted file mode 100644 index 574a8e0ed..000000000 --- a/client/src/views/navbar/LoggedInMenu.js +++ /dev/null @@ -1,77 +0,0 @@ -import React, { Component } from 'react' -import PropTypes from 'prop-types' -import Button from '@material-ui/core/Button' -import Menu from '@material-ui/core/Menu' -import MenuItem from '@material-ui/core/MenuItem' -import { Link } from 'react-router-dom' - -import ProfileIcon from '@material-ui/icons/Person' -import LogoutIcon from '@material-ui/icons/DirectionsWalk' - -const UserLink = props => -const LogoutLink = props => - -class LoggedInUserMenu extends Component { - constructor (props) { - super(props) - - this.handleMenu = this.handleMenu.bind(this) - this.handleClose = this.handleClose.bind(this) - this.handleLogout = this.handleLogout.bind(this) - - this.state = { - menu: null - } - } - - render () { - const { menuLabel } = this.props - return ( - - - - - -
Profile
-
- - -
Logout
-
-
-
- ) - } - - handleMenu (e) { - this.setState({ menu: e.currentTarget }) - } - - handleClose () { - this.setState({ menu: null }) - } - - handleLogout () { - this.props.auth.logout() - this.setState({ menu: null }) - } -} - -LoggedInUserMenu.propTypes = { - menuLabel: PropTypes.string.isRequired, - auth: PropTypes.object.isRequired -} - -export default LoggedInUserMenu diff --git a/client/src/views/navbar/LoggedOut.js b/client/src/views/navbar/LoggedOut.js deleted file mode 100644 index ceb40ac28..000000000 --- a/client/src/views/navbar/LoggedOut.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import Button from '@material-ui/core/Button' - -export const LoggedOut = ({ auth }) => ( -
auth.login()}> - -
-) - -LoggedOut.propTypes = { - auth: PropTypes.object.isRequired -} - -export default LoggedOut // This binds the querty to the component diff --git a/client/src/views/navbar/index.js b/client/src/views/navbar/index.js deleted file mode 100644 index f144156e0..000000000 --- a/client/src/views/navbar/index.js +++ /dev/null @@ -1,141 +0,0 @@ -import React, { Component } from 'react' -import PropTypes from 'prop-types' - -import { withStyles } from '@material-ui/core/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 Button from '@material-ui/core/Button' - -// icons -import HomeIcon from '@material-ui/icons/Home' -import DashboardIcon from '@material-ui/icons/Dashboard' - -import { Link } from 'react-router-dom' - -import { getItem } from '../../utils/local-storage' - -// components -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 => -const HomeLink = props => - -const styles = theme => ({ - '@global': { - body: { - backgroundColor: theme.palette.common.white - } - }, - root: { - flexGrow: 1 - }, - colorDefault: { - color: '#000' - }, - flex: { - flexGrow: 1 - }, - toolbarTitle: { - flex: 1 - }, - menuButton: { - marginLeft: -12, - marginRight: 20 - }, - appBar: { - position: 'relative' - }, - img: { - margin: 20, - display: 'block', - maxWidth: 240, - maxHeight: 48 - } -}) - -class NavBar extends Component { - constructor (props) { - super(props) - this.state = { - user: null, - open: false - } - } - - async componentDidMount () { - const user = await getItem('user') - console.log('NavBar CDM: ', user, this.state) - this.setState({ user }) - } - - render () { - let { classes, auth } = this.props - - let user = JSON.parse(this.state.user) - - return ( -
- - - Advanced Algos - - Teams - - - - - - - - - {this.state.user !== undefined && this.state.user !== null ? ( - - - - - - - ) : ( - - )} - - -
- ) - } -} - -NavBar.propTypes = { - classes: PropTypes.object.isRequired, - auth: PropTypes.object.isRequired -} - -export default withStyles(styles)(NavBar)