-
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
[refactor] 헤더바 개선 #53
Conversation
const ITEM_WIDTH = 96; // w-24 | ||
const ITEM_GAP = 32; // gap-8 |
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/header/index.jsx
Outdated
let newPositionList = []; | ||
for (let i = 0; i < scrollSectionList.length; i++) { | ||
newPositionList[i] = ITEM_WIDTH / 4 + i * (ITEM_WIDTH + ITEM_GAP); | ||
} | ||
|
||
const position = Math.floor(newPositionList[scrollState]); |
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.
newPositionList[scrollState]
만 실제로 사용하고 있는데, 그렇다면 굳이 배열까지 필요하지 않아도 되지 않을까요?
const position = Math.floor( | ||
ITEM_WIDTH / 4 + scrollState * (ITEM_WIDTH + ITEM_GAP), | ||
); |
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.
편-안합니다
#️⃣ 연관 이슈
📝 작업 내용