-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit 617614f.
- Loading branch information
Showing
23 changed files
with
268 additions
and
318 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,19 @@ | ||
'use client'; | ||
|
||
import TopNavigation from '@/ui/Base/TopNavigation'; | ||
import BookGroupInfo from '@/v1/bookGroup/detail/BookGroupInfo'; | ||
import { IconArrowLeft, IconHamburger, IconPost } from '@public/icons'; | ||
import { Flex } from '@chakra-ui/react'; | ||
|
||
import { useBookGroupTitle } from '@/queries/group/useBookGroupQuery'; | ||
import CommentList from '@/v1/bookGroup/detail/CommentList'; | ||
import GroupDetail from '@/ui/Group/GroupDetail'; | ||
|
||
const DetailBookGroupPage = ({ | ||
const GroupDetailPage = ({ | ||
params: { groupId }, | ||
}: { | ||
params: { groupId: number }; | ||
}) => { | ||
return ( | ||
<> | ||
<BookGroupNavigation groupId={groupId} /> | ||
<div className="flex flex-col gap-[2rem]"> | ||
<BookGroupInfo groupId={groupId} /> | ||
<div className="flex flex-col gap-[1rem]"> | ||
<Heading text="게시글" /> | ||
<CommentList groupId={groupId} /> | ||
</div> | ||
</div> | ||
</> | ||
<Flex direction="column" justify="center"> | ||
<GroupDetail bookGroupId={Number(groupId)} /> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default DetailBookGroupPage; | ||
|
||
const BookGroupNavigation = ({ groupId }: { groupId: number }) => { | ||
const { data: title } = useBookGroupTitle(groupId); | ||
|
||
return ( | ||
<TopNavigation> | ||
<TopNavigation.LeftItem> | ||
<IconArrowLeft /> | ||
</TopNavigation.LeftItem> | ||
<TopNavigation.CenterItem textAlign="left"> | ||
{title} | ||
</TopNavigation.CenterItem> | ||
<TopNavigation.RightItem> | ||
<IconPost /> | ||
<IconHamburger /> | ||
</TopNavigation.RightItem> | ||
</TopNavigation> | ||
); | ||
}; | ||
|
||
const Heading = ({ text }: { text: string }) => ( | ||
<p className=" text-xl font-bold">{text}</p> | ||
); | ||
export default GroupDetailPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import GroupAPI from '@/apis/group'; | ||
import { APIGroupDetail } from '@/types/group'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
const useGroupCommentsQuery = ({ | ||
bookGroupId, | ||
}: { | ||
bookGroupId: APIGroupDetail['bookGroupId']; | ||
}) => | ||
useQuery(['group', bookGroupId, 'comments'], () => | ||
GroupAPI.getGroupComments({ bookGroupId }).then(({ data }) => data) | ||
); | ||
|
||
export default useGroupCommentsQuery; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import BookGroupInfo from '@/v1/bookGroup/detail/BookGroupInfo'; | ||
|
||
const meta: Meta<typeof BookGroupInfo> = { | ||
title: 'bookgroup/detail/BookGroupInfo', | ||
component: BookGroupInfo, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof BookGroupInfo>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: '프롱이 리팩터링 스터디', | ||
description: | ||
'제 1차 프롱이 기수연합 독서 스터디 입니다. 마틴 파울러의 저서 ‘리팩터링 2판’과 함께 진행합니다.', | ||
book: { | ||
title: '리팩터링 2판', | ||
author: '마틴 파울러', | ||
bookImageSrc: 'https://image.yes24.com/goods/89649360/XL', | ||
}, | ||
date: { | ||
start: '2023-10-31', | ||
end: '2023-11-27', | ||
}, | ||
memberCount: { | ||
current: 3, | ||
max: 20, | ||
}, | ||
owner: { | ||
isMe: true, | ||
name: '소피아', | ||
profileImageSrc: '/icons/logo.svg', | ||
}, | ||
isPublic: false, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import CommentList from '@/v1/bookGroup/detail/CommentList'; | ||
|
||
const meta: Meta<typeof CommentList> = { | ||
title: 'bookgroup/detail/CommentList', | ||
component: CommentList, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof CommentList>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
comments: [ | ||
{ | ||
id: 1, | ||
writer: { id: 10, name: '소피아', profileImageSrc: '/icons/logo.svg' }, | ||
createdAt: '2023.10.22', | ||
content: '프론트엔드 개발자라면 꼭 읽어봐야 할 책이라고 생각해요.', | ||
}, | ||
{ | ||
id: 2, | ||
writer: { id: 21, name: '다독이', profileImageSrc: '' }, | ||
createdAt: '2023.10.18', | ||
content: '이 책 덕분에 프로젝트 리팩터링에 도전할 수 있었어요.', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import { UseQueryOptions } from '@tanstack/react-query'; | ||
|
||
export type QueryOptions< | ||
TQueryFnData, | ||
TQueryData = TQueryFnData | ||
> = UseQueryOptions<Awaited<TQueryFnData>, unknown, TQueryData, string[]>; | ||
export type QueryOptions<T> = UseQueryOptions<Awaited<T>, unknown, T, string[]>; |
Oops, something went wrong.