-
Notifications
You must be signed in to change notification settings - Fork 6
박세은 리팩토링 과제 제출 #2
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
base: main
Are you sure you want to change the base?
Conversation
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.
과제하느라 고생 많으셨습니다~!!!
<BrowserRouter> | ||
<Routes> | ||
<Route path="/" element={<MainPage />}></Route> | ||
</Routes> | ||
</BrowserRouter> |
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.
단일 path인 경우에도 라우팅을 사용해서 얻을 수 있는 이점이 있나요?(질문임!!!)
// import AddForm from "../components/AddForm"; | ||
|
||
const MainPage = () => { | ||
const { forms } = useFormStore(); |
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.
커스텀훅이 상당히 깔끔하게 잘 짜여진것 같아요 👍
width: 3.2rem; | ||
height: 3.2rem; |
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.
비율이 정해져있는 이미지의 경우 이미지 크기를 바꾸고자 할 때 유지보수를 위해
width: 3.2rem; | |
height: 3.2rem; | |
width: 3.2rem; | |
aspect-ratio: 1/1; |
처럼 사용해도 좋을것같습니다~!
src/components/Board/Board.jsx
Outdated
<FormBox> | ||
{forms.map((form, index) => ( | ||
<Form | ||
key={index} |
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.
#1 (comment)
요기에도 적어놓은것처럼
key값에는 index처럼 변할 수 있는 값이 아닌, 변하지 않는 값을 넣어주시면 좋습니다
src/components/AddForm/AddForm.jsx
Outdated
</AddFormButton> | ||
|
||
<ColorChart> | ||
<Color1 type="button" onClick={handleColorClick("#c674ca")} /> |
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.
color를 props로 받아서 styled-component에서 재사용성을 높일 수 있을 것 같습니다!
src/components/AddForm/AddForm.jsx
Outdated
const Color1 = styled.button` | ||
display: block; | ||
width: 2.8rem; | ||
height: 2.8rem; | ||
margin-right: 1rem; | ||
border-radius: 50%; | ||
background-color: #c674ca; | ||
|
||
&:hover { | ||
cursor: pointer; | ||
} | ||
|
||
&:focus { | ||
border: 0.2rem dashed #ffffff; | ||
} | ||
`; |
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 Color1 = styled.button` | |
display: block; | |
width: 2.8rem; | |
height: 2.8rem; | |
margin-right: 1rem; | |
border-radius: 50%; | |
background-color: #c674ca; | |
&:hover { | |
cursor: pointer; | |
} | |
&:focus { | |
border: 0.2rem dashed #ffffff; | |
} | |
`; | |
const Color1 = styled.button` | |
display: block; | |
width: 2.8rem; | |
height: 2.8rem; | |
margin-right: 1rem; | |
border-radius: 50%; | |
background-color: ${(props) => props.color}; | |
&:hover { | |
cursor: pointer; | |
} | |
&:focus { | |
border: 0.2rem dashed #ffffff; | |
} | |
`; |
* form 추가 후에도 AddForm이없어지지 않는 문제 해결 * 아무 값도 없는데 create 눌리는 문제 해결
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.
전반적으로 잘 해주셨습니다! 다음 제출 시엔 리드미에 기능 구현진행상태와 버그, 질문 사항들을 함께 정리해주시면 좋을 것 같습니다! 고생하셨어요
<BrowserRouter> | ||
<Routes> | ||
<Route path="/" element={<MainPage />}></Route> | ||
</Routes> | ||
</BrowserRouter> |
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.
단일 path인 경우에도 라우팅을 사용해서 얻을 수 있는 이점이 있나요?(질문임!!!)
src/components/Board/Board.jsx
Outdated
</BoardTitle> | ||
<FormBox> | ||
{forms.map((form, index) => ( | ||
<Form |
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.
Form은 일정 카드라는 것을 유추하기 어려운 네이밍같습니다.
<MoreViewsButton | ||
src={MoreViews} | ||
onClick={handleMoreViewsButton} | ||
></MoreViewsButton> |
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.
여기서 이미 혼냈구만 !
src/components/Form/Form.jsx
Outdated
return ( | ||
<StyleForm color={color}> | ||
<FormButton> | ||
<ReWriteButton type="button" src={ReWrite} /> |
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.
svg 아이콘을 모두 img src로 사용하시고 계신데 혹시 svg를 컴포넌트로 사용하는 방식에 대해서 알고 계신가요? 아이콘이나 로고 같은 svg 파일의 경우에는 컴포넌트로 관리하는 것이 더 좋을 수 있을 것 같습니다.
지현 과제마감(CSS)
<BoardTitle> | ||
{category === "ToDo" ? "To Do 🎠" : null} | ||
{category === "InProgress" ? "In Progress 🎡" : null} | ||
{category === "Done" ? "Done 🎆" : null} | ||
</BoardTitle> |
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.
컴포넌트화 시켜서 category를 전달하면 좋을거같아 !
setReTitle={setReTitle} | ||
setReText={setReText} | ||
category={category} | ||
></Form> |
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.
셀프 클로징 태그,,
약속 지키셔야죠,,
<MoreViewsButton | ||
src={MoreViews} | ||
onClick={handleMoreViewsButton} | ||
></MoreViewsButton> |
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.
여기서 이미 혼냈구만 !
<CreateButton type="submit" disabled={!title || !text}> | ||
Create | ||
</CreateButton> | ||
<ExitButton type="button" onClick={handleExitButton} src={Exit} /> |
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.
onClick에 익명함수로 전달하는게 지금 상황에서는 더 깔끔해보일거같다는
개인적 생각이 있습니당 ~!
// const handleCategoryButton = (button) => { | ||
// if (button === "ToDo") { | ||
// } else if (button === "InProgress") { | ||
// } else { | ||
// } | ||
// }; |
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.
주석 지워 주세오...
<ExitButton type="button" onClick={handleExitButton} src={Exit} /> | ||
</FormButton> | ||
<FormTitle>{formTitle}</FormTitle> | ||
<FormText formText={formText}>{formText}</FormText> |
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.
얘는 먼데 formText를 props로 전달해 ??
import useFormStore from "../../store/store"; | ||
import Exit from "../../assets/button/Exit.svg"; | ||
|
||
const ReWrite = ({ category, rewrite, retitle, retext, setRewrite }) => { |
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.
ReWriteFrom.jsx 면 함수명도 ReWriteForm이 더 자연스러워보여
변경 사항
보드(Board)