From cb365c2920315683f2a9f378b90fd6ca21452c4e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 27 Sep 2018 12:39:53 +0200 Subject: [PATCH] Cleaning the code --- client/src/App.js | 2 +- client/src/components/Home.js | 1 - client/src/components/Search.js | 2 +- client/src/components/UserList.js | 2 ++ client/src/components/UserProfile.js | 13 +++++-------- client/src/components/UserReferrals.js | 10 ++-------- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index ded1338cf..fc381cad5 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -11,7 +11,7 @@ import { Route, BrowserRouter, Switch } from 'react-router-dom' // Material UI -import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles' +import { MuiThemeProvider } from '@material-ui/core/styles' import theme from './theme' // Components diff --git a/client/src/components/Home.js b/client/src/components/Home.js index 6983aa808..154667baf 100644 --- a/client/src/components/Home.js +++ b/client/src/components/Home.js @@ -2,7 +2,6 @@ import React, { Component } from 'react' import { compose } from 'recompose' import { withStyles } from '@material-ui/core/styles' import {LineChart} from 'react-easy-chart' -import Paper from '@material-ui/core/Paper' import Grid from '@material-ui/core/Grid' import Typography from '@material-ui/core/Typography' import CssBaseline from '@material-ui/core/CssBaseline' diff --git a/client/src/components/Search.js b/client/src/components/Search.js index a976d5f83..90f15f758 100644 --- a/client/src/components/Search.js +++ b/client/src/components/Search.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import UserSearch from './UserSearch' -import {graphql, compose} from 'react-apollo' +import {compose} from 'react-apollo' // Materia UI diff --git a/client/src/components/UserList.js b/client/src/components/UserList.js index a9db8e7a1..9c28d8589 100644 --- a/client/src/components/UserList.js +++ b/client/src/components/UserList.js @@ -143,7 +143,9 @@ class UserList extends Component { + + diff --git a/client/src/components/UserProfile.js b/client/src/components/UserProfile.js index 65bf487af..438e5f61a 100644 --- a/client/src/components/UserProfile.js +++ b/client/src/components/UserProfile.js @@ -24,15 +24,14 @@ const styles = theme => ({ margin: 2 }, card: { - maxWidth: 800, - minWidth: 800, + width: '80%', paddingTop: '30' }, media: { height: 0, paddingTop: '56.25%', // 16:9, marginTop: '30', - minWidth: 800 + minWidth: '80%' }, grid: { paddingTop: '30', @@ -94,11 +93,9 @@ class UserProfile extends Component { render () { const { classes } = this.props return ( - - - {this.displayUserProfile()} - - + + {this.displayUserProfile()} + ) } } diff --git a/client/src/components/UserReferrals.js b/client/src/components/UserReferrals.js index 744a80c9d..d86c4bba1 100644 --- a/client/src/components/UserReferrals.js +++ b/client/src/components/UserReferrals.js @@ -10,9 +10,6 @@ import UserProfile from './UserProfile' // Material-ui import { withStyles } from '@material-ui/core/styles' -import MenuItem from '@material-ui/core/MenuItem' -import TextField from '@material-ui/core/TextField' -import Button from '@material-ui/core/Button' import Paper from '@material-ui/core/Paper' import Typography from '@material-ui/core/Typography' @@ -59,9 +56,7 @@ class UserReferrals extends Component { } userSelected (referrerUser) { - console.log(user) - - this.setState({referrer: referrerUser.id}) + this.setState({referrerId: referrerUser.id}) this.props.updateReferrerMutation({ variables: { @@ -81,9 +76,8 @@ class UserReferrals extends Component { renderMode () { const { classes } = this.props - const {user} = this.props.data - if (this.state.referrerId !== '') { + if (this.state.referrerId !== null) { return (