diff --git a/README.md b/README.md index db47f17..201344b 100644 --- a/README.md +++ b/README.md @@ -18,21 +18,24 @@ ## πŸ‘₯ νŒ€ & μ—­ν•  (RnR) -| ꡬ성원 | 곡톡 μž‘μ—… | UI μ»΄ν¬λ„ŒνŠΈ | νŽ˜μ΄μ§€ | +| | | | | +| :------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | +| μœ„μ†Œν˜„(νŒ€μž₯)
[@sohyun0](https://github.com/sohyun0) | λ°•μ‹ μ²œ
[@jeschun](https://github.com/jeschun) | μœ μΈν™”
[@gummmmmy0v0](https://github.com/gummmmmy0v0) | μ–‘μž¬μ˜
[@BaeZzi813](https://github.com/BaeZzi813) | + +
-|---|---|---|---| +| ꡬ성원 | 곡톡 μž‘μ—… | UI μ»΄ν¬λ„ŒνŠΈ | νŽ˜μ΄μ§€ | | νŒ€μ›μ „μ› | λ””μžμΈ 및 κΈ°λŠ₯ QA / 본인 μž‘μ—…κ΄€λ ¨ λ¬Έμ„œ | | | -| λ°•μ‹ μ²œ | | 인풋, λͺ¨λ‹¬, λ²„νŠΌ | 둜그인, νšŒμ›κ°€μž…, λ‚΄ν”„λ‘œν•„ 등둝, 상세 | +| λ°•μ‹ μ²œ | 인풋, λͺ¨λ‹¬, λ²„νŠΌ | 둜그인, νšŒμ›κ°€μž…, λ‚΄ν”„λ‘œν•„ 등둝, 상세 | -| μ–‘μž¬μ˜ | μ‹œμ—°μ˜μƒ μ€€λΉ„ | 곡톡 ν”„λ ˆμž„, ν‘Έν„°, ν† μŠ€νŠΈ, νŽ˜μ΄μ§€λ„€μ΄μ…˜, μŠ€μΌˆλ ˆν†€ UI | κ°€κ²Œ 정보 등둝, -상세 | +| μ–‘μž¬μ˜ | μ‹œμ—°μ˜μƒ μ€€λΉ„ | 곡톡 ν”„λ ˆμž„, ν‘Έν„°, ν† μŠ€νŠΈ, νŽ˜μ΄μ§€λ„€μ΄μ…˜ | κ°€κ²Œ 정보 등둝, 상세 | -| μœ„μ†Œν˜„ | 초기 ν”„λ‘œμ νŠΈ μ…‹νŒ… / 곡용 λ¬Έμ„œ μž‘μ„± 및 관리(λ…Έμ…˜) | 헀더, ν•„ν„°, λ“œλ‘­λ‹€μš΄, post, 컬러, -폰트, μ•„μ΄μ½˜ | 곡고 리슀트, 상세 | +| μœ„μ†Œν˜„ | λ°œν‘œ | 초기 ν”„λ‘œμ νŠΈ μ…‹νŒ… / 곡용 λ¬Έμ„œ μž‘μ„± 및 관리(λ…Έμ…˜) | 헀더, ν•„ν„°, λ“œλ‘­λ‹€μš΄, post, +μ»¨ν…Œμ΄λ„ˆ, μŠ€μΌˆλ ˆν†€ UI, 컬러, 폰트, μ•„μ΄μ½˜ | 곡고 리슀트, 상세 | -| μœ μΈν™” | λ°œν‘œμžλ£Œ 및 λ°œν‘œ | ν…Œμ΄λΈ”, μ•Œλ¦Ό, μΊ˜λ¦°λ” | κ°€κ²Œ 곡고 등둝, 상세 | +| μœ μΈν™” | λ°œν‘œμžλ£Œ μ€€λΉ„ | ν…Œμ΄λΈ”, μ•Œλ¦Ό, μΊ˜λ¦°λ” | κ°€κ²Œ 곡고 등둝, 상세 | > λ‹΄λ‹Ή λ²”μœ„λŠ” 개발 쀑 μƒν˜Έ ν˜‘μ˜λ‘œ 쑰정될 수 있음. @@ -63,6 +66,12 @@ --- +## πŸš€ μ›Œν¬ν”Œλ‘œμš° κ°œμš” + +![μ›Œν¬ν”Œλ‘œμš° λ‹€μ΄μ–΄κ·Έλž¨](assets/images/workflow.png) + +--- + ## πŸ—“οΈ μ§„ν–‰ 일정 (μš”μ•½) - **전체 κΈ°κ°„**: 2025-09-29 ~ 2025-10-22 @@ -182,8 +191,6 @@ project-root/ > > - `components/features/`λŠ” **도메인 λ‹¨μœ„ UI**(예: `PostForm`, `PostList`) 쀑심. > - `pages/`μ—μ„œλŠ” **λΌμš°νŒ…κ³Ό 데이터 μ£Όμž…**만 λ‹΄λ‹Ήν•˜λ„λ‘ 뢄리. -> - `lib/axios/`에 **axios instance**Β·μΈν„°μ…‰ν„°Β·μ—λŸ¬ ν•Έλ“€λŸ¬ 배치. -> - `lib/validators/`λŠ” Zod/Yup 쀑 택1, 폼과 API κ²½κ³„μ—μ„œ ν™œμš©. > - `constants/`에 라우트/ν‚€/μ—λŸ¬ λ©”μ‹œμ§€ μƒμˆ˜ν™” β†’ ν•˜λ“œμ½”λ”© λ°©μ§€. --- @@ -219,11 +226,17 @@ NEXT_PUBLIC_API_BASE=... ## 🧭 λΌμš°νŒ…(μ›Œν¬ν”Œλ‘œμš°) λ©”λͺ¨ - `/` : 메인 -- `/list` : 룰패 λͺ©λ‘ -- `/post` : 룰패(ν…œν”Œλ¦Ώ) 생성 -- `/post/{id}` : 룰패 λ©”μ‹œμ§€ 확인 -- `/post/{id}/message` : 룰패 λ©”μ‹œμ§€ μž‘μ„± -- `/post/{id}/edit` : 룰패 λ©”μ‹œμ§€ μˆ˜μ • +- `/search` : 상단넀비 검색 +- `/login` : 둜그인 +- `/signup` : νšŒμ›κ°€μž… +- `/my-profile` : λ‚΄ ν”„λ‘œν•„ (상세) +- `/my-profile/register` : λ‚΄ ν”„λ‘œν•„ (등둝) +- `/notices/[shopId]/[noticeId]` : 곡고 상세 - μ•Œλ°”μƒ +- `/my-shop` : λ‚΄ κ°€κ²Œ (상세) +- `/my-shop/register` : λ‚΄ κ°€κ²Œ (등둝) +- `/employer/shops/[shopId]/notices/[noticeId]` : 곡고 (상세) - 사μž₯λ‹˜ +- `/employer/shops/[shopId]/notices/register` : 곡고 (등둝) - 사μž₯λ‹˜ +- `/employer/shops/[shopId]/notices/[noticeId]/edit` : 곡고 (νŽΈμ§‘) - 사μž₯λ‹˜ - (곡톡 UI) Modal/Toast/Dropdown 등은 `components/ui/`μ—μ„œ 제곡 > 리포지토리에 `workflow.png`λ₯Ό README와 같은 폴더에 두면 `![Workflow](./workflow.png)`둜 λ°”λ‘œ diff --git a/src/assets/images/workflow.png b/src/assets/images/workflow.png new file mode 100644 index 0000000..47cee66 Binary files /dev/null and b/src/assets/images/workflow.png differ diff --git a/src/pages/my-shop/index.tsx b/src/pages/my-shop/index.tsx index 838437e..22ba6a0 100644 --- a/src/pages/my-shop/index.tsx +++ b/src/pages/my-shop/index.tsx @@ -46,9 +46,7 @@ const Myshop = () => { const shopRes = await getShop(shopId); const { description, ...rest } = shopRes.item; setShopData({ ...rest, shopDescription: description }); - setShopNotice([]); - setNextOffset(0); - loadMoreNotice(); + await loadMoreNotice(true); } catch (error) { alert(error); } @@ -56,29 +54,38 @@ const Myshop = () => { get(); }, [user]); - const loadMoreNotice = useCallback(async () => { - if (!user?.shop || nextOffset === null || loading) return; - setLoading(true); - try { - const noticeRes: NoticeResponse = await getNotice(user.shop.item.id, { - offset: nextOffset, - limit: 6, - }); - setShopNotice(prevShopNotice => { - const newItems = noticeRes.items.map(i => i.item); - const merged = [...prevShopNotice, ...newItems]; - const unique = merged.filter( - (item, index, self) => index === self.findIndex(i => i.id === item.id) + const loadMoreNotice = useCallback( + async (isInitial: boolean = false) => { + if (!user?.shop || nextOffset === null || loading) return; + setLoading(true); + try { + const noticeRes: NoticeResponse = await getNotice(user.shop.item.id, { + offset: nextOffset, + limit: 6, + }); + setShopNotice(prevShopNotice => { + const newItems = noticeRes.items.map(i => i.item); + const merged = [...prevShopNotice, ...newItems]; + const unique = merged.filter( + (item, index, self) => index === self.findIndex(i => i.id === item.id) + ); + return unique; + }); + setNextOffset( + noticeRes.hasNext + ? isInitial + ? noticeRes.items.length + : nextOffset + noticeRes.items.length + : null ); - return unique; - }); - setNextOffset(noticeRes.hasNext ? nextOffset + noticeRes.items.length : null); - } catch (error) { - alert(error); - } finally { - setLoading(false); - } - }, [user?.shop, nextOffset, loading]); + } catch (error) { + alert(error); + } finally { + setLoading(false); + } + }, + [user?.shop, nextOffset, loading] + ); useEffect(() => { if (!observerRef.current) return; @@ -145,8 +152,13 @@ const Myshop = () => { shopId: shopData.id, originalHourlyPay: shopData.originalHourlyPay, }; - const href = `/employer/shops/${mergedNotice.shopId}/notices/${item.id}`; - return ; + return ( + + ); })}