Skip to content
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

[FE] 마이페이지 구매내역의 상세보기 isModal 변경 #228

Merged
merged 7 commits into from
Apr 20, 2023

Conversation

devminoh
Copy link
Contributor

PR Checklist

PR이 다음 요구사항을 만족하는지 확인해주세요.

  • 커밋 메시지가 정책을 따르나요?
  • 해당 기능이 정상적으로 작동 하나요>?

PR Type

어떤 종류의 PR인가요?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

이슈와 연결하기

Issue Number: #227

무엇이 추가 되었나요?

  • slice 에서 쓰일 hooks.ts 추가
  • store.js -> ts
  • myOrderSlice, userSlice 필요한 부분 타입 추가 ( 각자 사용 부분 타입 재설정 필요)
  • 구매내역 상세보기 isModal ref로 변경
  • 마이페이지와 구매내역 상세보기 페이지 tsx로 마이그레이션

기타 정보

  • slice부분은 현재 타입 재설정이 필요합니다.
  • 제가 필요한 부분만 타입설정 해두고 각자 사용하신 부분 interface에서 any로 되어있는 부분들은 고쳐주셔야해요

@devminoh devminoh added [FE]노경민 ♻️ refactor 코드 리팩토링 과정이 필요함 labels Apr 19, 2023
@devminoh devminoh self-assigned this Apr 19, 2023
@insidelamp
Copy link
Contributor

수고하셨습니다 hook부분이 인상적이네요 redux에서 usedispatch랑 useselector 을 가져오는걸 훅으로만들어서 가져올수있군요 저도 얼른 해서 올릴게요!

import type { RootState, AppDispatch } from "./store";

export const useAppDispatch: () => AppDispatch = useDispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
Copy link
Collaborator

Choose a reason for hiding this comment

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

내용 찾아봐도 잘 이해가 안가는데 참고하신 링크 알려주실수 있을까요?

Copy link
Contributor Author

@devminoh devminoh Apr 20, 2023

Choose a reason for hiding this comment

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

내용 찾아봐도 잘 이해가 안가는데 참고하신 링크 알려주실수 있을까요?

타입지정을 위해 만들어진 hook 이고 참고링크는 따로 있지않고 chatGPT 사용해서 작성했어요 만약 저희가 사용하던대로 dispatch 와 selector를 사용하면 타입지정이 안돼서 오류가 나더라구요 이 타입들은 store에서 export해온 타입으로 사용중입니다~

Copy link
Collaborator

Choose a reason for hiding this comment

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

그랬군요, redux-toolkit , React, TS 같이 사용하려면 설정해야 되는거구나 라고 생각해서 내용 찾아보니까 경민님이 설정하신거처럼 나오더라고요, 근데 이해가 잘 안되어서 여쭤봣었던거라! 더 공부해보겠습니다!!


const myOrderSlice = createSlice({
name: "myorder",
initialState: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

initialState는 꼭 지정 안해줘도 되는군요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

initialState는 꼭 지정 안해줘도 되는군요?

아니요, initialState는 위에 선언되어 있어요. 타입지정을 위해서 위에 선언한걸 받아와서 썼습니다!

Copy link
Collaborator

@seoyeon0108 seoyeon0108 Apr 20, 2023

Choose a reason for hiding this comment

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

아 그렇네요! 삭제된 부분만 보고 위에는 자세히 안봣나봐요! 자세하게 보는 습관을 들여야겠어요!! ㅠㅠ

@devminoh devminoh merged commit 9d87e68 into ts-refact Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[FE]노경민 ♻️ refactor 코드 리팩토링 과정이 필요함
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants