From dfec88b5b28f4f5a26ef8955b21722c7f309a75f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 26 Sep 2018 14:40:08 +0200 Subject: [PATCH] Search form inside the Referral Program --- client/src/components/Search.js | 41 +++++++++++++++++++++----- client/src/components/UserReferrals.js | 23 ++++----------- client/src/components/UserSearch.js | 11 ++----- 3 files changed, 41 insertions(+), 34 deletions(-) diff --git a/client/src/components/Search.js b/client/src/components/Search.js index 3271649ff..a976d5f83 100644 --- a/client/src/components/Search.js +++ b/client/src/components/Search.js @@ -1,12 +1,37 @@ -import React from 'react' +import React, { Component } from 'react' import UserSearch from './UserSearch' +import {graphql, compose} from 'react-apollo' -const Search = () => { - return ( -
- -
- ) +// Materia UI + +import { withStyles } from '@material-ui/core/styles' +import Paper from '@material-ui/core/Paper' + +const styles = theme => ({ + root: { + flexGrow: 1, + padding: 60, + margin: 2 + } +}) + +class Search extends Component { + + constructor (props) { + super(props) + this.state = { + } + } + render () { + const { classes } = this.props + return ( + + + + ) + } } -export default Search +export default compose( + withStyles(styles) +)(Search) diff --git a/client/src/components/UserReferrals.js b/client/src/components/UserReferrals.js index 815df63d7..80078007a 100644 --- a/client/src/components/UserReferrals.js +++ b/client/src/components/UserReferrals.js @@ -2,6 +2,10 @@ import React, { Component } from 'react' import {graphql, compose} from 'react-apollo' import {getRolesQuery, updateUserMutation, getUsersQuery} from '../queries/queries' +// components + +import UserSearch from './UserSearch' + // Material-ui import { withStyles } from '@material-ui/core/styles' @@ -21,7 +25,6 @@ import Grid from '@material-ui/core/Grid' import Typography from '@material-ui/core/Typography' // Images -import GithubLogo from '../img/github-logo.png' import AALogo from '../img/aa-logo.png' const styles = theme => ({ @@ -290,23 +293,7 @@ class UserReferrals extends Component { overall reputation within the project. - - - Github - - - - - Use the search field to find the who referred you to the project. - - - + diff --git a/client/src/components/UserSearch.js b/client/src/components/UserSearch.js index 4786915f0..f64cc1fa1 100644 --- a/client/src/components/UserSearch.js +++ b/client/src/components/UserSearch.js @@ -13,7 +13,7 @@ import CardMedia from '@material-ui/core/CardMedia'; import Button from '@material-ui/core/Button'; import Typography from '@material-ui/core/Typography'; import Grid from '@material-ui/core/Grid'; -import Paper from '@material-ui/core/Paper'; + import TextField from '@material-ui/core/TextField' // components @@ -23,11 +23,6 @@ import UserProfile from './UserProfile'; import PortraitImage from '../img/portrait.jpg' const styles = theme => ({ - root: { - flexGrow: 1, - padding: 60, - margin: 2, - }, card: { maxWidth: 145, minWidth: 100, @@ -210,7 +205,7 @@ if (this.props.selectButton === true) { render() { const { classes } = this.props; return ( - +
@@ -268,7 +263,7 @@ if (this.props.selectButton === true) { -
+ ); } }