-
Notifications
You must be signed in to change notification settings - Fork 6
[박상우] 필수기능 구현 및 REFACTOR #6
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
- add darkmode icon - todolist container base design - 다양한 곳에 사용되는 컴포넌트 사용을 위해 styled-components 추가
- todo의 CRUD를 redux로 set
- map 활용 dispatch한 sample data 연결
- sample data CRUD 추가 - 추가되는 data에 따른 add button 동적 이동
- combineReducers 사용, container 별 reducre 분할 - tailwind config 활용, 동적 배경 할당 bug : 각 container 별 data CRUD가 원활하게 이루어지지 않고 있음
- 리스트 간 이동을 hover과 button을 활용하여 구현 - fix: 기능 구현 필요
- hover 시 디자인 수정 - ticket button component 추가
- ticket 추가 시 title, content 입력 modal 생성 - 컨테이너 색상 지정(예정) fix: ticket move id 중복으로 인한 bug 해결
- 제목 및 내용을 입력하여 ticket을 추가하는 컴포넌트 구현
- redux에서 정보를 받아와서 수정하는 기능 구현
- index.css에 브라우저 별 스크롤 기능 추가
- uuid 활용 MOVE 로직 수정
- 티켓 생성/수정 시 색상 변경 기능 추가
- 동적 스타일링 버그 해결
- 다크모드 localstorage 저장 - ticket localstorage 저장
- 일정 텍스트를 넘을 시 content에 대해 줄바꿈 기능 추가
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.
코드 퀄이 높네요...주니어 아니신것같다는 소신발언 드립니다.
과제하시느라 고생많으셨습니다!! 👍
| <img src={process.env.PUBLIC_URL + `/asset/icon/${mode}.png`} alt="darkmode" className={classNames( | ||
| 'w-12', | ||
| 'h-12', | ||
|
|
||
| 'hover:cursor-pointer', | ||
| 'hover:opacity-70' | ||
| )}/> |
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.
아 제 로컬에서는 이미 localStorage값이 있어서 해당 에러는 확인하지 못했네요 리뷰 감사합니다!
| {status === 'TODO' ? ( | ||
| <TicketMoveToggle move="PROGRESS" status={status} todo={todo} /> | ||
| ) : status === 'PROGRESS' ? ( | ||
| <> | ||
| <TicketMoveToggle move="TODO" status={status} todo={todo} /> | ||
| <TicketMoveToggle move="DONE" status={status} todo={todo} /> | ||
| </> | ||
| ) : ( | ||
| <TicketMoveToggle move="PROGRESS" status={status} todo={todo} /> | ||
| )} |
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.
Todo status에서 done으로 바로 옮기거나 , 그 반대의 경우도 있을 수 있을것같습니다!
| )} | ||
| > | ||
| <img | ||
| src={process.env.PUBLIC_URL + '/asset/icon/edit.png'} |
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.
모든 assets파일을 public폴더 안에 넣어놓으면 좋지 않은 이유에 대해 잘 정리된 사이트가 있습니다! 참고후 다음 작업때 반영해주세요!
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.
마지막에 해당 부분 수정하면서 레퍼런스를 찾고 있었는데 감사합니다! 읽어보겠습니다 :)
| @@ -0,0 +1,23 @@ | |||
| const doneReducer = (state = { done: [] }, action) => { | |||
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.
state의 key를 props로 받고 한번에 합친다면
reducer/done.js와 나머지 파일들을 합쳐서 사용할 수 도 있을 것 같습니다!
| const progressReducer = (state = {progress: []}, action) => { | ||
| switch (action.type) { | ||
| case 'ADD_PROGRESS': | ||
| return { | ||
| ...state, | ||
| progress: state.progress.concat({ ...action.data }) | ||
| } | ||
| case 'DELETE_PROGRESS': | ||
| return { | ||
| ...state, | ||
| progress: state.progress.filter(progress => progress.id !== action.id) | ||
| } | ||
| case 'UPDATE_PROGRESS': | ||
| return { | ||
| ...state, | ||
| progress: state.progress.map(progress => progress.id === action.id ? { ...progress, ...action.data } : progress) | ||
| } | ||
| default: | ||
| return state; | ||
| } | ||
| } | ||
|
|
||
| export default progressReducer; No newline at end of file |
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 progressReducer = (state = {progress: []}, action) => { | |
| switch (action.type) { | |
| case 'ADD_PROGRESS': | |
| return { | |
| ...state, | |
| progress: state.progress.concat({ ...action.data }) | |
| } | |
| case 'DELETE_PROGRESS': | |
| return { | |
| ...state, | |
| progress: state.progress.filter(progress => progress.id !== action.id) | |
| } | |
| case 'UPDATE_PROGRESS': | |
| return { | |
| ...state, | |
| progress: state.progress.map(progress => progress.id === action.id ? { ...progress, ...action.data } : progress) | |
| } | |
| default: | |
| return state; | |
| } | |
| } | |
| export default progressReducer; | |
| const initialState = { | |
| done: [], | |
| todos: [], | |
| progress: [] | |
| }; | |
| const combinedReducer = (state = initialState, action) => { | |
| // Extract the action prefix (ADD, DELETE, UPDATE) and type (DONE, TODO, PROGRESS) | |
| const matches = /([A-Z]+)_(DONE|TODO|PROGRESS)/.exec(action.type); | |
| // If the action type doesn't match the expected pattern, return the current state | |
| if (!matches) return state; | |
| const [, actionPrefix, actionType] = matches; | |
| const section = actionType.toLowerCase(); // Convert DONE, TODO, PROGRESS to done, todos, progress | |
| switch (actionPrefix) { | |
| case 'ADD': | |
| return { | |
| ...state, | |
| [section]: state[section].concat({ ...action.data }) | |
| }; | |
| case 'DELETE': | |
| return { | |
| ...state, | |
| [section]: state[section].filter(item => item.id !== action.id) | |
| }; | |
| case 'UPDATE': | |
| return { | |
| ...state, | |
| [section]: state[section].map(item => item.id === action.id ? { ...item, ...action.data } : item) | |
| }; | |
| default: | |
| return state; | |
| } | |
| }; | |
| export default combinedReducer; | |
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.
정규식으로 해결할 수 있다는건 아예 생각해보지 못했네요 😯


구현