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

[Team18] [FE] 배민찬 프로젝트 마무리 #68

Merged
merged 68 commits into from
May 4, 2021

Conversation

17-sss
Copy link

@17-sss 17-sss commented Apr 30, 2021

구현기능

  • Header (헤더)

  • MainContents (상단 탭)

    • TabList : Tab 기능
  • SubContents (카테고리 - 슬라이더)

    • 재사용 가능한 Carousel 컴포넌트 적용
  • Detail (상세페이지 - 모달)

    • 재사용 가능한 Modal 컴포넌트 적용
  • utilComponent (공용 컴포넌트)

    • Button, Tag, Title
      • ProductCard에 주로 쓰임
    • ProductCard
      • SubContents, MainContents, Detail에 공통으로 쓰임
      • 이미지 호버 기능
    • SideDishStore (Context API)
      • Detail (Modal) 컨트롤하는데 사용
      • prop drilling을 피하기 위해 활용
    • Carousel
      • 재사용 가능하게 제작
      • 각종 옵션을 받아서 약간의 커스터마이징
        • itemsPerCnt: 한 페이지에 얼마나 보여줄지
        • cssCarouselWrapStyle: 캐러셀 Wrapper의 커스텀 스타일
          • (styled-components의 css 활용)
        • transitionProperty: css - transitionProperty 설정
        • transitionDuration: css - transitionDuration 설정
        • arrowOptions
          • leftIcon & rightIcon: 왼/오른쪽 버튼 디자인 커스터마이징 (문자열이나 컴포넌트 전달)
          • arrowLocation:
            • "normal" 옵션 -> Carousel 양 옆에 화살표 버튼 (left / right) 표시
            • "top" 옵션 -> Carousel 상단에 화살표 버튼 (left / right) 표시
          • btnSize: 화살표 버튼 (left / right)의 크기 지정
    • Modal
      • 재사용 가능하게 제작
  • hooks (커스텀 훅)

    • useFetch
  • 기타

    • 공통된 디자인을 재사용하기 위해 styled-compoents의 ThemeProvider 활용!

컴포넌트 구조


추후 공부! (못다한 기능들)

  • OAuth
  • 스켈레톤 UI
  • npm package 올리기!
    • 더 수정해야 할 것 같지만 나름 재사용 가능하게 만든 Modal, Carousel

kyupid and others added 30 commits April 19, 2021 19:04
    - React-icons 모듈 사용
    - DropdownMenu 작업중..
* npm install하면서 package-lock.json 변경됨
[#9] Tag, Button 컴포넌트 생성
- .gitignore 설정 변경 및 git cached 초기화
- .gitignore 설정 변경 및 git cached 초기화
[#1] 헤더 관련 Component 만들기 (완성)
fix: 삼항연산자로 텍스트 바뀌도록 수정
* type 값에 따라서 타이틀 문자열 반환
[FE] ProductCard 컴포넌트 생성 완료
17-sss and others added 24 commits April 27, 2021 14:28
[FE] MainContents 부분 구현 완료
[FE] Carousel (Slider) 컴포넌트의 재사용성을 위해 리팩토링
- Modal (틀, 재사용 가능한 컴포넌트) 완성
- 상세정보 창에서 쓰일 SideDishStore(context) 생성
- DetailTopGallery 동작 방식 변경
- 버그 많음.. 수정 중
- customHook - useFetch 통합
- 이미지 제대로 안뜨던 버그 수정완료
[FE] 상세정보 창 (Detail - Modal) 1차 완성
- SubContents 컴포넌트 작동 방식 변경 (리팩토링)
- 카테고리 모두 보이기 / 가리기 기능 추가
* useRef로 classList 수정하는 방식에서 state변경하는 방식으로 변경
[FE] 서브 콘텐츠, 상세 페이지 버그 수정
- 이에 따라 페이지 초기 렌더시 SubContents에서
    비동기 통신 시 (데이터 가져올 시) 서브콘텐츠 (슬라이더) 데이터의 구조 변경
@17-sss
Copy link
Author

17-sss commented Apr 30, 2021

회고

마지막에 소통이 잘 안 된 부분이 있어 특정 기능을 구현 못한 것이 아쉽습니다.
또한 처음에는 분업위주로 하면서 약간 애자일하길 바랬는데 언제부턴가 잘못되었단 걸 느꼈습니다.
다음에는 처음부터 설계도, 회의록도, 회고도 남겨보고싶습니다.
그리고 데모 때 진짜 열심히 만들었는데 디테일하게 설명 못했던 점도 많이 아쉽습니다.

항상 잘 따라와준 이브에게 너무너무 고맙고 😄
백앤드 Kyu도 열심히해줘서 고맙습니다!! 🚀
제 자신에게도 이번 프로젝트엔 진짜 후회 없게 했다 생각하고 같이 함께 더 나아가고 싶습니다 :)

@17-sss 17-sss changed the title [Team18 ] [FE] 배민찬 프로젝트 마무리 [Team18] [FE] 배민찬 프로젝트 마무리 Apr 30, 2021
@snowjang24 snowjang24 added the review-FE FE 리뷰 label May 1, 2021
@crongro
Copy link

crongro commented May 4, 2021

utilComponent (공용 컴포넌트)

재사용 가능 컴포넌트들이 많아 보여서 좋네요.
재사용 가능한 컴포넌트 만드는 것은 그리 쉽진 않은거에요.

Copy link

@crongro crongro left a comment

Choose a reason for hiding this comment

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

열심히 잘 구현하셨네요.
컴포넌트 크기도 적당하고 구조도 괜찮습니다.
재사용 노력도 좋고요.

useEffect에는 렌더링이후에 처리해야 할 side effect 작업들을 넣는 용도 입니다.
그러니 지금처럼 jsx코드를 생성하는 코드를 넣는 건 적절하지 않아보여요.
@17-sss @eve712

`;

const App = () => (
<ThemeProvider theme={theme}>
Copy link

Choose a reason for hiding this comment

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

테마로 스타일 관리 좋아요.

const { alt: subject, badge, detail_hash, type } = currProductData;
executeFetch(`/api/detail/${detail_hash}`, {subject, badge, type});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [currProductData]);
Copy link

Choose a reason for hiding this comment

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

아시겠지만 'currProductData' 값이 변경될때마다 useFffect 콜백함수는 실행됩니다.

Comment on lines +57 to +61
const visibleOptions = {
isModalVisible,
setIsModalVisible,
addCbFunc: handleAddCloseBtnClick,
};
Copy link

Choose a reason for hiding this comment

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

jsx가 복잡하면 이렇게 분리해서 선언하는것도 괜찮아요.

import DetailTopInfo from "./DetailTopInfo";

const DetailTop = ({ result }) => {
return result && result.data && (
Copy link

Choose a reason for hiding this comment

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

optional chaining 문법을 활용해보세요.

Comment on lines +12 to +22
const aGalleryItems =
thumb_images.map((image, i) => (
<GalleryItem key={i} onClick={handleItemClick}>
<img src={image} alt={"image" + (i+1)} />
</GalleryItem>
));

while(aGalleryItems.length < 5)
aGalleryItems.push(<GalleryItem key={aGalleryItems.length} empty />);

setGalleryItems(aGalleryItems);
Copy link

Choose a reason for hiding this comment

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

렌더링 => useEffect 전달된 콜백실행

이른 흐름으로 렌더링될텐데요.

useEffect 전달된 함수안에서 jsx 코드를 만들어서 상태변경을 시킬필요는 없을거 같아요.
그부분은 useEffect 밖에서 처리해서 jsx안에 바로 결과를 넣어주면 좋겠습니다.

Comment on lines +46 to +59
useEffect(() => {
if (!addProps) return;
if (addProps.length > 0) {
const flag = addProps.some((v) => !v);
if (flag) {
isExecuteFunc && addFunc && addFunc();
return;
};
}

fetchData();
isExecuteFunc && addFunc && addFunc();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [...addProps]);
Copy link

Choose a reason for hiding this comment

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

useEffect 가 막강하게 다양한 옵션을 받아서 처리하는 것인 인상적이네요.
어려운문제겠지만, 좀더 역할에 집중한다고 생각하면, useFetch 는 fetching 작업에만 집중하고 그 결과를 반환하는 것 까지만 해도 될 거 같아요.

그런점에서 두 번째 useEffect 역할은 안하고 그것은 해당 컴포넌트에서 하는 것이 어떨가 싶어요.

@@ -0,0 +1,23 @@
import styled from 'styled-components'

const Tag = ({ type }) => {
Copy link

Choose a reason for hiding this comment

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

컴포넌트를 모두 작게 잘 나눈점이 좋아요.

@crongro crongro merged commit dfae06a into codesquad-members-2021:team18 May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-FE FE 리뷰
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants