Skip to content

Feat/mainpage#19

Merged
jin-Pro merged 8 commits intomainfrom
feat/mainpage
Oct 3, 2022
Merged

Feat/mainpage#19
jin-Pro merged 8 commits intomainfrom
feat/mainpage

Conversation

@jin-Pro
Copy link
Copy Markdown
Member

@jin-Pro jin-Pro commented Oct 3, 2022

What is this PR?

Changes

  • MainPage 구현 진행
  • msw 두개 api 구현 ( 팀 조회, 채널 조회 )

ScreenShot

2022-10-03.2.55.33.mov

Discussion

  • 조금 더 개발 진행을 해봐야 알 것 같다.

Test CheckList

  • jest [ ]
  • cypress [ ]

@jin-Pro jin-Pro added the feat new feature label Oct 3, 2022
@jin-Pro jin-Pro self-assigned this Oct 3, 2022
Copy link
Copy Markdown
Contributor

@Coreight98 Coreight98 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

const [target] = filterChannelSameId({ channels, id });
return (
target ??
({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

변수로 분리하면 좋을거 같아요!
예시: EmptyChannel

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

오 좋습니다 적용해두겠습니다~

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

const imgRef = useRef<HTMLInputElement>(null);
const handleClickButton = () => {
const teamId = 1;
const name = nameRef.current!.value;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

! 사용하신 이유가 무조건 값이 들어있기에 사용하신 걸까요??

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

본래 ref.current.value를 사용하려면 type checking을 진행해야합니다.

if(!nameRef.current) return;
const value = nameRef.current.value

하지만 말씀해주신 것 처럼 무조건 nameRef.current는 dom을 참조하고있기에 !를 사용하여 value를 강제로 꺼내왔습니다.

다른방법으로는 as를 사용해줄 것 같은데요, 코드가 더 길어지는것보단 간결해보여서 사용했습니다.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

답변해주셔서 감사합니다!
보통 !은 eslint 에러를 해결하기 위해 많이 사용한다고 해서요! 이 부분에서는 !하신게 더욱 간결한거 같군요!!

import { UseTeamListResult } from '@Page/MainPage/MainPage.type';

export type TeamCreateModalProps = {
handleAddTeam: UseTeamListResult[1];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

결과타입을 배열로 주신 부분이 궁금해요!
단순히 해당타입만 봤을 때 인덱스로 주신다면 어떤 타입인지 감이 오지 않아서요!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

네 저도 이부분을 상당히 고민하고있었는데요, 마땅한 해결책이 떠오르지 않아서요, 뭔가 ts의 util type을 사용하면 될 것 같긴한데 알아봐야겠네요.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

모든 result type을 []로 사용하지않고 {}로 변경하였고, Pick을 사용해서 해결하였습니다~

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

const src =
name === 'General'
? select
? '/asset/GeneralChannelIcon.svg'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이 부분은 함수로 분리하면 좋을거 같아요!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

넵 좋아요~ 디자인팀 데이터도 다른거같은데 적용해두겠습니다

id='ChannelItem'
data-id={dataId}
className={
select ? `${ChannelBasicClassName} bg-select-rgba rounded-lg` : `${ChannelBasicClassName}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ChannelBasicClassName + select?'bg-select-rgba rounded-lg':''

로 표기하시는 건 어떤가요?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

};

useEffect(() => {
getTeams()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

좋은 방법이군요!!

@jin-Pro jin-Pro merged commit 5d145eb into main Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants