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

🎨 곡용 μ»΄ν¬λ„ŒνŠΈ μΆ”κ°€ (λ“œλ‘­λ‹€μš΄, 헀더, νŽ˜μ΄μ§€ μ»¨ν…Œμ΄λ„ˆ) #9

Merged
merged 22 commits into from
Oct 23, 2024

Conversation

suhwan2004
Copy link
Collaborator

@suhwan2004 suhwan2004 commented Oct 20, 2024

CheckList

  • [ V] gap을 μ΄μš©ν•˜μ—¬ μžμ‹ μš”μ†Œκ°„μ˜ 간격을 μ œμ–΄ν•˜μ˜€λ‚˜μš”? (iOS 14 λ―Έμ§€μ›μœΌλ‘œ gap -> space between 적용)

μž‘μ—… 이유

  • 곡톡 μ»΄ν¬λ„ŒνŠΈ(λ“œλ‘­λ‹€μš΄, 헀더, νŽ˜μ΄μ§€ μ»¨ν…Œμ΄λ„ˆ μΆ”κ°€)
  • ν”„λ‘œμ νŠΈ λ‚΄ svgr 적용

μž‘μ—… 사항

1️⃣ λ“œλ‘­λ‹€μš΄ μ»΄ν¬λ„ŒνŠΈ μΆ”κ°€

Dropdown μ»΄ν¬λ„ŒνŠΈμ˜ 경우, Shared에 μΆ”κ°€ν•˜μ˜€μœΌλ©° Dropdonw을 μ—΄ λ²„νŠΌκ³Ό 클릭 μ‹œ λˆ„λ₯΄λ©΄ λ‚˜μ˜€λŠ” λ©”λ‰΄μ˜ μœ„μΉ˜(top, right둜 μžμ²΄μ‘°μ •λ˜λŠ”...)의 경우 prop으둜 λ°›μ•„μ„œ μ²˜λ¦¬ν•˜λŠ” κ²ƒμœΌλ‘œ κ΅¬ν˜„ν•΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€.

μ™ λ§Œν•˜λ©΄, left, right, middle λ‹€μŒκ³Ό 같이 positionμ΄λΌλŠ” constλ₯Ό λ§Œλ“€μ–΄μ„œ μ²˜λ¦¬ν•˜λ € ν–ˆλŠ”λ° ν”Όκ·Έλ§ˆ 확인 μ‹œμ— right의 끝으둜 트리거 λ²„νŠΌμ΄ λ³΄μ΄λŠ” μΌ€μ΄μŠ€κ°€ μžˆμœΌλ‚˜ 이게 μ§„μ§œ 끝에 일자둜 뢙지 μ•Šμ•„μ„œ 이건 자체적으둜 prop으둜 λ„˜κ²¨μ€˜μ•Ό λ˜κ² κ΅¬λ‚˜ μƒκ°ν–ˆλ˜ 것 κ°™μŠ΅λ‹ˆλ‹€

image

2️⃣ 헀더 μ»΄ν¬λ„ŒνŠΈ κ΅¬ν˜„

Header μ»΄ν¬λ„ŒνŠΈμ˜ 경우 PageContainerμ—μ„œλ°–μ— μ‚¬μš©λ˜μ§€ μ•ŠλŠ” μ»΄ν¬λ„ŒνŠΈμ΄λ‚˜ 일단 λΆ„λ¦¬μ˜ λͺ©μ μœΌλ‘œ Shared에 μΆ”κ°€ν•΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€. 이건 PageContainer에 넣을지에 λŒ€ν•œ μ—¬λŸ¬λΆ„μ˜ 의견이 κΆκΈˆν•©λ‹ˆλ‹€.

νŽ˜μ΄μ§€ μ»¨ν…Œμ΄λ„ˆμ˜ 뢀속 λŠλ‚Œμ΄λ‹€ λ³΄λ‹ˆ, stories νŒŒμΌμ€ λ”°λ‘œ λ§Œλ“€μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.

3️⃣ νŽ˜μ΄μ§€ μ»¨ν…Œμ΄λ„ˆ μ»΄ν¬λ„ŒνŠΈ κ΅¬ν˜„

PageContainer의 경우, Header μ»΄ν¬λ„ŒνŠΈλ₯Ό μ°Έμ‘°ν•˜κ³  μžˆλŠ”λ° shared에 넣을 μ‹œμ— 동일 κ³„μΈ΅μ˜ μ»΄ν¬λ„ŒνŠΈ μ°Έμ‘°κ°€ λ˜μ–΄ widget에 λ„£μ–΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€.

기본적으둜 fixedλ₯Ό κ±Έκ³ , ν—€λ”μ˜ height 만큼 (ν˜„μž¬λŠ”, 저희 ν”„λ‘œμ νŠΈλ‚΄ ν—€λ”λŠ” 44px μ‚¬μš©λ˜λŠ” 쀑) margin top을 μ»¨ν…Œμ΄λ„ˆ λ‚΄ μ»¨ν…μΈ μ˜μ—­μ„ κ°μ‹ΈλŠ” div에 μ£Όμ—ˆμŠ΅λ‹ˆλ‹€.

λž˜ν•‘ν•˜λŠ” μ»΄ν¬λ„ŒνŠΈμ΄λ‹€ λ³΄λ‹ˆ, stories νŒŒμΌμ€ λ”°λ‘œ λ§Œλ“€μ§€ μ•Šμ•˜μœΌλ‚˜, page.tsx에 μ‹€μ μš© μ‹œμΌœλ‘μ—ˆμŠ΅λ‹ˆλ‹€ ( 헀더 μ»΄ν¬λ„ŒνŠΈλ„ μ—¬κΈ°μ„œ 확인 κ°€λŠ₯ν•©λ‹ˆλ‹€!)

4️⃣ ν”„λ‘œμ νŠΈ λ‚΄ SVGR 적용

μ²˜μŒμ—λŠ” λ””μŠ€μ½”λ“œλ‘œ svg spriteλ₯Ό λ„μž…ν•˜λŠ” λ°©ν–₯으둜 μ–˜κΈ°λ₯Ό λ‚˜λˆ„μ—ˆμ—ˆλŠ”λ°μš”. svg spriteλ₯Ό μœ„ν•œ providerλ₯Ό λ§Œλ“€μ–΄μ„œ μ‹€μ œ μ μš©ν•˜μ˜€μ„ λ•Œ document.body에 react의 ν¬νƒˆλ‘œ

export default function GlobalSVGProvider() {
  return createPortal(spliteSvgCode, document.body);
}

μ΄λ ‡κ²Œ spliteSvgCodeλΌλŠ” svgμ•„μ΄μ½˜ 덩어리 νƒœκ·Έλ₯Ό λ„£μ–΄μ£ΌλŠ” 둜직이 μžˆλŠ”λ° μ΄λΆ€λΆ„μ—μ„œ document의 경우 ssrλ‚΄ μ‘΄μž¬ν•˜μ§€ μ•ŠκΈ°μ—, mountedλ˜μ–΄ 돔이 μƒμ„±λœ 후에 이 μž‘μ—…μ„ ν•΄μ•Ό 해결이 κ°€λŠ₯ν–ˆμŠ΅λ‹ˆλ‹€.

μ•„λž˜ μ°Έμ‘° url λ‚΄ λ°©μ‹μ²˜λŸΌ useEffectλ₯Ό μ‚¬μš©ν•˜μ—¬ 이 뢀뢄은 ν•΄κ²°ν•˜μ˜€μœΌλ‚˜, μ‹€μ œ λ Œλ”λ§ μ‹œμ— useEffectμ—μ„œ moutned된 것이 μ²΄ν‚Ήλ˜κΈ° 전인 1~2μ΄ˆλ™μ•ˆ μ•„μ΄μ½˜μ΄ 화면에 μ•ˆλ³΄μ΄λŠ” μ΄μŠˆκ°€ μžˆμ—ˆμŠ΅λ‹ˆλ‹€.

κ·Έλž˜μ„œ, 결ꡭ은 svg spriteλ₯Ό ν¬κΈ°ν•˜κ³ , svgr μ„ΈνŒ…μ„ μ§„ν–‰ν–ˆκ³  μ—°κ³„λ‘œ λ‹€μŒκ³Ό 같은 μž‘μ—…λ„ μΆ”κ°€λ‘œ μ§„ν–‰ν–ˆμŠ΅λ‹ˆλ‹€.

  • turbopack을 μ“°λŠ” next.js에 맞좰 μΆ”κ°€ μ„ΈνŒ… (next.config.mjs μ—μ„œ 확인 κ°€λŠ₯ν•©λ‹ˆλ‹€.)
  • storybookμ—μ„œ svgr 적용 μ•ˆλ˜λŠ” 이슈 μˆ˜μ • (storybook ν΄λ”μ˜ main.tsμ—μ„œ 확인 κ°€λŠ₯ν•©λ‹ˆλ‹€)

μ°Έκ³ ν•œ μ£Όμ†Œμž…λ‹ˆλ‹€.
svg sprite ꡬ성
https://velog.io/@adultlee/Svg-sprite-%EA%B8%B0%EB%B2%95%EC%9D%84-%EC%9D%B4%EC%9A%A9%ED%95%9C-%EB%82%B4%EA%B0%80-%EC%89%AC%EC%9A%B4-Icon-%EC%BB%B4%ED%8F%AC%EB%84%8C%ED%8A%B8-%EA%B0%9C%EB%B0%9C

svg sprite ssr λ‚΄ 문제 ν•΄κ²° 방법
https://coggiee.medium.com/svg-sprite-icon-%EC%82%AC%EC%9A%A9%EC%8B%9C-%EB%B0%9C%EC%83%9D%ED%95%9C-hydration-error-%EC%B2%98%EB%A6%AC-99f082f08331

리뷰어가 μ€‘μ μ μœΌλ‘œ 확인해야 ν•˜λŠ” λΆ€λΆ„

  • 곡용 μ»΄ν¬λ„ŒνŠΈμ˜ μž¬μ‚¬μš©μ„±κ³Ό ν™•μž₯성이 μΆ©λΆ„ν•œκ°€μš”?
  • 곡용 μ»΄ν¬λ„ŒνŠΈμ˜ props ꡬ쑰가 νš¨μœ¨μ μΈκ°€μš”?
  • 곡용 μ»΄ν¬λ„ŒνŠΈμ˜ 폴더 μœ„μΉ˜κ°€ ν•©λ‹Ήν•œκ°€μš”?
  • svg sprite 유보 및 svgr λ„μž…μ— λŒ€ν•΄ λ†“μΉœ 것은 μ—†λ‚˜μš”?

λ°œκ²¬ν•œ 이슈

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-9.d1rrzjx2upcmxq.amplifyapp.com

Copy link

github-actions bot commented Oct 21, 2024

πŸ” Visual review for your branch is published πŸ”

Here are the links to:

Copy link
Collaborator

@BangDori BangDori left a comment

Choose a reason for hiding this comment

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

  • FSD Architectureμ—μ„œλŠ” λ‹€λ₯Έ λ ˆμ΄μ–΄μ—μ„œ λͺ¨λ“ˆμ„ 뢈러올 λ•Œ Public APIλ₯Ό 톡해 λͺ¨λ“ˆμ„ λΆˆλŸ¬μ˜€λ„λ‘ κ·œμΉ™μ„ μ§€μΌœμ£Όμ…”μ•Ό ν•©λ‹ˆλ‹€.
  • 곡용 μ»΄ν¬λ„ŒνŠΈμ˜ 폴더 μœ„μΉ˜μ™€ κ·Όκ±°κ°€ ν•©λ‹Ήν–ˆλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€.
  • μš°μ„  ν˜„μž¬λŠ” PR에 λŒ€ν•΄μ„œλŠ” svgr λ°©μ‹μœΌλ‘œ λ³‘ν•©ν•˜λ˜ 회의λ₯Ό ν†΅ν•΄μ„œ svg sprite와 같은 κΈ°λ²•μ˜ λ„μž…μ— λŒ€ν•΄ κ³ λ―Όν•  ν•„μš”κ°€ μžˆλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€! (svg-sprite의 μž₯점이 λ„ˆλ¬΄λ‚˜λ„ 크기에...)

next.config.mjs Outdated Show resolved Hide resolved
src/shared/ui/header/ui/Header.tsx Outdated Show resolved Hide resolved
src/widgets/pageContainer/ui/PageContainer.tsx Outdated Show resolved Hide resolved
src/shared/ui/dropdown/ui/Dropdown.stories.tsx Outdated Show resolved Hide resolved
src/shared/ui/dropdown/ui/Dropdown.tsx Outdated Show resolved Hide resolved
src/shared/ui/dropdown/ui/Dropdown.tsx Show resolved Hide resolved
Copy link
Collaborator

@BangDori BangDori left a comment

Choose a reason for hiding this comment

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

이전 λ¦¬λ·°μ—μ„œ λ†“μΉœ λ‚΄μš©μ΄ μžˆμ–΄μ„œ μ•„λž˜ 리뷰듀도 같이 확인 λΆ€νƒλ“œλ¦΄κ²Œμš”!!!

src/shared/ui/header/ui/Header.tsx Outdated Show resolved Hide resolved
src/shared/ui/header/ui/Header.tsx Show resolved Hide resolved
src/shared/ui/dropdown/ui/Dropdown.stories.tsx Outdated Show resolved Hide resolved
src/shared/ui/dropdown/ui/Dropdown.stories.tsx Outdated Show resolved Hide resolved
src/shared/ui/dropdown/ui/Dropdown.tsx Show resolved Hide resolved
Copy link
Collaborator

@BangDori BangDori left a comment

Choose a reason for hiding this comment

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

μˆ˜ν™˜λ‹˜ μ½”λ“œλ₯Ό λ¦¬λ·°ν•˜λ©΄μ„œ μ΄ν•΄ν•˜λ €κ³  λ§Žμ€ 고민을 ν–ˆλŠ”λ°, κ³ λ―Όν•œ μ‹œκ°„μ΄ μ „ν˜€ 아깝지 μ•Šμ•˜λ˜ μ‹œκ°„μ΄μ˜€λ„€μš”. μˆ˜ν™˜λ‹˜μ΄ μ–Όλ§ˆλ‚˜ λ²”μš©μ„±κ³Ό ν™•μž₯성을 κ³ λ €ν•˜μ‹œλ©΄μ„œ μ½”λ“œλ₯Ό μž‘μ„±ν•˜μ‹œλŠ”μ§€μ— λŒ€ν•΄ 배울 수 μžˆμ—ˆμŠ΅λ‹ˆλ‹€..!

이번 PRμ—μ„œ λ§Žμ€ 배움을 μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€. ν˜„μž¬ Resolveλ˜μ§€ μ•Šμ€ μ½”λ©˜νŠΈλ“€μ€ μˆ˜ν™˜λ‹˜μ΄ ν™•μΈν•˜μ‹œκ³  Resolve 처리 ν•˜μ‹œλ©΄ 될 κ±° κ°™μŠ΅λ‹ˆλ‹€!! κ³ μƒν•˜μ…¨μŠ΅λ‹ˆλ‹€

src/shared/ui/dropdown/ui/Dropdown.tsx Show resolved Hide resolved
src/shared/ui/header/ui/Header.tsx Show resolved Hide resolved
@suhwan2004 suhwan2004 merged commit cdf4564 into main Oct 23, 2024
3 checks passed
@suhwan2004 suhwan2004 deleted the feat/common-component-sh branch October 23, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants