Skip to content

Commit

Permalink
Merge pull request #17 from feliciahmq/reactive
Browse files Browse the repository at this point in the history
fixed some css
  • Loading branch information
vanesssalai authored Jun 24, 2024
2 parents 8e4ed5d + 8150a80 commit bacfdb2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/components/header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function Header() {
<li><Link to="/account">Register/ Login</Link></li>
)
) : (
currentUser ? (
<>
<div className='header-dropdown' onClick={handleChats}>
<FaComment cursor="pointer" />
Expand All @@ -135,6 +136,9 @@ function Header() {
<p>profile</p>
</div>
</>
) : (
<li><Link to="/account">Register/ Login</Link></li>
)
)}
</ul>
</nav>
Expand Down
20 changes: 10 additions & 10 deletions src/components/searchbar/Searchbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { useNavigate } from 'react-router-dom';
import './Searchbar.css';

const SearchBar = () => {
const [query, setQuery] = useState('');
const navigate = useNavigate();
const [query, setQuery] = useState('');
const navigate = useNavigate();

const handleInputChange = (e) => {
const value = e.target.value;
setQuery(value);
};
const handleInputChange = (e) => {
const value = e.target.value;
setQuery(value);
};

const handleSearch = (e) => {
e.preventDefault();
navigate(`/search?query=${query}`);
};
const handleSearch = (e) => {
e.preventDefault();
navigate(`/search?query=${query}`);
};

return (
<div className="search-bar-container">
Expand Down
3 changes: 2 additions & 1 deletion src/pages/search/SearchPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ function SearchPage() {
if (!query) return products;

const searchQuery = query.toLowerCase();
console.log(searchQuery);
return products.filter(product => {
const name = product.name ? product.name.toLowerCase() : '';
const name = product.title ? product.title.toLowerCase() : '';
const productType = product.productType ? product.productType.toLowerCase() : '';
const description = product.description ? product.description.toLowerCase() : '';
const username = product.username ? product.username.toLowerCase() : '';
Expand Down

0 comments on commit bacfdb2

Please sign in to comment.