Skip to content

Commit

Permalink
bit of stylign on search bar image rezing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
justagoodfriend committed Mar 20, 2024
1 parent 73258e0 commit 8ec56c0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/assets/SearchIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/components/Filters/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const DropDownComponent = ({
label,
}: DropDownComponentProps) => {
const [searchParams, setSearchParams] = useSearchParams();
// is it a good idea to use useState?
const [availableFilters, setAvailableFilters] = useState(dropDownOptions);
const [appliedFilters, setAppliedFilters] = useState<string[]>([]);

Expand Down
30 changes: 21 additions & 9 deletions src/pages/Homepage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactElement, useContext, useEffect, useState } from "react";
import { useSearchParams } from "react-router-dom";
import { LoginContext } from "../App";
import SearchIconSVG from "../assets/SearchIcon.svg";
import {
fetchAllEvents,
fetchMember,
Expand Down Expand Up @@ -149,21 +150,32 @@ const Homepage = (): ReactElement => {
});

// also fallback on if we apply too many filters -> No Results Component
/*
<img
src={MeatballMenuSVG}
alt="Menu svg"
aria-label="Open Event Card details"
/>
*/

return (
<div className="lg:flex lg:flex-col lg:justify-between lg:items-start lg:max-w-[70%]">
<h1 className="hidden lg:block lg:m-6 lg:mb-3 section-heading">
EVENTS
</h1>
<div className="flex w-full justify-center">
<input
className="ml-6 border"
placeholder="Search Events"
value={searchQuery}
onChange={(e) => {
setSearchQuery(e.target.value);
}}
/>
<div className="flex w-full m-6 gap-x-4">
<div className=" flex ml-4 border-2 border-attendance-grey rounded-md max-h-9">
{/*TODO: this search Icon size keeps resizing fix */}
<img className="mx-2 max-h-8" src={SearchIconSVG}></img>

Check warning on line 169 in src/pages/Homepage.tsx

View workflow job for this annotation

GitHub Actions / lint

img elements must have an alt prop, either with meaningful text, or an empty string for decorative images
<input
className="py-0.5 text-lg w-80 font-medium text-attendance-grey bg-search-icon "
placeholder="Search Events"
value={searchQuery}
onChange={(e) => {
setSearchQuery(e.target.value);
}}
/>
</div>
<DropDownComponent
dropDownOptions={dropDownOptions}
setDropDownOptions={setDropDownOptions}
Expand Down

0 comments on commit 8ec56c0

Please sign in to comment.