Skip to content

Conversation

@coolfin
Copy link

@coolfin coolfin commented Feb 21, 2024

구현

  • redux 활용 할 일 CRUD
    • 할 일 추가 및 수정은 Modal을 활용하여 구현
    • Delete의 경우 Confirm을 통해 실수로 삭제하는 일 방지
  • 마우스 hover 시 해당 컨테이너 기준 좌우측으로 MOVE 처리
  • vercel 배포 링크
  • uuid 활용 MOVE 로직 수정
  • 코드 REFACTOR
  • localStorage 저장
  • Ticket 생성 시 색상 지정
  • 다크/라이트모드 설정

- 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 저장
@coolfin coolfin changed the title [박상우] 필수기능 구현 및 REFACTOR 예정사항 [박상우] 필수기능 구현 및 REFACTOR Feb 22, 2024
- 일정 텍스트를 넘을 시 content에 대해 줄바꿈 기능 추가
Copy link
Collaborator

@moong23 moong23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 퀄이 높네요...주니어 아니신것같다는 소신발언 드립니다.
과제하시느라 고생많으셨습니다!! 👍

Comment on lines +52 to +58
<img src={process.env.PUBLIC_URL + `/asset/icon/${mode}.png`} alt="darkmode" className={classNames(
'w-12',
'h-12',

'hover:cursor-pointer',
'hover:opacity-70'
)}/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image

처음에 mode값이 초기화가 안되어있어서 먼저 이미지 import가 안되는 것 같아요! return을 mode로 감싸주거나, mode의 초기값이 있다면 useState안에서 초기화를 먼저 해주는것도 좋은 방법일 것 같습니다

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 제 로컬에서는 이미 localStorage값이 있어서 해당 에러는 확인하지 못했네요 리뷰 감사합니다!

Comment on lines +73 to +82
{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} />
)}
Copy link
Collaborator

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'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모든 assets파일을 public폴더 안에 넣어놓으면 좋지 않은 이유에 대해 잘 정리된 사이트가 있습니다! 참고후 다음 작업때 반영해주세요!

https://velog.io/@daeun/React-public%ED%8F%B4%EB%8D%94-src%ED%8F%B4%EB%8D%94-%EC%96%B4%EB%94%94%EC%97%90-%EB%84%A3%EC%96%B4%EC%95%BC-%EB%90%98%EB%8A%94%EA%B1%B8%EA%B9%8C

Copy link
Author

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) => {
Copy link
Collaborator

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와 나머지 파일들을 합쳐서 사용할 수 도 있을 것 같습니다!

Comment on lines +1 to +23
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정규식으로 해결할 수 있다는건 아예 생각해보지 못했네요 😯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants