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

[Feature/BAR-149] 참고하는 페이지 UI 구성 #49

Merged
merged 22 commits into from
Feb 9, 2024
Merged

Conversation

miro-ring
Copy link
Contributor

Summary

구현 내용 및 작업한 내역을 요약해서 적어주세요

  • 0f2dcce 반응형을 위한 sprinkle 추가
  • 362f6c3 global에 설정된 스타일 요소 제거
  • b1015df 메인 페이지 개발
  • abaf688 참고하는 페이지 UI 개발

To Reviewers

aea4206
hover시에 svg 아이콘 색상을 바꾸고 싶은데... className을 전달하기 않고 처리하는 좋은 방법이 있을까요?

How To Test

/main 페이지에서 탭 이동을 통해 참고하는 페이지 확인이 필요합니다.

@miro-ring miro-ring self-assigned this Feb 5, 2024
Copy link

github-actions bot commented Feb 5, 2024

@miro-ring miro-ring changed the title [BAR-149] 참고하는 페이지 UI 구성 [Feature/BAR-149] 참고하는 페이지 UI 구성 Feb 5, 2024
@miro-ring
Copy link
Contributor Author

현재 2가지 문제가 있습니다.

  1. 참고하는 페이지에서만 전체 영역에 스크롤이 있어서 토글이 이뤄지는 경우 딸깍 거리는 느낌이 있다는점 (모든 페이지에서 스크롤바를 제거하면 어떨까 합니다.)
  2. 스크롤을 내린 상태에서 토글을 하는 경우 애니메이션이 깨진다는점

이 두 문제도 이어서 확인해보겠습니다.

Copy link
Member

@dmswl98 dmswl98 left a comment

Choose a reason for hiding this comment

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

굿굿 수고하셨습니다~

스크롤을 내린 상태에서 토글을 하는 경우 애니메이션이 깨진다는점

탭에 대한 내용인 것 같은데 position: fixed 때문에 그런 것 같네요... 저도 알아볼게요!

Comment on lines 53 to 55
{
padding: '28px 32px 20px',
},
Copy link
Member

Choose a reason for hiding this comment

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

  1. padding 속성은 없어도 될 것 같아요.
  2. footer의 숫자 값에 대한 스타일링이 피그마 디자인과 달라요.

현재 상태

image

padding 속성이 없으면 다음과 같은 모습입니다.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmswl98
image
적용하지 않으면 제시된 패딩과 값이 다르지 않나요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

추가적으로 footer에 적용된 margin-bottom: 8px은 제거하는게 어떨까요? devtools 켜고 호버했을 때 영역이 깨지기도 하고, 굳이 음수값을 쓰지 않아도 괜찮을 것 같아서요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

592ccaa
footer 문구 반영하였습니다!

},
];

const ReferTab = () => {
Copy link
Member

Choose a reason for hiding this comment

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

ReferTab 대신 ReferTabContent 또는 참고하는TabContent로 수정하면 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmswl98
좋네요!
cfb5c87
해당 커밋에서 반영해보았습니다. 폴더명도 한글을 쓰는게 훨씬 직관적일 것 같아서 반영해보았습니다.

@wonjin-dev
괜찮다면 이후 작업에서 domain/writedomain/끄적이는 으로 바꿔보면 어떨까요?

Copy link
Member

Choose a reason for hiding this comment

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

전 좋아요~!

Comment on lines 1 to 25
export interface Refer {
templateId: number;
category:
| 'ask'
| 'report'
| 'celebrate'
| 'thank'
| 'comfort'
| 'regard'
| 'etc';
subCategory: string;
content: string;
savedCount: number;
copiedCount: number;
}

export enum Category {
ask = '부탁하기',
report = '보고하기',
celebrate = '축하하기',
thank = '감사 전하기',
comfort = '위로하기',
regard = '안부 전하기',
etc = '기타',
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export interface Refer {
templateId: number;
category:
| 'ask'
| 'report'
| 'celebrate'
| 'thank'
| 'comfort'
| 'regard'
| 'etc';
subCategory: string;
content: string;
savedCount: number;
copiedCount: number;
}
export enum Category {
ask = '부탁하기',
report = '보고하기',
celebrate = '축하하기',
thank = '감사 전하기',
comfort = '위로하기',
regard = '안부 전하기',
etc = '기타',
}
export interface Refer {
templateId: number;
category: keyof typeof CATEGORY;
subCategory: string;
content: string;
savedCount: number;
copiedCount: number;
}
const CATEGORY = {
ask: '부탁하기',
report: '보고하기',
celebrate: '축하하기',
thank: '감사 전하기',
comfort: '위로하기',
regard: '안부 전하기',
etc: '기타',
} as const;

이렇게 작성하면 중복 코드가 줄어들 것 같아요~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmswl98
70e72a4
좋네요! 말씀 주신 부분 반영해보았습니다 ㅎㅎ

const categoryNameKr = Category[category];

return (
<Card type="refer">
Copy link
Member

Choose a reason for hiding this comment

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

type 대신 className을 받아서 도메인과 관련된 내용들의 스타일은 외부에서 주입하는건 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

className을 외부 주입 하는 형태로 반영하였습니다!

data: Refer;
}

const ReferCard = ({ data }: ReferCardProps) => {
Copy link
Member

@dmswl98 dmswl98 Feb 6, 2024

Choose a reason for hiding this comment

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

TemplateCard or ReferTemplateCard or 참고하는TemplateCard는 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmswl98
좋네요 ㅎㅎ
5bf92c1
해당 커밋에서 반영해보았습니다!

Comment on lines 1 to 4
export const getNumToK = (num: number) => {
if (num < 1000) return num;
return `${num / 1000}k`;
};
Copy link
Member

Choose a reason for hiding this comment

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

const formatter = new Intl.NumberFormat('en', { notation: 'compact' })

const view1 = 1200;
formatter.format(view1); // '1.2K'

const view2 = 1200000;
formatter.format(view); // '1.2M'

Intl.NumberFormat을 사용하면 후에 여러 기준(1000, ...)에 따라 자동으로 포맷팅이 되서 대신 사용해보면 좋을 것 같아요.

export const formatNumber = (number: number) => {
  const formatter = new Intl.NumberFormat('en', { notation: 'compact' })
  return formatter.format(number);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmswl98
오 이런게 있었군요!! 감사합니다 ㅎㅎ
92ce4d6
여기에서 반영해봤어요

const ReferCard = ({ data }: ReferCardProps) => {
const { category, subCategory, content, copiedCount, savedCount } = data;

const categoryNameKr = Category[category];
Copy link
Member

Choose a reason for hiding this comment

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

CATEGORY_COLOR의 키값이 한국어로 되어 있어서 그렇군요!
아래 값 참고해서 CATEGORY_COLOR의 키값을 영어로 맞추면 좋을 것 같네요

const CATEGORY = {
  ask: '부탁하기',
  report: '보고하기',
  celebrate: '축하하기',
  thank: '감사 전하기',
  comfort: '위로하기',
  regard: '안부 전하기',
  etc: '기타',
} as const;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmswl98
어짜피 한국어로의 전환이 한번 필요해서 현재 형태로 유지하는게 어떨까요?

Copy link
Member

@dmswl98 dmswl98 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~~!

스크롤을 내린 상태에서 토글을 하는 경우 애니메이션이 깨진다는점

이 부분은 나중에 고쳐보도록 합시다!

@miro-ring miro-ring merged commit 0f88923 into main Feb 9, 2024
@miro-ring miro-ring deleted the feature/BAR-149 branch February 9, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants