Skip to content

Commit 89bf4da

Browse files
authored
Merge pull request #135 from juuhye/feat/IN-238
feat(IN-238): 인플루언서 검색 상세 페이지 헤더(채널 프로필) 북마크, 해시태그 추가
2 parents fec88cc + 10f5ad0 commit 89bf4da

4 files changed

Lines changed: 18 additions & 10 deletions

File tree

src/entities/influencerDetail/mock/mockInfluencerDetail.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import mockChannelBanner from '@/shared/assets/mock/mockBannerImage.png'
66
import mockChannelProfile from '@/shared/assets/mock/mockProfileImage.png'
77

88
export const mockInfluencerDetail: InfluencerDetailResponseDto = {
9-
channelId: 226,
9+
channelId: 1,
1010
channelName: '뷰티크리에이터 민지',
1111
bannerImageUrl: mockChannelBanner.src,
1212
profileImageUrl: mockChannelProfile.src,
1313
channelHandle: '@minji_beauty',
1414
joinedAt: '2020.03.15',
1515
subscriberCount: 285000,
16+
bookmarked: false,
1617
categories: ['반려동물/동물', '자동차'],
1718
audience: {
1819
score: 35.3,

src/entities/influencerDetail/model/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export interface InfluencerDetailResponseDto {
4848
bannerImageUrl: string
4949
joinedAt: string
5050
subscriberCount: number
51+
bookmarked: boolean
5152
categories: string[]
5253
audience: Audience
5354
content: Content

src/features/influencer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export {
1111
addBookmark,
1212
removeBookmark,
1313
} from './api/influencerApi'
14-
export { useInfluencers } from './model/useInfluencers'
14+
export { useInfluencers, useBookmarkToggle } from './model/useInfluencers'
1515
export {
1616
UPLOAD_PERIOD_OPTIONS,
1717
OUTLIER_RANGE_OPTIONS,

src/widgets/influencerDetail/influencerBaseInfo/ui/InfluencerBaseInfo.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
import Image from 'next/image'
33

44
import { useInfluencerDetail } from '@/features/influencerDetail'
5+
import { useBookmarkToggle } from '@/features/influencer'
56
import { mockInfluencerDetail } from '@/entities/influencerDetail'
6-
import { Button, buttonVariants } from '@/shared/ui/button'
7+
import { buttonVariants } from '@/shared/ui/button'
78
import { Skeleton } from '@/shared/ui/shadcn/skeleton'
89
import { format10Thousands } from '@/shared/lib/format'
910
import { cn } from '@/shared/lib/utils'
1011
import RedirectIcon from '@/shared/assets/redirect-bold.svg'
12+
import { HashtagBox } from '@/shared/ui'
13+
import { HeartButton } from '@/shared/ui/heart-button'
1114

1215
export function InfluencerBaseInfo({ channelId }: { channelId: string }) {
1316
const { data: apiData, isFetching, isError } = useInfluencerDetail(channelId)
17+
const toggleBookmark = useBookmarkToggle()
1418

1519
const data = apiData ?? mockInfluencerDetail
1620

@@ -70,15 +74,17 @@ export function InfluencerBaseInfo({ channelId }: { channelId: string }) {
7074
</p>
7175
{/* 채널 카테고리 */}
7276
<div className='mr-12 flex gap-4'>
73-
{/* TODO: 인플루언서 검색 - 해시태그 컴포넌트 사용 예정 */}
74-
{data.categories.map((item) => (
75-
<span key={item}># {item}</span>
77+
{data.categories.map((category) => (
78+
<HashtagBox key={category} label={category} />
7679
))}
7780
</div>
78-
{/* 좋아요 버튼
79-
TODO: 인플루언서 검색 - 좋아요 버튼 컴포넌트 사용 예정
80-
*/}
81-
<Button color='gray' variant='outlined' />
81+
{/* 북마크 버튼 */}
82+
<HeartButton
83+
initialBookmarked={data.bookmarked}
84+
onToggle={(bookmarked) =>
85+
toggleBookmark(Number(channelId), bookmarked)
86+
}
87+
/>
8288
</div>
8389
<div className='flex gap-16 text-noto-label-xs-normal text-text-and-icon-tertiary'>
8490
<span>{data.channelHandle}</span>

0 commit comments

Comments
 (0)