Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions src/components/common/standardButton/StandardButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Meta, StoryObj } from '@storybook/react'
import StandardButton from './StandardButton'

const meta: Meta<typeof StandardButton> = {
component: StandardButton,
tags: ['autodocs'],
title: 'components/StandardButton',
argTypes: {
label: {
control: 'text'
},
state: {
control: 'select',
options: ['disabled', 'enabled']
},
style: {
control: 'select',
options: ['outlined', 'filled']
}
}
}
export default meta
type Story = StoryObj<typeof StandardButton>

export const Default: Story = {
render: (args) => (
<StandardButton label={args.label} state={args.state} style={args.style} />
)
}
25 changes: 25 additions & 0 deletions src/components/common/standardButton/StandardButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
interface StandardButtonProps {
label: string
state: 'disabled' | 'enabled'
style: 'outlined' | 'filled'
}
const StandardButton = ({ label, state, style }: StandardButtonProps) => {
return (
<div
className={`rounded-[8px] cursor-pointer flex justify-center items-center font-medium border border-1 w-full h-full px-[0px] py-[10px] ${
state === 'enabled'
? // enabled
style === 'filled'
? 'bg-green-50 text-white-0 border-green-50'
: 'bg-transparent text-green-50 border-green-50'
: // disabled
style === 'filled'
? 'bg-gray-10 text-gray-50 border-gray-50'
: 'bg-transparent text-gray-40 border-gray-40'
}`}>
{label}
</div>
)
}

export default StandardButton