Skip to content

Commit

Permalink
[#363] BottomActionButton 컴포넌트 (#395)
Browse files Browse the repository at this point in the history
* feat: BottomActionButton 컴포넌트 작성

* feat: BottomActionButton 컴포넌트 스토리 작성

* refactor: 만들어진 Button을 사용하도록 수정

* style: Button이 Stretch 되도록 size prop 전달
  • Loading branch information
minjongbaek authored Sep 17, 2023
1 parent b8c9d77 commit 2648684
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/stories/Base/BottomActionButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import BottomActionButton from '@/ui/Base/BottomActionButton';
import { Meta, StoryObj } from '@storybook/react';

const meta: Meta<typeof BottomActionButton> = {
title: 'Base/BottomActionButton',
component: BottomActionButton,
tags: ['autodocs'],
parameters: {
docs: {
story: {
inline: false,
},
},
},
};

export default meta;

type Story = StoryObj<typeof BottomActionButton>;

export const Default: Story = {
args: {},
render: () => (
<BottomActionButton onClick={() => alert('click!')}>
다음
</BottomActionButton>
),
};
22 changes: 22 additions & 0 deletions src/ui/Base/BottomActionButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentPropsWithoutRef } from 'react';
import Button from './Button';

type BottomActionButtonProps = Omit<
ComponentPropsWithoutRef<'button'>,
'className'
>;

const BottomActionButton = ({
children,
...props
}: BottomActionButtonProps) => {
return (
<div className="fixed bottom-0 left-0 z-10 w-full bg-white px-[2.0rem] py-[1.5rem]">
<Button size="full" {...props}>
{children}
</Button>
</div>
);
};

export default BottomActionButton;

0 comments on commit 2648684

Please sign in to comment.