-
Notifications
You must be signed in to change notification settings - Fork 4
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: develop useSwitch custom hook #20
Conversation
앞으로는 어떤 형식으로 기여를 해야할까요? CONTRIBUTING 문서가 있으면 좋을 것 같네요 |
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.
@dev2820 안녕하세요! 기여해주셔서 감사합니다!!
CONTRIBUTING문서가 필요할 것 같네요! 좋은 의견 감사합니다!!! 타 라이브러리 참고해서 빠른 시일 내에 추가해보도록 하겠습니다.
혹시 기여 방식에 대해 원하시는 부분이나, 좋은 의견이 있다면 언제든 말씀해주세요!
src/useBoolean/useBoolean.ts
Outdated
@@ -0,0 +1,7 @@ | |||
import { useState } from 'react'; | |||
|
|||
export type UseSwitchReturn = ReturnType<typeof useBoolean>; |
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.
혹시 여기 따로 타입지 정을 해주신 이유가 있을까용?
useSwitch 와 useBoolean모두 UseSwitchReturn이라는 이름으로 타입이 기재되어있어서 여쭤봅니다!
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.
앗 수정해야겠네요. 실수입니다
src/stories/useSwitch/Switch.css
Outdated
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.
Storybook 내부적으로 css 속성들이 겹치는 문제가 발생해서 vanilla extract를 도입하였는데요, 혹시 괜찮으시면 이후에 이 부분 내용이 바뀌어도 괜찮으신지 여쭤보고 싶습니다...!
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.
네 괜찮습니다
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.
네 감사합니당
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.
머지하겠습니다!
감사합니다!
다음 2가지 훅이 추가되었습니다.
useBoolean
useSwitch, useDisclosure 등 true-false 상태를 가지는 컴포넌트를 구현하는데 기초가 되는 훅입니다.
useSwitch
켜고 끌 수 있는 스위치(=토글)에 사용되는 훅입니다. (참고)
useBoolean에 종속적입니다.
자세한 설명은 storybook 참고 부탁드립니다.