Skip to content

Commit 23849f1

Browse files
committed
feat: bookmarkBtn UI 추가
1 parent 7e410a4 commit 23849f1

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"use client";
2+
import React, { useState } from "react";
3+
import { FaBookmark, FaRegBookmark } from "react-icons/fa";
4+
5+
interface BookmarkBtnProps {
6+
className?: string;
7+
}
8+
9+
const BookmarkBtn: React.FC<BookmarkBtnProps> = ({ className = "" }) => {
10+
const [isBookmarked, setIsBookmarked] = useState(false);
11+
12+
const toggleBookmark = () => {
13+
setIsBookmarked((prev) => !prev);
14+
};
15+
16+
const baseStyles =
17+
"inline-flex items-center justify-center transition-colors rounded-full w-54 h-54 p-4 bg-orange-50";
18+
19+
const iconStyles = "text-xl text-primary-orange-300";
20+
21+
return (
22+
<button className={`${baseStyles} ${className}`} onClick={toggleBookmark}>
23+
{isBookmarked ? <FaBookmark className={iconStyles} /> : <FaRegBookmark className={iconStyles} />}
24+
</button>
25+
);
26+
};
27+
28+
export default BookmarkBtn;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import BookmarkBtn from "@/app/components/button/BookmarkBtn";
2+
import type { Meta, StoryObj } from "@storybook/react";
3+
4+
const meta: Meta<typeof BookmarkBtn> = {
5+
title: "Design System/Components/BookmarkBtn",
6+
component: BookmarkBtn,
7+
parameters: {
8+
layout: "centered",
9+
},
10+
};
11+
12+
export default meta;
13+
type Story = StoryObj<typeof BookmarkBtn>;
14+
15+
export const Bookmarked: Story = {
16+
args: {},
17+
render: (args) => {
18+
return (
19+
<div>
20+
<p className="mb-2 text-sm">click !</p>
21+
<BookmarkBtn {...args} />
22+
</div>
23+
);
24+
},
25+
};

0 commit comments

Comments
 (0)