Skip to content

Commit

Permalink
[#43] feat: Add atoms-Title.stories
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunnnn98 committed Apr 23, 2023
1 parent 595b456 commit 86341b2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/atoms/title/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HTMLAttributes } from 'react';
import classnames from 'classnames';

type TitleProps = HTMLAttributes<HTMLHeadingElement> & {
export type TitleProps = HTMLAttributes<HTMLHeadingElement> & {
headingLevel: 'h1' | 'h2' | 'h3';
emoji?: string;
};
Expand Down
17 changes: 17 additions & 0 deletions src/components/atoms/title/atoms-Title.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Title } from './Title';

import type { TitleProps } from './Title';
import type { Story } from '@ladle/react';

export const h1: Story<TitleProps> = () => <Title headingLevel="h1">h1 : text-5xl</Title>;
export const h2: Story<TitleProps> = () => <Title headingLevel="h2">h2 : text-4xl</Title>;
export const h3: Story<TitleProps> = () => <Title headingLevel="h3">h2 : text-3xl</Title>;
export const EmojiWithTitle: Story<TitleProps> = ({ emoji }) => (
<Title headingLevel="h3" emoji={emoji}>
h2 : text-3xl
</Title>
);

EmojiWithTitle.args = {
emoji: '😎',
};
2 changes: 1 addition & 1 deletion src/components/atoms/title/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Title } from './Title';
export * from './Title';

0 comments on commit 86341b2

Please sign in to comment.