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

[Team-21] RaQQoon Sidedish #18

Merged
merged 55 commits into from
Apr 26, 2021

Conversation

juddroid
Copy link
Collaborator

진행상황

Dropdown 메뉴 구현

  • 헤더 메뉴에 마우스 호버시 드롭다운 표시

TabUI 구현

  • 각 탭에 따른 itemList 로딩
  • 선택된 탭 활성화

Carousel 구현

  • 더보기 버튼 클릭시 새로운 캐러셀 출력
  • API를 이용해 UI 구성

현재 뷰!

스크린샷 2021-04-23 02 48 49

궁금한점

  1. 단순한 궁금점입니다. css module을 사용하는게 더 성능면에서 좋다고 들었습니다. 현재 styled-components를 활용하여 개발을 진행하고 있습니다. 너무 많은 styled components를 만드는게 아닌가? 그런 생각이 계속 드네요. 아직 잘 활용을 못하기도 하고, css를 import해서 사용하던게 익숙해서 그런지 아직까지 css in js가 어렵게 느껴집니다. 현업에서는 어떤 방식을 더 많이 사용하는지 궁금합니다.

  2. useState의 초기값으로 null값이나 []을 사용하고 있는데, 최초 렌더링시 에러처리를

const Component = () => {

    const [data, setData] = useState(null);

    if (!data) return null;
    
    return <OtherComponent data={data} />
 
 }

이런 형태로 하는게 괜찮은지 궁금합니다.

  1. .env 파일을 생성해서 path alias 를 했을 때, vsCode에서 컴포넌트를 auto import 할 때, 여전히 상대경로로 import가 되고 있는데 다른 설정이 필요한지 궁금합니다. 그리고 command 키를 이용해서 컴포넌트 내부로 들어갈 수 있어서 편리했는데, 설정을 하고나니 이걸 사용할 수 없게 되어 불편했습니다. 어떤식으로 검색해서 방법을 찾으면 좋을지 모르겠습니다.

juddroid and others added 30 commits April 19, 2021 16:03
[Raccoon dev] 협업을 위한 기본 폴더구조 완성
Sidedish raccoon dev 공통 컴포넌트 작업
Header UI 작업 마무리
Move. Header파일 Nav폴더로 이동
Add. Menu 파일 생성, 컴포넌트 분리
Add. Menu Component 분리
@juddroid juddroid added the review-FE FE 리뷰 label Apr 22, 2021
jjunyjjuny added a commit that referenced this pull request Apr 26, 2021
@snowjang24 snowjang24 self-requested a review April 26, 2021 02:15
@snowjang24 snowjang24 self-assigned this Apr 26, 2021
Copy link

@snowjang24 snowjang24 left a comment

Choose a reason for hiding this comment

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

안녕하세요 리뷰를 맡은 스노우입니다. ☃️

전체적으로 컴포넌트 나누기나, 로직 분리가 너무 잘되어 있어 코드 읽는데 불편함 없이 너무 편하게 봤네요, 저보다 더 잘하시는거같아요! 👏👏👏

남은 진행사항들 완성하면 다시 한 번 코드를 구경하러 오고 싶군요 😃

<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap"
rel="stylesheet"
/>

Choose a reason for hiding this comment

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

폰트 로드 방법 및 최적화에 대해 한번 공부해보면 좋을 것 같습니다.
preload와 font-display: swap; 와 같이 웹 폰트를 불러 오거나, 로컬 폰트를 로드하는 다양하고 적절한 방법에 대해 공부해보시기를 권장드립니다.

TAG_EVENT,
TAG_LAUNCHING,
} from 'const';
import { v4 as uuidv4 } from 'uuid';

Choose a reason for hiding this comment

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

👀 uuid! 까지!

</HoverTextBoxDiv>
);
};

Choose a reason for hiding this comment

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

컴포넌트 구성과 로직분리가 깔끔하여 보기 좋습니다 👍

이미지 컨테이너와 이미지 모두 사이즈를 지정하고 있는데 혹시 이유가 있을까요 ?
만약 이런 경우, 이미지의 사이즈가 불규칙적인 경우에 대해 한 번 고민해보실 필요가 있을 것 같습니다.

width 혹은 height 100%, overflow: hidden을 활용해보세요!

return COLOR_LIGHTRED;
default:
break;
}

Choose a reason for hiding this comment

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

만약 이런 케이스별 색을 자주 쓰는경우 객체를 통해 관리해도 좋을것 같습니다 👍
지금도 👍 입니다

const moveLeft = () => {};

return dishList ? (
<CarouselStyled>

Choose a reason for hiding this comment

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

이런 경우, Fetch 실패시에도 로딩중으로 떠 사용자 경험에 좋지 않을 것 같습니다.
loading 상태를 추가하여 pending(loading), fulfilled, rejected의 케이스로 구분하는 것이 좋을 것 같습니다!

const data = await res.json();
const dataBody = await data.body;
setResponse(dataBody);
};

Choose a reason for hiding this comment

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

loading, error state 추가에 대해 고려해주세요!

Choose a reason for hiding this comment

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

try catch!

export const MSG_BOTTOM = '전국택배';

// Size
export const SIZE_LARGE = 'large';

Choose a reason for hiding this comment

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

변수 관리 너무 좋습니다!
객체형태로 관리해도 괜찮을 것 같아요!

<TabListDiv>
{bestData.map(({ category_id, name }, idx) => {
let tabState = DEACTIVE;
if (tabIndex === idx) tabState = ACTIVE;

Choose a reason for hiding this comment

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

activeTab으로 index를 기억하는 방식은 어떨까요 ?
Tab이면 TabItem중에 하나만 Active 한 상태를 가질 것 같아서요!

padding-left: 1.5rem;
font-family: Noto Sans KR;
font-style: normal;
font-weight: normal;

Choose a reason for hiding this comment

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

자주 쓰는 텍스트의 폰트 스타일을 빼줘서 쓰는것도 좋은 방법일 것 같습니다 !

import CarouselContainer from 'components/carousel/CarouselContainer';

const CarouselSection = () => {
const paths = ['main', 'soup', 'side'];

Choose a reason for hiding this comment

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

paths 라는 단어보다 categories 같은 단어는 어떨까요 ? paths라고 하니 뭔가 한번에 이해가 안되는거 같아요!

Choose a reason for hiding this comment

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

categories가 이상하다는 생각에 path로 바꾸었는데 잘못 바꾸었네요 ㅎㅎㅎ 고치도록 하겠습니다!

@crongro crongro merged commit 51d9cef into codesquad-members-2021:raqqoon Apr 26, 2021
@snowjang24
Copy link

snowjang24 commented Apr 26, 2021

질문에 대해 답변 드리자면,

  1. 단순한 궁금점입니다. css module을 사용하는게 더 성능면에서 좋다고 들었습니다. 현재 styled-components를 활용하여 개발을 진행하고 있습니다. 너무 많은 styled components를 만드는게 아닌가? 그런 생각이 계속 드네요. 아직 잘 활용을 못하기도 하고, css를 import해서 사용하던게 익숙해서 그런지 아직까지 css in js가 어렵게 느껴집니다. 현업에서는 어떤 방식을 더 많이 사용하는지 궁금합니다.

    • 이 래딧 포스트가 도움이 될 것 같습니다.
    • 개인적인 소견으로는, 성능 차이를 겪을 만큼의 문제를 아직 겪지 못했고, 생산성 측면에서 월등히 높은 스타일 컴포넌트 방식을 선호합니다.
      • 우선 개발 빠른 개발 이후 성능 이슈를 겪는다면 해당 부분에 대해서만 CSS Modules를 도입하는 등 여러 방식으로 개선할 수 있기 때문에 저는 생산성에서 월등한 styled-components를 사용합니다.,
    • 만약 styled방식이 불편하면 Emotion 방식의 inline css-in-js 스타일도 괜찮은 대안이 될 수 있으니 세 방법 중에 편한 걸 선택하시면 됩니다.
      • 참고로 styled-component 또한 emotion 처럼 css메서드를 제공합니다!
      • 저는 주로 styled-component라이브러리를 쓰며, 두 styled와 css 메서드를 함께 사용하고 있습니다.
  2. useState의 초기값으로 null값이나 []을 사용하고 있는데, 최초 렌더링시 에러처리를 이런 형태로 하는게 괜찮은지 궁금합니다.

    const Component = () => {
        const [data, setData] = useState(null);
        if (!data) return null; 
        return <OtherComponent data={data} />
    
     }
    • 코드 중간에 리뷰해드리기는 했지만, 데이터를 fetching 할때, 상태를 세 가지(pending, fulfilled, rejected)와 같이 나누는 것이 좋습니다.
    • 위의 상태에 따른 Loading component를 리턴하거나, error 문구 출력 등으로 최초 랜더링 시 문제도 자연스럽게 처리될 것으로 보입니다.
  3. .env 파일을 생성해서 path alias 를 했을 때, vsCode에서 컴포넌트를 auto import 할 때, 여전히 상대경로로 import가 되고 있는데 다른 설정이 필요한지 궁금합니다. 그리고 command 키를 이용해서 컴포넌트 내부로 들어갈 수 있어서 편리했는데, 설정을 하고나니 이걸 사용할 수 없게 되어 불편했습니다. 어떤식으로 검색해서 방법을 찾으면 좋을지 모르겠습니다.

  • 보통은 vscode가 프로젝트 파일 내에 jsconfig 파일을 탐색하고 이를 기준으로 eslint나 prettier를 설정하는데, 문제가 있는 것 같군요 혹시 아래의 설정도 안될까요 ?
  {
    "compilerOptions": {
      "baseUrl": ".",
      "paths": {
        "*": ["src/*"]
     }
   }
 }

crongro pushed a commit that referenced this pull request Apr 26, 2021
* Chore: 환경셋팅 및 폴더링

* Feat. MainMenu 마크업, itemCard 샘플 마크업#9

* Chore. 샘플카드 작성 #9

* Chore. Category 컴포넌트 생성

* Feat. Category UI #4

* Style. Add  Header Styled Component #18

* Chore : .gitignore 파일 생성

* Chore : 프로젝트 폴더인 BE 폴더 안에 .gitignore 파일 생성

* Chore : side dish 스프링 부트를 이용한 gradle 프로젝트 생성

* Feat : jdbc를 이용한 mysql 연결을 위해 application.properties 설정

* Feat : side dish 프로젝트의 schema.sql 파일 생성

* Chore: .gitignore 추가

* Style. Head style and react icon 추가 #18

* Feat. delivery 작업 중 #9

* Feat: dish 관련 클래스와 레포지토리 생성

기본 프로젝트 골격을 잡기 위해 Dish, DishController, DishRepository, DishService, BestDishResponseDTO의 틀 생성

* Feat: badge 관련 클래스와 레포지토리 생성

기본 프로젝트 골격을 잡기 위해 Badge, BadgeRepository 생성

* Style: Category style #4

* Feat. hover & badge 완료

* Style: Category UI #4

* Delete BE directory

* Delete .gitignore

* Feat. 초기데이터 fetch 요청
-Fetch custom Hook 작성
-초기데이터: 메인메뉴, 카테고리1번

* Feat. tabClick 효과 구현 #33, MainMenu Fetch #3

* Style. categorySlide 1줄 나열. #4

* Chore. 더보기 버튼 구현시작 #5

* Feat. 상세페이지 폼 구현
- 배경색설정/상세페이지 위치 가운데로 설정/x버튼구현
- x버튼 클릭  시 기존 페이지로 보여줌 #36

* Chore. 불필요한 코드, 파일 제외하여 pr하기

* Feat. 상세데이터 fetch  받아옴 #38

Co-authored-by: eamon3481 <68339352+eamon3481@users.noreply.github.com>
Co-authored-by: jeong-inho <derosatam76@gmail.com>
Co-authored-by: Jeong InHo <63284310+eNoLJ@users.noreply.github.com>
@somedaycode
Copy link

안녕하세요 리뷰를 맡은 스노우입니다. ☃️

전체적으로 컴포넌트 나누기나, 로직 분리가 너무 잘되어 있어 코드 읽는데 불편함 없이 너무 편하게 봤네요, 저보다 더 잘하시는거같아요! 👏👏👏

남은 진행사항들 완성하면 다시 한 번 코드를 구경하러 오고 싶군요 😃

안녕하세요.
정말 상세한 답변 감사드립니다. 항상 감사하게 생각하고 있어요.

웹폰트 로딩방법이나 에러처리 부분들을 더 공부하고 중복을 최대한 줄여야겠다는 생각이 드네요

또, 아직 부족하지만 칭찬해주시니 더 열심히 해야겠다는 생각도 드네요 ㅎㅎ

다음 PR에 말씀해주신 부분들 수정해서 올리겠습니다!

ksundong pushed a commit that referenced this pull request Apr 28, 2021
ClassPathResource 사용 시 URL이 File프로토콜을 사용하는지 확인한다.
하지만 executable jar로 실행 시, URL이 jar:file:로 되어 file프로토콜로
인식하지 못한다. 따라서 InputStream으로 수정.

Closes #18
ksundong pushed a commit that referenced this pull request Apr 28, 2021
[BE] DTO 설계 
closes issue #8
@somedaycode somedaycode deleted the raqqoon-dev branch April 29, 2021 04:49
wheejuni pushed a commit that referenced this pull request Apr 29, 2021
ksundong pushed a commit that referenced this pull request May 1, 2021
- DishRepository 생성 및 테스트 코드 추가
ksundong pushed a commit that referenced this pull request May 1, 2021
- DishService 생성 및 테스트 코드 추가
ksundong pushed a commit that referenced this pull request May 1, 2021
- DishController 생성 및 테스트 코드 추가
ksundong pushed a commit that referenced this pull request May 1, 2021
- BestRepository 생성
crongro pushed a commit that referenced this pull request May 3, 2021
* Chore. Category 컴포넌트 생성

* Feat. Category UI #4

* Style. Add  Header Styled Component #18

* Style. Head style and react icon 추가 #18

* Feat. delivery 작업 중 #9

* Style: Category style #4

* Feat. hover & badge 완료

* Style: Category UI #4

* Feat. 초기데이터 fetch 요청
-Fetch custom Hook 작성
-초기데이터: 메인메뉴, 카테고리1번

* Feat. tabClick 효과 구현 #33, MainMenu Fetch #3

* Style. categorySlide 1줄 나열. #4

* Chore. 더보기 버튼 구현시작 #5

* Feat. 상세페이지 폼 구현
- 배경색설정/상세페이지 위치 가운데로 설정/x버튼구현
- x버튼 클릭  시 기존 페이지로 보여줌 #36

* Chore. 불필요한 코드, 파일 제외하여 pr하기

* Feat: toggle button #5

* Feat. 상세데이터 fetch  받아옴 #38

* Feat: loading 중에 loading 이미지 삽입 #5

* Fix: 호버 이미지에 margin 적용 제거 #4

* Style: cursor and category title

* Feat. 배포API주소로 변경 (CATEGORY제외)

* Fix. REACT WARNING 수정: HEADER styled-components 선언 위치 수정

* Feat: env 파일에 url 넣기

* Chore: fetch 대신 axios 이용

* Fix: fetch error 임시로 고침

- detail 컴포넌트에서 처음에 fetch 받는 데이터를 유효한 url로 주어서 에러가 나오지 않게 했다.

* Fix: fetch error fix

- fetch hook 에 null 이 들어오면 fetch 를 하지 않게 해서 처음랜더링 될때 fetch 하지 않게 했음
- 더보기 클릭 연속으로하면 나타나는 warning Warning: Can't perform a React state update on an unmounted component.
-> useEffect에 클린함수로 상태값 초기화 시켜줘서 해결

* Fix: loading 화면 띄우게 하기

* Feat: Error handling

- useFetch 안에서 error 처리

* Fix: FeedBack 반영

- component 명칭 통일

* Fix: Feedback 반영

- ModalMode  => modalMode

* Feat: add Modal component

* Feat: loading gif MainMenu

* Feat: error component

* Chore. 복구

* Chore.  error 수정

* Feat. portal사용-> modalError 수정

* Fix: header hover 에러 고침

* Feat: stock 0 일시 버튼 disable

* Refactor: OrderBtn

* Feat. 수량 onChange 작업 중

* Chore. PRICEE + STOCK  관리 추가 MERGING

* Feat. 상세페이지 이미지클릭시 대표이미지 변경

* Feat. error 컴포넌트생성

* Feat. errorPage에서 메인홈으로 이동

* Chore. rebase FE

* Chore. rebase 2/13

* Chore : .gitignore 파일 생성

* Chore : 프로젝트 폴더인 BE 폴더 안에 .gitignore 파일 생성

* Chore : side dish 스프링 부트를 이용한 gradle 프로젝트 생성

* Feat : jdbc를 이용한 mysql 연결을 위해 application.properties 설정

* Feat : side dish 프로젝트의 schema.sql 파일 생성

* Chore: .gitignore 추가

* Feat: dish 관련 클래스와 레포지토리 생성

기본 프로젝트 골격을 잡기 위해 Dish, DishController, DishRepository, DishService, BestDishResponseDTO의 틀 생성

* Feat: badge 관련 클래스와 레포지토리 생성

기본 프로젝트 골격을 잡기 위해 Badge, BadgeRepository 생성

* Delete BE directory

* Delete .gitignore

* Chore. merging(error+oath)

* Feat. useFetch method전달방식 변경
- Ooath 인증코드 8080 포트로 post요청
-cors blocked

* Feat. 캐러셀 상세페이지 적용

* Feat. DetailPage 미니캐러셀 구현 중

* Feat. 재고주문api요청보냄, but실패

* Style : detailpage

* -

* Feat. LOGIN 요청중

* Chore. 로그인 작업구현중

* Feat. 재고수량 DB 업뎃가능, (새로고침시만)

* Fix: error

* Feat. Login구현
-atomic component화

* Feat. 받은 토큰으로 다시 get요청 ->  로그인정보 가져오기 구현

* Refactor . 파라미터 분해할당

* Chore. 불필요한 constant파일 삭제

* Feat.로그아웃 api 요청

* Update README.md

* Chore. igonore설정

* Chore.

* Chore. 끝나지않는 merge

* Feat. 범용성있는  Carousel은 전역 폴더링.
-기타 중복 파일 삭제

Co-authored-by: eamon3481 <68339352+eamon3481@users.noreply.github.com>
Co-authored-by: jeong-inho <derosatam76@gmail.com>
Co-authored-by: Jeong InHo <63284310+eNoLJ@users.noreply.github.com>
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.

4 participants