-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move search to profile page Display only on btn click * Fix bad search params * Remove friend search from search page * Fix styling issues
- Loading branch information
1 parent
a851dd4
commit e5fd1ba
Showing
6 changed files
with
94 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,13 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import PropTypes from 'prop-types'; | ||
import { FormGroup, Label, Input } from 'reactstrap'; | ||
import SearchResults from './SearchResults'; | ||
|
||
import api from '../api'; | ||
|
||
// Renders the search page | ||
export default function Search({ userId, users, search, updateSearch }) { | ||
|
||
// Updates the form with the query | ||
function update(ev) { | ||
const query = $(ev.target).val().toLowerCase(); | ||
updateSearch(query); | ||
} | ||
export default function Search(props) { | ||
|
||
return ( | ||
<div className="page-content"> | ||
<FormGroup> | ||
<Label>Search for Friends</Label> | ||
<Input onChange={update} value={search} type="search" name="search" | ||
placeholder="Enter name or username" /> | ||
</FormGroup> | ||
<SearchResults userId={userId} users={users} search={search} /> | ||
Search | ||
</div> | ||
); | ||
}; | ||
|
||
Search.propTypes = { | ||
userId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
users: PropTypes.array.isRequired, | ||
search: PropTypes.string.isRequired | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters