-
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.
Browse files
Browse the repository at this point in the history
[#20] ์์ด๋์ด ์ ํ ์ ํ ์ปดํฌ๋ํธ
- Loading branch information
Showing
11 changed files
with
246 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import { ToggleGroupItem, ToggleGroupRoot } from './common/ToggleGroup' | ||
import { typeDatas } from '@/constants/idea' | ||
import styled from 'styled-components' | ||
import { theme } from '@/styles/theme' | ||
import { useAtom } from 'jotai' | ||
import { selectedIdeaTypeAtom } from '@/store/atoms/idea' | ||
|
||
const StyledToggleGroupRoot = styled(ToggleGroupRoot)` | ||
display: grid; | ||
grid-template-columns: repeat(5, 60px); | ||
row-gap: 4px; | ||
column-gap: 4px; | ||
justify-content: center; | ||
` | ||
const StyledToggleGroupItem = styled(ToggleGroupItem)` | ||
/* ๊ธฐ๋ณธ ์คํ์ผ */ | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
width: 60px; | ||
height: 24px; | ||
font-size: 0.8125rem; | ||
font-weight: ${theme.fontWeight.bold}; | ||
color: #767676; | ||
background-color: ${theme.color.white}; | ||
border: 1px solid ${theme.color.grey500}; | ||
border-radius: 12px; | ||
cursor: pointer; | ||
/* ์ ํ ์ ์คํ์ผ */ | ||
&[data-state='on'] { | ||
background-color: ${theme.color.purple700}; | ||
color: ${theme.color.white}; | ||
border: none; | ||
} | ||
` | ||
|
||
const IdeaTypeGroup = () => { | ||
const [value, setValue] = useAtom(selectedIdeaTypeAtom) | ||
|
||
return ( | ||
<StyledToggleGroupRoot | ||
type="single" | ||
value={value} | ||
onValueChange={(value) => { | ||
if (value) setValue(value) | ||
}} | ||
> | ||
{typeDatas.map((content, idx) => ( | ||
<StyledToggleGroupItem key={`${content}-${idx}`} value={content}> | ||
{content} | ||
</StyledToggleGroupItem> | ||
))} | ||
</StyledToggleGroupRoot> | ||
) | ||
} | ||
|
||
export default IdeaTypeGroup |
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 @@ | ||
'use client' | ||
|
||
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group' | ||
import React from 'react' | ||
|
||
export interface ToggleGroupItemProps | ||
extends ToggleGroupPrimitive.ToggleGroupItemProps {} | ||
|
||
const ToggleGroupItem = ({ children, ...props }: ToggleGroupItemProps) => { | ||
return ( | ||
<ToggleGroupPrimitive.Item {...props}>{children}</ToggleGroupPrimitive.Item> | ||
) | ||
} | ||
|
||
export default ToggleGroupItem |
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,7 @@ | ||
'use client' | ||
|
||
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group' | ||
|
||
const ToggleGroupRoot = ToggleGroupPrimitive.Root | ||
|
||
export default ToggleGroupRoot |
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,4 @@ | ||
import ToggleGroupRoot from '@/components/common/ToggleGroup/Root' | ||
import ToggleGroupItem from '@/components/common/ToggleGroup/Item' | ||
|
||
export { ToggleGroupItem, ToggleGroupRoot } |
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 @@ | ||
export const typeDatas = [ | ||
'์ํ', | ||
'ํฌ์ค์ผ์ด', | ||
'๊ณผํ', | ||
'๊ฒฝ์ ', | ||
'๊ต์ก', | ||
'AI', | ||
'ํต์ ', | ||
'์ ์กฐ', | ||
'๋ธ๋ก์ฒด์ธ', | ||
'๋ฐ์ดํฐ', | ||
'๋น์ฆ๋์ค', | ||
'๋ฅํ ํฌ', | ||
'ํ๋์จ์ด', | ||
'STO', | ||
'์ปค๋จธ์ค', | ||
'์ธ์ฌ', | ||
'๋ฒ๋ฅ ', | ||
'๋ฐ์ด์ค', | ||
'ํํ ํฌ', | ||
'์ปคํผ', | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { typeDatas } from '@/constants/idea' | ||
import { atom } from 'jotai' | ||
|
||
export const selectedIdeaTypeAtom = atom(typeDatas[0]) |
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 '@/store/atoms/idea' |
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 '@/store/atoms' |