-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f89384b
commit dc4f903
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
frontend/src/components/common/TextEditor/TextEditor.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,54 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { useState } from 'react'; | ||
import TextEditor from '.'; | ||
|
||
const meta = { | ||
title: 'Common/Input/TextEditor', | ||
component: TextEditor, | ||
parameters: { | ||
layout: 'centered', | ||
docs: { | ||
description: { | ||
component: 'ReactQuill 에디터를 wrapping한 TextEditor 컴포넌트입니다.', | ||
}, | ||
}, | ||
}, | ||
|
||
tags: ['autodocs'], | ||
|
||
argTypes: { | ||
width: { control: 'text' }, | ||
height: { control: 'text' }, | ||
placeholder: { control: 'text' }, | ||
value: { control: false }, | ||
onChange: { control: false }, | ||
onBlur: { action: 'blurred', control: false }, | ||
}, | ||
|
||
decorators: [ | ||
(Story) => { | ||
const [value, setValue] = useState(''); | ||
const handleChange = (content: string) => setValue(content); | ||
|
||
return ( | ||
<div style={{ width: '60rem', height: '40rem' }}> | ||
<Story | ||
value={value} | ||
onChange={handleChange} | ||
/> | ||
</div> | ||
); | ||
}, | ||
], | ||
} satisfies Meta<typeof TextEditor>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
value: '', | ||
placeholder: '내용을 입력하세요...', | ||
onChange: () => {}, | ||
}, | ||
}; |