-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Box Select 컴포넌트 추가 #23
Changes from 9 commits
f93ef38
54d3a39
0a2facd
88af76f
830cee4
e14a4cc
01b24a2
4608ecf
73c6ca8
1b4e897
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use client'; | ||
|
||
import { ChangeEvent, useState } from 'react'; | ||
|
||
/** | ||
* BoxSelect component | ||
* @param {string} title - 제목 | ||
* @param {string} subTitle - 부제목 | ||
*/ | ||
|
||
interface BoxSelectProps { | ||
title: string; | ||
subTitle: string; | ||
} | ||
|
||
const BoxSelect = ({ title = '', subTitle = '' }: BoxSelectProps) => { | ||
const [selectStatus, setSelectStatus] = useState<boolean>(false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3) state 이름을 isSelected 라고 변경해도 좋을 것 같습니다! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아하 확실히 그게 더 좋겠네요! |
||
|
||
const handleCheckboxChange = (event: ChangeEvent<HTMLInputElement>) => { | ||
setSelectStatus(event.target.checked); | ||
}; | ||
|
||
return ( | ||
<label | ||
className={`flex h-76 w-full items-start gap-8 rounded-lg ${selectStatus ? 'bg-var-gray-900 text-var-white' : 'bg-var-gray-50 text-var-black'} md:h-70 lg:h-70 px-8 py-[6px] transition-colors duration-200 ease-in-out md:px-16 md:py-12 lg:px-16 lg:py-12`} | ||
> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
<input | ||
id='checkbox' | ||
type='checkbox' | ||
className="h-24 w-24 appearance-none rounded-md bg-[url('/icons/checkbox-default.svg')] bg-center bg-no-repeat checked:bg-[url('/icons/checkbox-active.svg')] checked:bg-center checked:bg-no-repeat" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P4) appearance 속성은 처음 보네요! 혹시 어떤 기능하는지 알려주실 수 있을까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
onChange={handleCheckboxChange} | ||
/> | ||
<div className='flex flex-col'> | ||
<div className='text-[14px] font-bold md:text-[16px] lg:text-[16px]'> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2) md 이상이면 text 가 16px 인 것 같아서 굳이 lg:text-[16px] 은 안 적어도 될 것 같긴 합니다! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 두 분 의견 반영하겠습니다! |
||
{title} | ||
</div> | ||
<div className='text-[12px] font-medium'>{subTitle}</div> | ||
</div> | ||
</label> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
); | ||
}; | ||
|
||
export default BoxSelect; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,10 @@ const config: Config = { | |
'./src/app/**/*.{js,ts,jsx,tsx,mdx}', | ||
], | ||
theme: { | ||
screens: { | ||
md: { min: '768px' }, | ||
lg: { min: '1024px' }, | ||
}, | ||
Comment on lines
+21
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
extend: { | ||
spacing: PX_ENTRIES, | ||
fontFamily: { | ||
|
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.
나중에 부모 컴포넌트에서 set함수를 받아서 관리할 것 같아서 이 부분은 추후에 변경이 필요해보입니다.