Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed some css #17

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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