Merged in fix/storybook-static-folder (pull request #2718)
Storybook Avatar: Use images from public folder * make sure we import files from the correct folder Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
@@ -20,10 +20,10 @@ const meta: Meta<typeof Avatar> = {
|
|||||||
export default meta
|
export default meta
|
||||||
|
|
||||||
type Story = StoryObj<typeof Avatar>
|
type Story = StoryObj<typeof Avatar>
|
||||||
|
const imageFile = './img/profile-picture.png' as const
|
||||||
export const WithImage: Story = {
|
export const WithImage: Story = {
|
||||||
args: {
|
args: {
|
||||||
src: `../../../public/img/profile-picture.png`,
|
src: imageFile,
|
||||||
alt: 'Profile photo',
|
alt: 'Profile photo',
|
||||||
size: 'md',
|
size: 'md',
|
||||||
},
|
},
|
||||||
@@ -45,11 +45,7 @@ export const Fallback: Story = {
|
|||||||
export const SmallSize: Story = {
|
export const SmallSize: Story = {
|
||||||
render: () => (
|
render: () => (
|
||||||
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
|
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
|
||||||
<Avatar
|
<Avatar src={imageFile} alt="Profile photo" size="sm" />
|
||||||
src={`../../../public/img/profile-picture.png`}
|
|
||||||
alt="Profile photo"
|
|
||||||
size="sm"
|
|
||||||
/>
|
|
||||||
<Avatar initials="FR" size="sm" />
|
<Avatar initials="FR" size="sm" />
|
||||||
<Avatar size="sm" />
|
<Avatar size="sm" />
|
||||||
</div>
|
</div>
|
||||||
@@ -59,11 +55,7 @@ export const SmallSize: Story = {
|
|||||||
export const MediumSize: Story = {
|
export const MediumSize: Story = {
|
||||||
render: () => (
|
render: () => (
|
||||||
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
|
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
|
||||||
<Avatar
|
<Avatar src={imageFile} alt="Profile photo" size="md" />
|
||||||
src={`../../../public/img/profile-picture.png`}
|
|
||||||
alt="Profile photo"
|
|
||||||
size="md"
|
|
||||||
/>
|
|
||||||
<Avatar initials="FR" size="md" />
|
<Avatar initials="FR" size="md" />
|
||||||
<Avatar size="md" />
|
<Avatar size="md" />
|
||||||
</div>
|
</div>
|
||||||
@@ -73,11 +65,7 @@ export const MediumSize: Story = {
|
|||||||
export const LargeSize: Story = {
|
export const LargeSize: Story = {
|
||||||
render: () => (
|
render: () => (
|
||||||
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
|
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
|
||||||
<Avatar
|
<Avatar src={imageFile} alt="Profile photo" size="lg" />
|
||||||
src={`../../../public/img/profile-picture.png`}
|
|
||||||
alt="Profile photo"
|
|
||||||
size="lg"
|
|
||||||
/>
|
|
||||||
<Avatar initials="FR" size="lg" />
|
<Avatar initials="FR" size="lg" />
|
||||||
<Avatar size="lg" />
|
<Avatar size="lg" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user