-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: addiiton Image Component in Storybook
- Loading branch information
1 parent
7c58d04
commit 9a888e8
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
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,15 @@ | ||
import React from 'react' | ||
|
||
import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
|
||
import { Image, ImageProps } from './Image' | ||
|
||
export default { | ||
title: 'atoms/Image', | ||
component: Image | ||
} as ComponentMeta<React.ComponentType<ImageProps>> | ||
|
||
const Template: ComponentStory<React.ComponentType<ImageProps>> = args => <Image {...args} /> | ||
|
||
export const Primary = Template.bind({}) | ||
Primary.args = {} |
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,14 @@ | ||
import React from 'react' | ||
|
||
export type ImageProps = { | ||
src?: string | ||
width?: string | number | ||
height?: string | number | ||
className?: string | ||
alt?: string | ||
onClick?: () => void | ||
} | ||
|
||
export const Image = ({ src, className, alt, height, width, onClick }: ImageProps) => { | ||
return <img className={className} onClick={onClick} alt={alt} src={src} width={width} height={height} /> | ||
} |
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 @@ | ||
export * from './Image' |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { LoginButton } from './atoms/LoginButton' | ||
import { Image } from './atoms/Image' | ||
|
||
export default { LoginButton } | ||
export default { LoginButton, Image } |