Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
03198c0
Merge branch 'develop' of https://github.com/Team-3-2/Wine into develop
huuitae Sep 29, 2025
bb21d05
Merge branch 'develop' of https://github.com/Team-3-2/Wine into develop
huuitae Sep 29, 2025
2cf01a4
Merge branch 'develop' into design/like-button
huuitae Sep 29, 2025
e028383
chore: 서치바 컴포넌트 index에 추가
huuitae Sep 29, 2025
db0b37b
design: 좋아요 버튼 제작중
huuitae Sep 29, 2025
bca2a5c
Merge branch 'develop' of https://github.com/Team-3-2/Wine into develop
huuitae Sep 29, 2025
801fd92
Merge branch 'develop' into design/like-button
huuitae Sep 29, 2025
104a9f8
design: 좋아요 버튼 컴포넌트 제작 완료
huuitae Sep 29, 2025
d1c3001
design: 반응형 수정
huuitae Sep 30, 2025
01b4bd0
Merge branch 'develop' of https://github.com/Team-3-2/Wine into develop
huuitae Sep 30, 2025
9bbfa98
Merge branch 'develop' into design/like-button
huuitae Sep 30, 2025
5730282
refactor: 코드 리뷰 내용 반영
huuitae Oct 1, 2025
7481884
Merge branch 'develop' of https://github.com/Team-3-2/Wine into develop
huuitae Oct 1, 2025
4c88eb3
Merge branch 'develop' into design/like-button
huuitae Oct 1, 2025
976f280
design: 좋아요 개수 표기 수정
huuitae Oct 1, 2025
514fd7a
Merge branch 'develop' of https://github.com/Team-3-2/Wine into develop
huuitae Oct 1, 2025
b873693
Merge branch 'develop' into design/like-button
huuitae Oct 1, 2025
b805ff4
Merge branch 'develop' into design/like-button
huuitae Oct 1, 2025
8f9e3c6
Merge branch 'design/like-button' of https://github.com/Team-3-2/Wine…
huuitae Oct 1, 2025
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
6 changes: 6 additions & 0 deletions src/app/example/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
SelectType,
TextInput,
} from "@/components";
import LikeButton from "@/components/button/like-button";
import Profile from "@/components/profile/profile";
import Searchbar from "@/components/searchbar/searchbar";
import WineImg from "@/components/wine-img/wine-img";
Expand Down Expand Up @@ -115,6 +116,11 @@ const Page = () => {
<Searchbar onChange={handleChange} />
</section>

<section>
<LikeButton count={24} />
<LikeButton count={24} isLike={true} />
</section>

<br />
</div>
);
Expand Down
13 changes: 13 additions & 0 deletions src/components/button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Button from "./basic-button";
import IconButton from "./icon-button";
import ArrowButton from "./arrow-button";
import ICON_MAP from "../icon/icon-map";
import LikeButton from "./like-button";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스토리북 파일에 추가 되었다면, chromatic 라벨을 추가하는게 좋을 것 같아요!


const meta: Meta<typeof Button> = {
title: "Components/Button",
Expand Down Expand Up @@ -131,3 +132,15 @@ export const Variations: Story = {
layout: "fullscreen",
},
};

export const DefaultLike: Story = {
render: () => {
return <LikeButton count={24} />;
},
};

export const Liked: Story = {
render: () => {
return <LikeButton count={24} isLike={true} />;
},
};
48 changes: 48 additions & 0 deletions src/components/button/like-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { cn } from "@/lib/utils";
import Button from "./basic-button";
import { ComponentProps } from "react";

interface LikeButtonProps extends ComponentProps<"button"> {
isLike?: boolean;
count?: number;
}

/**
* 좋아요 버튼 컴포넌트
* @author hwitae
* @param isLike 좋아요 상태 true/false
* @param count 좋아요 개수
* @returns button
*/
const LikeButton = ({ isLike, count, ...props }: LikeButtonProps) => {
return (
<div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

div 래핑은 불필요해서 제거해도 괜찮을듯 합니다!

<Button
icon={isLike ? "LikeOnIcon" : "LikeOffIcon"}
appearance="outline"
aria-label="좋아요버튼"
className={cn(
"cursor-pointer rounded-lg py-1 pl-2 pr-3",
"mobile:h-8 mobile:gap-[2px]",
"tablet:h-8 tablet:gap-[2px]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 mobile:h-8 mobile:gap-[2px], tablet:h-8 tablet:gap-[2px]는 동일한 값이라
base 스타일로 h-8 gap-[2px]만 선언해도 동일하게 동작합니다.
PC 구간만 오버라이드하면 코드가 더 간결해질 것 같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

적용해본 결과 모바일 해상도에서는 원하는 디자인으로 나오지만 태블릿 해상도에서는 디자인 적용이 되지 않습니다.

스크린샷 2025-09-30 09 14 25

"mobile:h-8 mobile:gap-[2px]", 이 부분은 삭제하고 "tablet:h-8 tablet:gap-[2px]", 이 부분은 남겨놓아야할 것 같습니다.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테스트 해봤는데 Button 컴포넌트 내부에 있는 스타일 요소 때문에 제가 말씀드린 방식으로는 적용되지 않는 것 같네요.
이런 경우에는 휘태님께서 작성해주신 코드를 사용하는게 올바른것 같습니다.

원래는 저 방식이 맞는데 왜 안되나 했네요.. 확인 감사합니다!

"pc:h-9 pc:gap-[4px] pc:py-[6px] pc:pl-3 pc:pr-[14px]",
isLike && "border border-red-200"
)}
iconClassName={cn("mobile:ic-sm", "tablet:ic-sm", "pc:ic-md")}
iconColor={isLike ? "danger200" : "default"}
{...props}
>
<span
className={cn(
"text-body-lg font-normal tracking-[-0.02em]",
isLike && "text-lg text-red-200"
)}
>
{count}
</span>
</Button>
</div>
);
};

export default LikeButton;
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ export { default as ArrowButton } from "./button/arrow-button";
export { default as IconButton } from "./button/icon-button";
export { default as StarRating } from "./star-rating/star-rating";
export { default as RatingBreakdown } from "./star-rating/rating-breakdown";
export { default as Searchbar } from "./searchbar/searchbar";