Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,24 @@

## 👥 팀 & 역할 (RnR)

| 구성원 | 공통 작업 | UI 컴포넌트 | 페이지 |
| <img src="https://avatars.githubusercontent.com/u/59330818" width="150" height="150"/> | <img src="https://avatars.githubusercontent.com/u/213905938" width="150" height="150"/> | <img src="https://avatars.githubusercontent.com/u/214230956" width="150" height="150"/> | <img src="https://avatars.githubusercontent.com/u/214846243" width="150" height="150"/> |
| :------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: |
| 위소현(팀장)<br/>[@sohyun0](https://github.com/sohyun0) | 박신천<br/>[@jeschun](https://github.com/jeschun) | 유인화<br/>[@gummmmmy0v0](https://github.com/gummmmmy0v0) | 양재영<br/>[@BaeZzi813](https://github.com/BaeZzi813) |

<br>

|---|---|---|---|
| 구성원 | 공통 작업 | UI 컴포넌트 | 페이지 |

| 팀원전원 | 디자인 및 기능 QA / 본인 작업관련 문서 | | |

| 박신천 | | 인풋, 모달, 버튼 | 로그인, 회원가입, 내프로필 등록, 상세 |
| 박신천 | 인풋, 모달, 버튼 | 로그인, 회원가입, 내프로필 등록, 상세 |

| 양재영 | 시연영상 준비 | 공통 프레임, 푸터, 토스트, 페이지네이션, 스켈레톤 UI | 가게 정보 등록,
상세 |
| 양재영 | 시연영상 준비 | 공통 프레임, 푸터, 토스트, 페이지네이션 | 가게 정보 등록, 상세 |

| 위소현 | 초기 프로젝트 셋팅 / 공용 문서 작성 및 관리(노션) | 헤더, 필터, 드롭다운, post, 컬러,
폰트, 아이콘 | 공고 리스트, 상세 |
| 위소현 | 발표 | 초기 프로젝트 셋팅 / 공용 문서 작성 및 관리(노션) | 헤더, 필터, 드롭다운, post,
컨테이너, 스켈레톤 UI, 컬러, 폰트, 아이콘 | 공고 리스트, 상세 |

| 유인화 | 발표자료 및 발표 | 테이블, 알림, 캘린더 | 가게 공고 등록, 상세 |
| 유인화 | 발표자료 준비 | 테이블, 알림, 캘린더 | 가게 공고 등록, 상세 |

> 담당 범위는 개발 중 상호 협의로 조정될 수 있음.

Expand Down Expand Up @@ -63,6 +66,12 @@

---

## 🚀 워크플로우 개요

![워크플로우 다이어그램](assets/images/workflow.png)

---

## 🗓️ 진행 일정 (요약)

- **전체 기간**: 2025-09-29 ~ 2025-10-22
Expand Down Expand Up @@ -182,8 +191,6 @@ project-root/
>
> - `components/features/`는 **도메인 단위 UI**(예: `PostForm`, `PostList`) 중심.
> - `pages/`에서는 **라우팅과 데이터 주입**만 담당하도록 분리.
> - `lib/axios/`에 **axios instance**·인터셉터·에러 핸들러 배치.
> - `lib/validators/`는 Zod/Yup 중 택1, 폼과 API 경계에서 활용.
> - `constants/`에 라우트/키/에러 메시지 상수화 → 하드코딩 방지.

---
Expand Down Expand Up @@ -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)`로 바로
Expand Down
Binary file added src/assets/images/workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 39 additions & 27 deletions src/pages/my-shop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,39 +46,46 @@ 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);
}
};
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;
Expand Down Expand Up @@ -145,8 +152,13 @@ const Myshop = () => {
shopId: shopData.id,
originalHourlyPay: shopData.originalHourlyPay,
};
const href = `/employer/shops/${mergedNotice.shopId}/notices/${item.id}`;
return <Post key={item.id} notice={mergedNotice} href={href} />;
return (
<Post
href={`employer/shops/${shopData.id}/notices/${item.id}`}
key={item.id}
notice={mergedNotice}
/>
);
})}
</div>
<div ref={observerRef} className='flex h-12 items-center justify-center'>
Expand Down