Skip to content

Directory

Lim Hyunwoo edited this page Apr 30, 2021 · 6 revisions

โœ”๏ธ ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ

src/
  apis (fetch)
  commons (์ „์—ญ ์Šคํƒ€์ผ, ํ…Œ๋งˆ, ์ƒ์ˆ˜ ๋“ฑ)
  assets (์ด๋ฏธ์ง€, ์•„์ด์ฝ˜ ๋“ฑ ์ •์  ์ž์›)
  components (๋ชจ๋“  ์ปดํฌ๋„ŒํŠธ)
  pages (ํ…œํ”Œ๋ฆฟ ๊ฐ€์ ธ์™€ ์ตœ์ข…์ ์œผ๋กœ ๋ทฐ๋กœ ๋ณด์—ฌ์ง€๋Š” ๊ณณ)
  utils (๋ฌธ์ž์—ด ์œ ํŒ…, ๋ฐฐ์—ด ์œ ํ‹ธ ๋“ฑ)
  hooks (๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์„ ์œ„ํ•œ ์ปค์Šคํ…€ ํ›…๋“ค(get data))
  types (ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์ธํ„ฐํŽ˜์ด์Šค)
  stores (context api)

โœ”๏ธ ์•„ํ† ๋ฏน ๋””์ž์ธ ์‹œ์Šคํ…œ

src/
  components/
        atoms/
        molecules/
        organisms/
        templates/
  pages/
atoms
  • ๊ฐ€์žฅ ์ž‘์€ ๋‹จ์œ„์˜ ์ปดํฌ๋„ŒํŠธ
  • Label, Input, Button, Select, CheckBox์™€ ๊ฐ™์ด ๊ธฐ๋Šฅ์ , ์˜๋ฏธ๋ก ์ ์œผ๋กœ ๊ฐ€์žฅ ์ž‘์€ ๋‹จ์œ„์˜ ์ปดํฌ๋„ŒํŠธ
  • ๊ณ„์† ์žฌ์‚ฌ์šฉํ•ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ํŠน์ • ๊ธฐ๋Šฅ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹Œ, ์ผ๋ฐ˜์ ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•จ
molecules
  • atom์„ ์—ฌ๋Ÿฌ๊ฐœ ์กฐํ•ฉํ•œ ์ปดํฌ๋„ŒํŠธ
  • ์˜ˆ๋ฅผ ๋“ค์–ด, Label + (Input | CheckBox | Select)๋ฅผ ์กฐํ•ฉํ•˜์—ฌ FormItem์ด๋ผ๋Š” ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋งŒ๋“ค์–ด atom ์ปดํฌ๋„ŒํŠธ๋ฅผ ์žฌ์‚ฌ์šฉ
organisms
  • atom๊ณผ molecule์„ ์กฐํ•ฉํ•˜์—ฌ ์ปดํฌ๋„ŒํŠธ ์ƒ์„ฑ
  • ์˜ˆ๋ฅผ ๋“ค์–ด, FormItem์„ ์—ฌ๋Ÿฌ๊ฐœ ์กฐํ•ฉํ•˜์—ฌ SignUpForm์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Œ
  • ํŠน์ • ๊ธฐ๋Šฅ์„ ์ง์ ‘ ์ˆ˜ํ–‰ํ•˜์ง„ ์•Š์Œ
templates
  • ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์ด ๋ฐฐ์ œ๋œ ์™„์ „ํžˆ ์Šคํƒ€์ผ๋ง์— ์ง‘์ค‘ํ•œ ๋‹จ์œ„
  • ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ฃผ์ž…๋งŒ ํ•˜๋ฉด ๋ฐ”๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•œ๋‹ค
pages
  • ํ•ด๋‹น template์— ์•Œ๋งž์€ ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ฃผ์ž…ํ•˜์—ฌ ์‚ฌ์šฉ
  • ์ „์ฒด์ ์ธ ๋กœ์ง์ด๋‚˜ ์ƒํƒœ๋ฅผ ์ด ๋‹จ๊ณ„์—์„œ ์ œ์–ดํ•œ๋‹ค.

โœ”๏ธ ์ƒํƒœ๊ด€๋ฆฌ

  • ๊ฐ ์ปดํฌ๋„ŒํŠธ์—์„œ ์ผ๋ฐ˜์ ์ธ ์ƒํƒœ (disabled, focused ๋“ฑ)๋ฅผ ๊ด€๋ฆฌ
  • ๊ฐ page๋ณ„๋กœ state๊ด€๋ฆฌ, ํ•ด๋‹น ์ƒํƒœ๋ฅผ page -> organism -> molecule -> atom์œผ๋กœ ๋‚ด๋ ค์ฃผ๋Š” ๋ฐฉ์‹
  • ์ „์—ญ ์ƒํƒœ๊ด€๋ฆฌ๋Š” Context API๋กœ ๊ด€๋ฆฌ

์ฐธ๊ณ