-
Notifications
You must be signed in to change notification settings - Fork 0
Fix filters and adjust filter panel styling #70
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
be2bb98
fix filters not working on mobile
mirmirmirr 6681b31
hide results on mobile if filter is open
mirmirmirr 3dc9a1c
wrap filter section on mobile
mirmirmirr fb8ab3f
adjust chosen tag location
mirmirmirr 44dbdf0
truncate filter section
mirmirmirr 2db667b
add scrollbar to filter panel
mirmirmirr 56492f9
add setShowFilter dependency
mirmirmirr 245bb2a
add TAG_THRESHOLD variable
mirmirmirr f4ed85f
added aria tags
mirmirmirr 574d16f
rename searchbar
mirmirmirr 004988c
adjust filter panels styling and colors
mirmirmirr 34ef944
standardize filterSections to singular
mirmirmirr 27f83d6
adjust the courses panel to grow with the container
mirmirmirr d633758
convert regular list to FilterData list and add tooltip
mirmirmirr d5158fe
add filter panel color palette
mirmirmirr c3ee4b6
define names for colors
mirmirmirr b7f083a
update tag colors
mirmirmirr bc16583
new colors!
mirmirmirr 0a6717a
change popup background color
mirmirmirr acebe2f
condense into one global Tag component
mirmirmirr 43206bf
remove double remove filter
mirmirmirr 35d7c6c
update department filter tags
mirmirmirr 686130d
update for mobile styling
mirmirmirr 402c7f5
change scrollbar color
mirmirmirr ec18bc2
add spacer
mirmirmirr 0196fee
Merge branch 'main-preview' into 60-mobile-filters-dont-work
mirmirmirr f574d2f
Merge branch 'main-preview' into 60-mobile-filters-dont-work
mirmirmirr 5c41221
update colors
mirmirmirr 50e282b
fix colors
mirmirmirr e04397a
add back steelblue
mirmirmirr e3dfb94
prettier
mirmirmirr 90b7156
Merge branch 'main-preview' into 60-mobile-filters-dont-work
mirmirmirr d3a32d8
add more bottom filter spacing
mirmirmirr 56f6186
adjust toolbar visibility
mirmirmirr ab4bd04
prettier check
mirmirmirr d7e28bb
add nav button border
mirmirmirr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
54 changes: 54 additions & 0 deletions
54
src/components/SearchBar/FilterPanel/FilterSectionChild.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import React, { useState } from "react"; | ||
| import { | ||
| FilterCategory, | ||
| FilterData, | ||
| } from "../../../types/interfaces/Filters.interface"; | ||
|
|
||
| interface FilterSectionProps { | ||
| sectionName: FilterCategory; | ||
| tags: FilterData[]; | ||
| selected: string[]; | ||
| toggleFilter: (filter: FilterData) => void; | ||
| } | ||
|
|
||
| const FilterSectionChild: React.FC<FilterSectionProps> = ({ | ||
| sectionName, | ||
| tags, | ||
| selected, | ||
| toggleFilter, | ||
| }) => { | ||
| const [isExpanded, setIsExpanded] = useState(false); | ||
|
|
||
| return ( | ||
| <div className="relative"> | ||
| <h3 | ||
| className="font-semibold mb-1 hover:cursor-pointer hover:bg-carpipink/10 rounded-full px-4" | ||
| onMouseEnter={() => setIsExpanded(true)} | ||
| onMouseLeave={() => setIsExpanded(false)} | ||
| > | ||
| {sectionName} | ||
| </h3> | ||
|
|
||
| {isExpanded && ( | ||
| <div className="absolute left-full top-0 z-10 p-2 ml-2 bg-darkblue text-carpipink shadow-lg border rounded-2xl border-darkblue flex flex-wrap w-xl"> | ||
| {tags.map((tag) => ( | ||
| <button | ||
| key={tag.id} | ||
| className={`hover:bg-darkblue/10 hover:cursor-pointer rounded-2xl px-3 py-1 text-sm mr-1 mb-1 flex-none transition-colors | ||
| ${ | ||
| selected.includes(tag.code) | ||
| ? "bg-darkblue text-carpipink hover:bg-darkblue/70 border border-carpipink" | ||
| : "border border-carpipink" | ||
| }`} | ||
| onClick={() => toggleFilter(tag)} | ||
| > | ||
| {tag.value} | ||
| </button> | ||
| ))} | ||
| </div> | ||
| )} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default FilterSectionChild; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.