-
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.
Merge branch 'techCodeFilter' into develop
- Loading branch information
Showing
15 changed files
with
257 additions
and
46 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"use client"; | ||
|
||
import { TechCodeResponensType } from "@/util/type"; | ||
import React from "react"; | ||
|
||
interface PropsType { | ||
value: TechCodeResponensType[]; | ||
setSelect: React.Dispatch<React.SetStateAction<TechCodeResponensType[]>>; | ||
select: TechCodeResponensType[]; | ||
} | ||
|
||
function Chip({ value, setSelect, select }: PropsType) { | ||
return ( | ||
<div className="flex flex-wrap w-full max-h-full gap-2 overflow-y-scroll"> | ||
{value.map((item, idx) => { | ||
const isSelect = select.some( | ||
(cookieItem) => item.code === cookieItem.code | ||
); | ||
return ( | ||
<div | ||
key={idx} | ||
className="px-4 py-[6px] rounded-[30px] text-caption leading-caption cursor-pointer h-[30px]" | ||
style={ | ||
isSelect | ||
? { | ||
backgroundColor: "rgba(35,123,201,0.12)", | ||
color: "rgba(35,123,201,0.8)", | ||
} | ||
: { backgroundColor: "#f7f7f7", color: "#7f7f7f" } | ||
} | ||
onClick={() => { | ||
if (!isSelect) { | ||
setSelect((prev) => [...prev, item]); | ||
} else | ||
setSelect((prev) => { | ||
return prev.filter((select) => select.code !== item.code); | ||
}); | ||
}} | ||
> | ||
{item.keyword} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
} | ||
|
||
export default React.memo(Chip); |
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
Oops, something went wrong.