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

[#33] 쿠폰 조회 레이아웃 추가 & 일부 객실 리스트 목록 추가 #46

Merged
merged 13 commits into from
Jan 19, 2024

Conversation

jinjoo-jung
Copy link
Collaborator

close #33

Description

  • 쿠폰 아이템 노출 대기, 노출 만료 쿠폰 추가 (컴포넌트로 분리)
  • 선택한 탭 클릭시 색상 변경
  • 일부객실 리스트 목록 레이아웃 구현
    -> useRef 사용하여 리스트 영역 밖 클릭시 닫히도록
    -> 객실 이름 10글자 까지만 보이고 나머지 ... 처리

유의할 점 및 ETC (Optional)

스크린샷 (Optional)

스크린샷 2024-01-18 오후 2 47 04 스크린샷 2024-01-18 오후 2 47 20 스크린샷 2024-01-18 오후 2 47 11

Copy link

vercel bot commented Jan 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cool-peace ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 7:09am
cool-peace-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 7:09am

@jinjoo-jung jinjoo-jung added the design 스타일 label Jan 18, 2024
Copy link
Collaborator

@JitHoon JitHoon left a comment

Choose a reason for hiding this comment

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

고생하셨습니다..!

}

// api 데이터 타입
export interface CouponLitResponse {
Copy link
Collaborator

Choose a reason for hiding this comment

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

CouponLitResponse 오타난 것 같습니다!
CouponListResponse

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

앗 감사합니다 ㅎㅎ

Comment on lines +10 to +11
const [resisterDateClick, setResisterDateClick] = useState<string>('1년');
const [categoryTab, setCategoryTab] = useState<string>('전체');
Copy link
Collaborator

Choose a reason for hiding this comment

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

타입 추론이 되면서 '1년', '전체'를 보고 개발자도 쉽게 알 수 있는 타입의 경우 타입 명시를 안하셔도 충분할 것 같습니다!

  const [resisterDateClick, setResisterDateClick] = useState('1년');
  const [categoryTab, setCategoryTab] = useState('전체');

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오 ! 그렇군요 감사합니다! 반영하였습니다.

@@ -0,0 +1,224 @@
import styled from '@emotion/styled';
import theme from '@styles/theme';
Copy link
Collaborator

Choose a reason for hiding this comment

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

개행 부탁드립니다!

// 외부 라이브러리 import
import styled from '@emotion/styled';

// 내부 프로젝트 파일 import
import theme from '@styles/theme';

Comment on lines 89 to 100
const CouponStatus = styled.div`
width: 50px;
height: 22.927px;

display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
border-radius: 22.927px;
color: #757676;
background: ${theme.colors.white};
`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

const CouponStatus = styled.div`
  width: 50px;
  height: 22.927px;

  border-radius: 22.927px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 10px;
  color: #757676;
  background: ${theme.colors.white};
`;

css 컨벤션 통일 부탁드립니다!

Comment on lines 1 to 7
import { useState } from 'react';
import styled from '@emotion/styled';
import theme from '@styles/theme';

import toggleOnIcon from '@assets/icons/ic-couponlist-toggleOn.svg';
import toggleOffIcon from '@assets/icons/ic-couponlist-toggleOff.svg';
import { ToggleStyleProps } from '@/types/couponList';
Copy link
Collaborator

Choose a reason for hiding this comment

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

// 외부 라이브러리 import
import { useState } from 'react';
import styled from '@emotion/styled';

// 프로젝트 내부 파일 import
import toggleOnIcon from '@assets/icons/ic-couponlist-toggleOn.svg';
import toggleOffIcon from '@assets/icons/ic-couponlist-toggleOff.svg';
import { ToggleStyleProps } from '@/types/couponList';
import theme from '@styles/theme';

Comment on lines 1 to 4
import styled from '@emotion/styled';
import theme from '@styles/theme';

import centerIcon from '@assets/icons/ic-couponlist-center.svg';
Copy link
Collaborator

Choose a reason for hiding this comment

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

// 외부 라이브러리 import
import styled from '@emotion/styled';

// 프로젝트 내부 파일 import
import theme from '@styles/theme';
import centerIcon from '@assets/icons/ic-couponlist-center.svg';

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

앗 제가 theme 파일을 외부로 착각했네요 😂 신경써서 컨벤션 주의하겠습니다~! 모두 수정하였습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

진주님 빌드도 실패로 뜨는데 github actions 확인 후 에러 해결 부탁드립니다!

Copy link
Collaborator

@turkey-kim turkey-kim left a comment

Choose a reason for hiding this comment

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

api 응답 타입까지 추가해주셨네요! 수고많으셨습니다!

Comment on lines +102 to +108
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
border-radius: 22.927px;
color: ${theme.colors.white};
background: #404446;
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
Collaborator Author

Choose a reason for hiding this comment

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

넵! 수정하였습니다!

Copy link
Collaborator

@dabin-Hailey dabin-Hailey left a comment

Choose a reason for hiding this comment

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

조회도 레이아웃 작업 많으셨을텐데 😢 수고하셨습니다!!

setIsToggle(!isToggle);
};
return (
<CouponContainer isToggle={isToggle}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

<CouponContainer $isToggle={isToggle}>

스타일링을 위해 prop을 넘길 때는 prop명에 prefix로 $ 기호를 붙여야되는 걸로 알고있습니다..!
$없이 텍스트로만 작성하면 HTML 요소의 속성이라고 인식하기 때문입니다.
즉, 해당 prop은 HTML 요소의 속성이 아닌 styled를 위해 사용하는 것임을 알려주기 위해 사용한다고 볼 수 있습니다.

참고 자료
styled-component에 props 보낼 때 나오는 warning 해결

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

헉 그래서 모두 $를 붙이고 계셨군요... 다 모두 $ 기호 붙여서 수정하였습니다!

<TabName>전체</TabName>
<TabCount>8</TabCount>
<TabCount categoryTab={categoryTab === '전체'}>8</TabCount>
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분도 접두사 $ 붙여주시면 좋을 것같습니다!
다른 부분에도 style을 위한 prop이 있는지 확인해보시면 좋을 것같습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design 스타일
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[design] 쿠폰대기, 만료 , 중지 레이아웃 & 카테고리 탭 구현
4 participants