-
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.
๐
style: bookingButton ์ปดํฌ๋ํธ ๊ตฌํ ๋ฐ ์คํ ๋ฆฌ๋ถ ์ถ๊ฐ #15
- Loading branch information
1 parent
51fffac
commit fc214f8
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
src/components/core/Button/BookingButton/BookingButton.stories.tsx
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,58 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import BookingButton from "./BookingButton"; | ||
|
||
const meta: Meta<typeof BookingButton> = { | ||
title: "Core/Button/BookingButton", | ||
component: BookingButton, | ||
parameters: { | ||
layout: "centered", | ||
}, | ||
|
||
argTypes: { | ||
label: { | ||
control: { | ||
type: "text", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const BookingUnavailable: Story = { | ||
args: { | ||
scrabCount: 210, | ||
disabled: true, | ||
}, | ||
decorators: [ | ||
(Story: React.ComponentType) => ( | ||
<div style={{ width: "400px" }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; | ||
|
||
export const BookingAvailable: Story = { | ||
args: { scrabCount: 210, disabled: false }, | ||
decorators: [ | ||
(Story: React.ComponentType) => ( | ||
<div style={{ width: "400px" }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; | ||
|
||
export const isScrabed: Story = { | ||
args: { scrabCount: 210, disabled: false, isScrabed: true }, | ||
decorators: [ | ||
(Story: React.ComponentType) => ( | ||
<div style={{ width: "400px" }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; |
48 changes: 48 additions & 0 deletions
48
src/components/core/Button/BookingButton/BookingButton.tsx
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,48 @@ | ||
import { FC } from "react"; | ||
|
||
import { ScrapIcon } from "@/components/icons"; | ||
import { cn } from "@/utils/cn"; | ||
|
||
import BasicButton from "../BasicButton/BasicButton"; | ||
|
||
interface Props { | ||
label?: string; | ||
className?: string; | ||
isScrabed?: boolean; | ||
scrabCount?: number; | ||
disabled?: boolean; | ||
} | ||
|
||
const BookingButton: FC<Props> = ({ | ||
className, | ||
label = "์๋งคํ๊ธฐ", | ||
isScrabed = false, | ||
scrabCount = 0, | ||
disabled = true, | ||
}) => { | ||
return ( | ||
<div | ||
className={cn( | ||
"w-full h-[98px] p-[24px]", | ||
"flex justify-between items-center gap-[11px]", | ||
"border-[1px] border-gray-scale-100", | ||
"bg-gray-scale-0", | ||
className, | ||
)} | ||
> | ||
<BasicButton type="button" label={label} disabled={disabled} /> | ||
<button className="flex flex-col items-center"> | ||
<ScrapIcon | ||
width={30} | ||
height={30} | ||
className={isScrabed ? "text-gray-scale-700" : "text-gray-scale-200"} | ||
/> | ||
<span className="h-auto w-auto text-caption1-medium text-gray-700"> | ||
{scrabCount} | ||
</span> | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BookingButton; |