Skip to content

Commit

Permalink
Merge branch 'development' into 29th
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryCerasa committed Mar 29, 2019
2 parents 922640d + 2b2baf8 commit bc03931
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 83 deletions.
7 changes: 5 additions & 2 deletions src/components/groups/createGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from 'axios'
import 'bulma'
import Auth from '../../lib/auth'

let myArray


class CreateGroup extends React.Component {
constructor() {
Expand Down Expand Up @@ -58,6 +58,7 @@ class CreateGroup extends React.Component {
}

render() {
console.log(this.state.data.usersAssigned)
const accepted = this.state.accepted.data
return(
<div className="column is-one-third">
Expand Down Expand Up @@ -89,7 +90,7 @@ class CreateGroup extends React.Component {
e.target.classList.toggle('user')
e.preventDefault()
this.assignUsers(user._id)
myArray = this.state.data.usersAssigned.filter(function( obj ) {
let myArray = this.state.data.usersAssigned.filter(function( obj ) {
return obj._id !== e.target.name
})

Expand All @@ -99,7 +100,9 @@ class CreateGroup extends React.Component {
this.setState({toggle: !this.state.toggle })
}}
>{user.friend.username}

</a>

</div>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Nav extends React.Component {
<span aria-hidden="true"></span>
</a>
</div>
<div id="navbarMenu" className="navbar-menu">
<div className={`navbar-menu ${this.state.navbarOpen ? 'is-active' : ''}`}>
<div className="navbar-end">
{!Auth.isAuthenticated() && <Link to="/about" className="navbar-item">About</Link>}
{!Auth.isAuthenticated() && <Link to="/pricing" className="navbar-item">Pricing</Link>}
Expand Down
106 changes: 55 additions & 51 deletions src/components/users/myProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import axios from 'axios'
import Auth from '../../lib/auth'
import { Link } from 'react-router-dom'

import UsersIndex from './usersIndex'

class Users extends React.Component {
constructor() {
super()
Expand Down Expand Up @@ -46,80 +48,82 @@ class Users extends React.Component {
const user = this.state.user.data
const pending = this.state.pending.data
const accepted = this.state.accepted.data
const tasks = this.state.tasks.data
return(
<div className="container">
<div className="section">
<div className="columns is-multiline">
<div className="rows is-multiline">
{user &&
<div className="column is-one-third">
<div className="card-large box">
<div className="is-one-third">
<div >
<div className="card-header-title is-centered is-size-3">
Your Profile
Me
</div>
<hr />
<div className="card-content">
<div className="content">
<p><strong>Name: </strong>{user.name}</p>
<p><strong>Email Address: </strong>{user.email}</p>
<p><strong>Username: </strong>{user.username}</p>
<p><strong>Newsletter: </strong>{user.newsletter}</p>
<p><strong>Email Address: </strong>{user.email}</p>
</div>
<hr />
<p><strong>Created Date: </strong>{user.createdAt}</p>
<p><strong>User ID: </strong>{user._id}</p>
</div>
</div>
</div>
}
{pending && pending.map(user => (
<div key={user.friend._id} className="column is-one-third">
<div className="card-large box">
<div className="card-header-title is-centered is-size-3">
Pending friend
</div>
<hr />
<div className="card-content">
<div className="content">
<p><strong>Name: </strong>{user.friend.name}</p>
<p><strong>Email Address: </strong>{user.friend.email}</p>
<p><strong>Username: </strong>{user.friend.username}</p>
<p><strong>Newsletter: </strong>{user.friend.newsletter}</p>
</div>
<hr />
<p><strong>Created Date: </strong>{user.friend.createdAt}</p>
<p><strong>User ID: </strong>{user.friend._id}</p>
<Link to={`/users/${user._id}`}>Add</Link>
</div>
</div>
<nav className="panel">
<p className="panel-heading">
Friend Requests
</p>
<div className="panel-block">
<p className="control has-icons-left">
<span className="icon is-small is-left">
</span>
</p>
</div>
))}
{accepted && accepted.map(user => (
<div key={user.friend._id} className="column is-one-third">
<div className="card-large box">
<div className="card-header-title is-centered is-size-3">
Accepted friend
</div>
<hr />
<div className="card-content">
<div className="content">
<p><strong>Name: </strong>{user.friend.name}</p>
<p><strong>Email Address: </strong>{user.friend.email}</p>
<p><strong>Username: </strong>{user.friend.username}</p>
<p><strong>Newsletter: </strong>{user.friend.newsletter}</p>
</div>
<hr />
<p><strong>Created Date: </strong>{user.friend.createdAt}</p>
<p><strong>User ID: </strong>{user.friend._id}</p>
</div>
</div>
{pending && pending.map(user => (
<a key={user.friend._id} className="panel-block is-active">
<span className="panel-icon">
<i className="fas fa-user" aria-hidden="true"></i>
</span>
<p><strong>{`${user.friend.username} `}<br/></strong></p>
<p>{` ${user.friend.email} `}<br/></p>
<Link to={`/users/${user._id}`}>add</Link>
</a>
))}
<div className="panel-block">
</div>
</nav>
<nav className="panel">
<p className="panel-heading">
Friends
</p>
<div className="panel-block">
<p className="control has-icons-left">
<span className="icon is-small is-left">
</span>
</p>
</div>
))}
{accepted && accepted.map(user => (
<a key={user.friend._id} className="panel-block is-active">
<span className="panel-icon">
<i className="fas fa-user" aria-hidden="true"></i>
</span>
<p><strong>{`${user.friend.username} `}<br/></strong></p>
<p>{` ${user.friend.email} `}<br/></p>
</a>
))}
<div className="panel-block">
</div>
</nav>
<UsersIndex />
</div>
</div>

</div>

)
}
}



export default Users
52 changes: 23 additions & 29 deletions src/components/users/usersIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,30 @@ class Users extends React.Component {
render() {
const users = this.state.users.data
return(
<div className="container">
<div className="section">
<div className="columns is-multiline">
{users && users.map(user =>
<div key={user._id} className="column is-one-third">
<div className="card-large box">
<div className="card-header-title is-centered is-size-3">
Friend?
</div>
<hr />
<div className="card-content">
<div className="content">
<p><strong>Name: </strong>{user.name}</p>
<p><strong>Email Address: </strong>{user.email}</p>
<p><strong>Username: </strong>{user.username}</p>
</div>
<hr />
<p><strong>Created Date: </strong>{user.createdAt}</p>
<p><strong>User ID: </strong>{user._id}</p>
<hr />
<footer className="card-footer">
<Link className="button is-primary subtitle is-6 is-fullwidth" to={`/users/${user._id}`}>Request</Link>
</footer>
</div>
</div>
</div>
)}
</div>
<nav className="panel">
<p className="panel-heading">
Find Friends
</p>
<div className="panel-block">
<p className="control has-icons-left">
<span className="icon is-small is-left">
</span>
</p>
</div>
</div>
{users && users.map(user =>
<a key={user._id} className="panel-block is-active">
<span className="panel-icon">
<i className="fas fa-user" aria-hidden="true"></i>
</span>
<p><strong>{`${user.username} `}<br/></strong></p>
<p>{` ${user.email} `}<br/></p>
<Link to={`/users/${user._id}`}>Request</Link>
</a>
)}
<div className="panel-block">
</div>
</nav>

)
}
}
Expand Down

0 comments on commit bc03931

Please sign in to comment.