@@ -23,6 +23,7 @@ import SearchGroupInput from '@/components/bookGroup/SearchGroup';
2323import SimpleBookGroupCard , {
2424 SimpleBookGroupCardSkeleton ,
2525} from '@/components/bookGroup/SimpleBookGroupCard' ;
26+ import CreateGroupBanner from '@/components/bookGroup/banner/CreateGroupBanner' ;
2627
2728const GroupPage = ( ) => {
2829 const router = useRouter ( ) ;
@@ -53,7 +54,7 @@ const GroupPage = () => {
5354 < div className = "flex w-full flex-col gap-[2rem]" >
5455 < SearchGroupInput onClick = { handleSearchInputClick } />
5556 < SSRSafeSuspense fallback = { < PageSkeleton /> } >
56- { isAuthenticated && < MyBookGroupList /> }
57+ { isAuthenticated && < MyBookGroupSection /> }
5758 < EntireBookGroupList />
5859 </ SSRSafeSuspense >
5960 </ div >
@@ -67,24 +68,33 @@ const GroupPage = () => {
6768
6869export default GroupPage ;
6970
70- const MyBookGroupList = ( ) => {
71+ const MyBookGroupSection = ( ) => {
7172 const isAuthenticated = checkAuthentication ( ) ;
7273 const {
7374 data : { bookGroups } ,
7475 } = useMyGroupsQuery ( { enabled : isAuthenticated } ) ;
7576 const { data : myId } = useMyProfileId ( { enabled : isAuthenticated } ) ;
7677
78+ // 참여한 모임이 없는 경우, 모임 생성 유도 배너 노출
79+ if ( bookGroups . length === 0 ) {
80+ return < CreateGroupBanner /> ;
81+ }
82+
7783 return (
78- < section className = "flex gap-[1rem] overflow-y-hidden overflow-x-scroll pb-[1.5rem]" >
79- { bookGroups . map ( ( { title, book, bookGroupId, owner } ) => (
80- < SimpleBookGroupCard
81- key = { bookGroupId }
82- title = { title }
83- imageSource = { book . imageUrl }
84- isOwner = { owner . id === myId }
85- bookGroupId = { bookGroupId }
86- />
87- ) ) }
84+ < section className = "flex flex-col gap-[1rem]" >
85+ < h2 className = "font-body1-bold" > 내 모임</ h2 >
86+ < ul className = "flex gap-[1rem] overflow-y-hidden overflow-x-scroll pb-[1.5rem]" >
87+ { bookGroups . map ( ( { title, book, bookGroupId, owner } ) => (
88+ < li key = { bookGroupId } >
89+ < SimpleBookGroupCard
90+ title = { title }
91+ imageSource = { book . imageUrl }
92+ isOwner = { owner . id === myId }
93+ bookGroupId = { bookGroupId }
94+ />
95+ </ li >
96+ ) ) }
97+ </ ul >
8898 </ section >
8999 ) ;
90100} ;
@@ -149,6 +159,7 @@ const EntireBookGroupList = () => {
149159 return (
150160 < >
151161 < section className = "flex flex-col gap-[1rem]" >
162+ < h2 className = "font-body1-bold" > 전체 모임</ h2 >
152163 { isSuccess &&
153164 data . pages . map ( ( { bookGroups } ) =>
154165 bookGroups . map (
@@ -171,6 +182,7 @@ const EntireBookGroupList = () => {
171182 bookImageSrc = { book . imageUrl }
172183 date = { { start : startDate , end : endDate } }
173184 owner = { {
185+ id : owner . id ,
174186 name : owner . nickname ,
175187 profileImageSrc : owner . profileUrl ,
176188 } }
0 commit comments