-
Notifications
You must be signed in to change notification settings - Fork 3
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
Head Node UI 구현 #85
Head Node UI 구현 #85
Conversation
325099a
to
216d5eb
Compare
고생하셨습니다 b |
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.
고생 많으셨습니다! 👍 👍
스토리북부터 타입스크립트까지 배울 부분이 정말 많은 코드였어요 😄
); | ||
}, | ||
], | ||
} satisfies Meta<typeof SpaceNode>; |
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.
satisfies
를 통해서 타입 체킹을 할 수도 있군요 👀
const [offsetX, setOffsetX] = useState<number | undefined>(undefined); | ||
const [offsetY, setOffsetY] = useState<number | undefined>(undefined); | ||
|
||
useEffect(() => { | ||
if (!ref.current || props.offset !== undefined) { | ||
return; | ||
} | ||
|
||
if (props.offsetX === undefined) { | ||
setOffsetX(ref.current.width() / 2); | ||
} | ||
|
||
if (props.offsetY === undefined) { | ||
setOffsetY(ref.current.height() / 2); | ||
} | ||
}, [props]); |
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.
offsetX, offsetY를 offset 하나로 관리하면 조금 더 간결해질 것 같아요. (1점)
const SpaceNode = forwardRef<Konva.Group, SpaceNodeProps>( | ||
({ label, x, y }, ref) => { | ||
// TODO: 색상에 대해 정하기, 크기에 대해 정하기 | ||
const fillColor = "royalblue"; |
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.
노드 색상들에 대해서도 논의가 필요하겠네요!
const { entrySpaceId } = useParams<SpacePageParams>(); | ||
|
||
if (!entrySpaceId) { | ||
throw new Error(""); |
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.
나중에 에러 로직을 구체화해보면 좋겠네요 !
(rebase해서 올렸습니다)
✏️ 한 줄 설명
Space 페이지를 생성하고, 중앙 노드가 렌더링되도록 했어요.
✅ 작업 내용
🏷️ 관련 이슈
close #28
📸 스크린샷/영상
📌 리뷰 진행 시 참고 사항
아직 확장성 있게 컴포넌트를 설계하기엔 데이터 구조랑이 명확해지기 전까지는 어려울 것 같아, 개략적인 구조만 잡았습니다.