-
Notifications
You must be signed in to change notification settings - Fork 1
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 ] Toggle Button 퍼블리싱 #21
Changes from 4 commits
aa06bf4
8823110
5be7c11
1a18dd2
7c1f93a
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Providers from "@/components/common/Provider"; | ||
import Providers from "@/components/common/Provider/Provider"; | ||
import type { Metadata } from "next"; | ||
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) 컴포넌트 폴더에 파일명은 index.tsx 로 통일하는 것은 어떻게 생각하시나요? 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. FE 팀원들과 논의된 사항인가요 ? 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. 다른 분들의 의견도 궁금합니다! |
||
import "./globals.css"; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { recipe } from "@vanilla-extract/recipes"; | ||
|
||
export const buttonStyle = recipe({ | ||
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. 우왕 신기하당 ! |
||
base: { | ||
position: "relative", | ||
|
||
appearance: "none", | ||
|
||
width: "40px", | ||
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) 단위 rem으로 통일하는 건 어떻게 생각하시나요? 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. 넵 수정하겠습니다 ~ |
||
height: "24px", | ||
|
||
padding: "2px", | ||
|
||
borderRadius: "16px", | ||
backgroundColor: "rgba(121, 130, 154, 1)", | ||
|
||
cursor: "pointer", | ||
|
||
":before": { | ||
content: "", | ||
|
||
position: "absolute", | ||
top: 0, | ||
bottom: 0, | ||
|
||
zIndex: 1, | ||
|
||
width: "20px", | ||
height: "20px", | ||
margin: "auto 0", | ||
|
||
backgroundColor: "rgba(188, 192, 205, 1)", | ||
borderRadius: "50%", | ||
|
||
transition: "all .3s ease-out", | ||
}, | ||
}, | ||
variants: { | ||
active: { | ||
true: { | ||
backgroundColor: "rgba(102, 89, 255, 1)", | ||
|
||
":before": { | ||
backgroundColor: "rgba(255, 255, 255, 1)", | ||
|
||
transform: "translateX(16px)", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { buttonStyle } from "@/components/common/ToggleButton/ToggleButton.css"; | ||
import type { ComponentPropsWithoutRef } from "react"; | ||
|
||
interface ToggleButtonProps extends ComponentPropsWithoutRef<"input"> { | ||
isSelected: boolean; | ||
onChange: () => void; | ||
} | ||
|
||
const ToggleButton = ({ | ||
isSelected, | ||
onChange, | ||
...props | ||
}: ToggleButtonProps) => { | ||
return ( | ||
<input | ||
type="checkbox" | ||
role="switch" | ||
aria-checked={isSelected} | ||
checked={isSelected} | ||
onChange={onChange} | ||
className={buttonStyle({ active: isSelected })} | ||
{...props} | ||
/> | ||
); | ||
}; | ||
|
||
export default ToggleButton; |
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.
p3) json 린트 설정이 다른 것 같아요 .. 계속해서 불필요한 변경사항들이 생기네요
어떻게 해결하면 좋을까요 ?
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.
확인해보겠습니다 . . .