-
Notifications
You must be signed in to change notification settings - Fork 0
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
6bec812
commit 1f1e2f1
Showing
20 changed files
with
134 additions
and
53 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
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,22 @@ | ||
.AppContainer { | ||
background-color: #f1f3f6; | ||
z-index: -1; | ||
min-height: 100vh; | ||
} | ||
|
||
hr { | ||
border-top: 1px solid rgba(96, 96, 96, 0.217); | ||
margin: 15px 0 0 0; | ||
} | ||
|
||
.sidebar section { | ||
margin: 10px 0; | ||
} | ||
|
||
.sidebar section input { | ||
margin: 8px 0; | ||
} | ||
|
||
.sidebar section label { | ||
padding: 0 10px; | ||
} |
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 was deleted.
Oops, something went wrong.
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
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
22 changes: 22 additions & 0 deletions
22
client/src/layouts/filters/components/applied-filters/AppliedFilters.module.css
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,22 @@ | ||
.filter-list { | ||
display: flex; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.filter-list .filter-item { | ||
margin: 2px 4px; | ||
padding: 0.4rem; | ||
background-color: #e0e0e0; | ||
font-size: 14px; | ||
cursor: pointer; | ||
} | ||
|
||
.filter-item:hover { | ||
text-decoration: line-through; | ||
} | ||
|
||
.no-filter { | ||
font-style: italic; | ||
color: grey; | ||
} |
40 changes: 40 additions & 0 deletions
40
client/src/layouts/filters/components/applied-filters/AppliedFilters.tsx
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,40 @@ | ||
import { memo } from 'react' | ||
import { useSearchParams } from 'react-router-dom' | ||
import styles from './AppliedFilters.module.css' | ||
|
||
function AppliedFilters() { | ||
const [searchParams, setSearchParams] = useSearchParams() | ||
const params = [] | ||
|
||
for (const entry of searchParams.entries()) { | ||
params.push(entry) | ||
} | ||
|
||
const handleRemoveFilter = (key: string) => { | ||
searchParams.delete(key) | ||
setSearchParams(searchParams) | ||
} | ||
|
||
return ( | ||
<section> | ||
<ul className={styles.filterList}> | ||
{params.length > 0 ? ( | ||
params.map(([key, value]) => ( | ||
<li | ||
className={styles.filterItem} | ||
key={key} | ||
onClick={() => handleRemoveFilter(key)} | ||
> | ||
✕ {value} | ||
</li> | ||
)) | ||
) : ( | ||
<li className={styles.noFilter}>No filters applied</li> | ||
)} | ||
</ul> | ||
</section> | ||
) | ||
} | ||
|
||
const MemoizedAppliedFilters = memo(AppliedFilters) | ||
export default MemoizedAppliedFilters |
6 changes: 6 additions & 0 deletions
6
client/src/layouts/filters/components/clear-filter/ClearFilter.module.css
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,6 @@ | ||
.clear-btn { | ||
all: unset; | ||
cursor: pointer; | ||
color: #2874f0; | ||
font-size: 14px; | ||
} |
6 changes: 4 additions & 2 deletions
6
...ayouts/filters/components/ClearFilter.tsx → ...s/components/clear-filter/ClearFilter.tsx
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import useHandleDispatch from '@/hooks/useHandleDispatch' | ||
import styles from './ClearFilter.module.css' | ||
|
||
export default function ClearFilter() { | ||
const { handleClearFilter } = useHandleDispatch() | ||
console.log('ClearFilter') | ||
return ( | ||
<section> | ||
<button onClick={handleClearFilter}>Clear Filters</button> | ||
<button className={styles.clearBtn} onClick={handleClearFilter}> | ||
CLEAR ALL | ||
</button> | ||
</section> | ||
) | ||
} |
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
Empty file.
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