-
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
Comment Like / Declaration 기능 추가 #20
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/zpapoo/ncha-frontend/qy4r9m5kf |
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.
hooks/
- useFetch.ts
- use-*.ts
이렇게 하는 것이 좋을 것 같은데, 어떠신가요?
components/player/PlayerSlide.tsx
Outdated
useEffect(() => { | ||
if (mouseRef.current) { | ||
const { offsetWidth } = mouseRef.current | ||
const percent = Math.min(Math.max(diff / offsetWidth, 0), 1) |
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.
how about this:
const percent = getBoundedValue(diff / offsetWidth)
function getBoundedValue(val: number, customOption?: { min: number; max: number }) {
const option = { ...{ min: 0, max: 1 }, ...customOption } // need to refactoring
return Math.min(Math.max(val, min), max)
}
i think utils means...
- 비즈니스 로직과 상관없는 단순 계산 함수들
- 다른 부분에서도 사용될 수 있는 공통 로직을 다루는 함수들
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.
이건 굉장히 nit한 질문인데, function functionName
으로 사용하시는 이유가 있나욤? 저는 all cosnt functionName = () => {}
로 사용하고 있어서 ㅎㅎ 혹시 뭔가 이유가 있나 궁금합니돵
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.
다음 PR에서 파일이름이랑 정리할 수 있으면 한번 해볼게용~
@JaeYeopHan 같이 리팩토링 했던 유틸함수 날려먹은것을 지금알아서.. 복구했습니다.. this commit |
이건 왜 노응답? |
Internal soso Error.... (놓치고 처리하지 못함) |
@JaeYeopHan hooks파일명에 대한 생각이 바뀌었습니다. ㅎㅎ
어떤 파일은 폴더의 성격까지 나타내고, 어떤 파일은 그렇지 않은데요, 이 PR에서 논의하고 별도 PR로 네이밍 정리하는 PR진행하겠습니다. 저는 서두에 말씀드린 내용으로, 파일은 폴더의 성격을 나타내지 않는것을 제안드립니다. |
…frontend into feature/toggle-comment-menu
이 부분에 대한 것은 의견만 드리자면 파일명이 겹치는 것을 최대한 피하려고 하는 편입니다.
다만 이 이야기를 길게 하고 싶지 않아요~ 프로젝트 별로 정해면 되는 부분이니, 소영님이 끌리는대로 다음 PR에서 정리해주세요~ |
@JaeYeopHan 곰곰2 생각해보니 재엽님 의견에 좀더 동의되네요! 그냥 의미론 적인것을 맞추기위해서 보다는 개발자 편의성측면에서 동의합니닷!@ 이 PR은 아직 안어프룹인가요..? |
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.
💯
Desc
useGesture 중 useDrag를 사용하여 사용자의 인터랙션에 따른 동작을 구현했습니다.
Demo
Reference