-
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
Showing
33 changed files
with
301 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 @@ | ||
import { Option, OptionList, SelectButton, useSelect } from "@chooz/ui"; | ||
import useOutSideClick from "hooks/useOutsideClick"; | ||
import { CATEGORY_LIST } from "lib/constants"; | ||
import styled from "styled-components"; | ||
|
||
// @todo 추후 context api로 변경 | ||
// @todo 재사용 가능한 컴포넌트로 만들기 | ||
function CategorySelectBox() { | ||
const { isOpen, onChangeOpen, option, onChangeOption } = useSelect("전체"); | ||
const { targetEl } = useOutSideClick<HTMLDivElement>(isOpen, onChangeOpen); | ||
return ( | ||
<SelectBox ref={targetEl}> | ||
<SelectButton onChangeOpen={onChangeOpen}> | ||
<> | ||
{option} | ||
<span>▴</span> | ||
</> | ||
</SelectButton> | ||
{isOpen ? ( | ||
<OptionList> | ||
{CATEGORY_LIST.map( | ||
({ name }) => | ||
option !== name && ( | ||
<Option key={`option_list_${name}`} name={name} onChangeOption={onChangeOption} /> | ||
), | ||
)} | ||
</OptionList> | ||
) : null} | ||
</SelectBox> | ||
); | ||
} | ||
|
||
const SelectBox = styled.div``; | ||
|
||
export default CategorySelectBox; |
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,36 @@ | ||
import { Option, OptionList, SelectButton, useSelect } from "@chooz/ui"; | ||
import useOutSideClick from "hooks/useOutsideClick"; | ||
import { SORT_LIST } from "lib/constants"; | ||
import { SelectDropdownIndicator } from "public/icons"; | ||
import styled from "styled-components"; | ||
|
||
function SortSelectBox() { | ||
const { isOpen, onChangeOpen, option, onChangeOption } = useSelect("최신순"); | ||
const { targetEl } = useOutSideClick<HTMLDivElement>(isOpen, onChangeOpen); | ||
return ( | ||
<SelectBox ref={targetEl}> | ||
<SelectButton onChangeOpen={onChangeOpen}> | ||
<> | ||
{option} | ||
<SelectDropdownIndicator /> | ||
</> | ||
</SelectButton> | ||
{isOpen ? ( | ||
<OptionList> | ||
{SORT_LIST.map( | ||
({ name }) => | ||
option !== name && ( | ||
<Option key={`sort_list_${name}`} name={name} onChangeOption={onChangeOption} /> | ||
), | ||
)} | ||
</OptionList> | ||
) : null} | ||
</SelectBox> | ||
); | ||
} | ||
|
||
const SelectBox = styled.div` | ||
border: solid 1px ${({ theme }) => theme.palette.border.base}; ; | ||
`; | ||
|
||
export default SortSelectBox; |
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,2 +1,4 @@ | ||
export { default as VoteItem } from "./VoteItem"; | ||
export { default as VoteList } from "./VoteList"; | ||
export { default as CategorySelectBox } from "./CategorySelectBox"; | ||
export { default as SortSelectBox } from "./SortSelectBox"; |
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 was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export { default as WarningIcon } from "./WarningIcon.svg"; | ||
export { default as SaveIcon } from "./saveIcon.png"; | ||
export { default as HambergerIcon } from "./hambergerIcon.png"; | ||
export { default as AddIcon } from "./addIcon.png"; | ||
export { default as KakaoIcon } from "./KakaoIcon.svg"; | ||
export { default as NaverIcon } from "./NaverIcon.svg"; | ||
export { default as FilterIcon } from "./FilterIcon.svg"; | ||
export { default as BookmarkIcon } from "./BookmarkIcon.svg"; | ||
export { default as SelectDropdownIndicator } from "./SelectDropdownIndicator.svg"; | ||
export { default as AmplifyIcon } from "./amplifyIcon.png"; | ||
export { default as AddIcon } from "./addIcon.png"; | ||
export { default as SaveIcon } from "./saveIcon.png"; | ||
export { default as Reduction } from "./Reduction.png"; |
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 @@ | ||
# hooks |
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 @@ | ||
export * from "./src"; |
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 @@ | ||
{ | ||
"name": "@chooz/hooks", | ||
"packageManager": "[email protected]", | ||
"description": "", | ||
"author": "", | ||
"license": "ISC", | ||
"version": "0.1.0", | ||
"main": "index.ts", | ||
"dependencies": { | ||
"react": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18", | ||
"typescript": "^4.9.4" | ||
} | ||
} |
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 @@ | ||
export { default as useToggle } from "./useToggle"; |
File renamed without changes.
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,15 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"module": "esnext", | ||
"jsx": "react-jsx", | ||
"noEmit": false, | ||
"incremental": true, | ||
"declaration": true, | ||
"declarationMap": true | ||
}, | ||
"exclude": ["**/node_modules", "**/.*/", "dist", "build"] | ||
} |
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.
35b8efa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
client-web – ./
client-web-chooz.vercel.app
client-web-git-main-chooz.vercel.app
chooz.co.kr