-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca665bc
commit dfa6c56
Showing
6 changed files
with
111 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import TechnologyDropdown from '@/components/TechnologyDropdown'; | ||
import { Filters, FilterType } from '@/types/schema'; | ||
import { DropIcon } from '../../assets/Dropdown-Icons/icons'; | ||
import { | ||
FilterBackgroundStyles, | ||
FilterButtonStyles, | ||
IconStyle, | ||
} from './styles'; | ||
|
||
interface FilterProps { | ||
filter: FilterType; | ||
isActive: boolean; | ||
selectedFilters: Filters; | ||
onTechnologyChange: (options: string[]) => void; | ||
handleButtonClick: (filter: FilterType) => void; | ||
} | ||
|
||
export default function Filter({ | ||
filter, | ||
isActive, | ||
selectedFilters, | ||
onTechnologyChange, | ||
handleButtonClick, | ||
}: FilterProps) { | ||
return ( | ||
<FilterBackgroundStyles isActive={isActive}> | ||
{isActive ? ( | ||
filter.id === 'technology' ? ( | ||
<TechnologyDropdown | ||
selectedTechnologies={selectedFilters.technology} | ||
setSelectedTechnologies={onTechnologyChange} | ||
handleButtonClick={handleButtonClick} | ||
icon={filter.icon} | ||
label={filter.label} | ||
currFilter={filter} | ||
/> | ||
) : // Add other filter dropdown components here | ||
null | ||
) : ( | ||
<FilterButtonStyles onClick={() => handleButtonClick(filter)}> | ||
<IconStyle>{filter.icon}</IconStyle> | ||
{filter.label} | ||
<DropIcon /> | ||
</FilterButtonStyles> | ||
)} | ||
</FilterBackgroundStyles> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import styled from 'styled-components'; | ||
import { FilterHeadingUnused } from '@/styles/texts'; | ||
|
||
export const FilterBackgroundStyles = styled.div<{ isActive: boolean }>` | ||
margin-right: 2%; | ||
top: 1.5%; | ||
right: 1.5%; | ||
background: linear-gradient( | ||
180deg, | ||
rgba(250, 250, 250, 0.32) 0%, | ||
rgba(238, 238, 238, 0.65) 100% | ||
); | ||
backdrop-filter: blur(7.5px); | ||
padding: 0.35rem 0.35rem; | ||
z-index: 5; | ||
border: 0.05rem solid #fff; | ||
margin-top: 1.5%; | ||
max-height: ${({ isActive }) => (isActive ? 'auto' : '2rem')}; | ||
border-radius: ${({ isActive }) => (isActive ? '0.5rem' : '6.25rem')}; | ||
transition: height 0.5s ease-in-out; | ||
`; | ||
|
||
export const FilterButtonStyles = styled.button` | ||
${FilterHeadingUnused} | ||
position: relative; | ||
background: #fff; | ||
border: none; | ||
border-radius: 6.25rem; | ||
cursor: pointer; | ||
line-height: normal; | ||
display: flex; | ||
align-items: center; | ||
gap: 0.75rem; | ||
padding: 0.5rem 1rem; | ||
color: rgba(46, 58, 89, 0.85); | ||
`; | ||
|
||
export const IconStyle = styled.div` | ||
align-self: center; | ||
width: 0.8rem; | ||
height: 0.8rem; | ||
`; |
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