-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(filter): Implement filter feature (#19)
- Loading branch information
Showing
14 changed files
with
244 additions
and
49 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"packageManager": "[email protected]", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "BASE_PATH=/next next build && next export -o dist/next && rsync -a template/ dist", | ||
"build": "BASE_PATH=/next next build && next export -o dist/next && rsync -a template/ dist && rsync -a public/ dist", | ||
"zip": "cd dist && zip -r ../dist.zip ." | ||
}, | ||
"dependencies": { | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -3,4 +3,8 @@ | |
align-items: center; | ||
line-height: normal; | ||
column-gap: 4px; | ||
|
||
> input { | ||
width: auto; | ||
} | ||
} |
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,35 @@ | ||
.icon-button { | ||
flex-shrink: 0; | ||
line-height: 0; | ||
border: none; | ||
background: none; | ||
cursor: pointer; | ||
|
||
.icon { | ||
display: inline-block; | ||
width: 28px; | ||
height: 24px; | ||
-webkit-mask-image: url(/largeIcons.svg); | ||
background-color: var(--pb-fg); | ||
|
||
&:hover { | ||
background-color: var(--pb-fg-hover); | ||
} | ||
} | ||
|
||
.filter { | ||
-webkit-mask-position: -56px 120px; | ||
|
||
&.active { | ||
background-color: var(--oc-red-3); | ||
} | ||
} | ||
|
||
.search { | ||
-webkit-mask-position: -196px 96px; | ||
} | ||
|
||
.clear { | ||
-webkit-mask-position: 0px 144px; | ||
} | ||
} |
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,30 @@ | ||
import styles from "./index.module.scss"; | ||
|
||
type Icon = "filter" | "search" | "clear"; | ||
|
||
export interface IconButtonProps | ||
extends Omit<React.HTMLAttributes<HTMLButtonElement>, "children"> { | ||
icon: Icon; | ||
isActive?: boolean; | ||
} | ||
|
||
const IconButton: React.FC<IconButtonProps> = ({ | ||
icon, | ||
isActive, | ||
...props | ||
}) => { | ||
return ( | ||
<button | ||
{...props} | ||
className={`${styles["icon-button"]} ${props.className ?? ""}`} | ||
> | ||
<span | ||
className={`${styles.icon} ${styles[icon]} ${ | ||
isActive ? styles.active : "" | ||
}`} | ||
></span> | ||
</button> | ||
); | ||
}; | ||
|
||
export default IconButton; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.settings { | ||
padding: 4px; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
border-bottom: 1px solid var(--pb-sep); | ||
} | ||
|
||
.search-section { | ||
display: flex; | ||
align-items: center; | ||
} |
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,16 @@ | ||
import React from "react"; | ||
import Button from "../../../components/Button"; | ||
import styles from "./index.module.scss"; | ||
import { useAddMockRequests } from "../mocks/requests"; | ||
|
||
interface ExperimentalProps {} | ||
const Experimental: React.FC<ExperimentalProps> = () => { | ||
const addMockRequests = useAddMockRequests(); | ||
return ( | ||
<div className={styles.settings}> | ||
<Button onClick={() => addMockRequests()}>Add mock reqs</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default React.memo(Experimental); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import { atom } from "jotai"; | ||
|
||
export const preserveLogAtom = atom<boolean>(false); | ||
|
||
export const searchValueAtom = atom<string>(""); | ||
|
||
export const filterAtom = atom<boolean>(true); |