Skip to content

Commit b705232

Browse files
committed
move BugBountyBanner and DismissableBanner components and their stories in different folders [Fixes #13044]
1 parent 8fc9bb4 commit b705232

File tree

4 files changed

+59
-4
lines changed

4 files changed

+59
-4
lines changed

src/components/Banners/BugBountyBanner.stories.tsx renamed to src/components/Banners/BugBountyBanner/BugBountyBanner.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from "react"
22
import { Meta, StoryObj } from "@storybook/react"
33

4-
import BugBountyBanner from "../Banners/BugBountyBanner"
5-
import DismissableBanner from "../Banners/DismissableBanner"
4+
import DismissableBanner from "../DismissableBanner"
5+
6+
import BugBountyBanner from "."
67

78
const meta = {
89
component: BugBountyBanner,

src/components/Banners/BugBountyBanner.tsx renamed to src/components/Banners/BugBountyBanner/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from "react"
33
import { Center, Text } from "@chakra-ui/react"
44

55
// Components
6-
import BannerNotification from "../BannerNotification"
6+
import BannerNotification from "../../BannerNotification"
77

88
const BugBountyBanner = () => (
99
<BannerNotification shouldShow>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React from "react"
2+
import { FaInfoCircle } from "react-icons/fa"
3+
import { Button, Center, Icon, Text } from "@chakra-ui/react"
4+
import { Meta, StoryObj } from "@storybook/react"
5+
6+
import DismissableBanner from "."
7+
8+
const meta = {
9+
title: "DismissableBanner",
10+
component: DismissableBanner,
11+
parameters: {
12+
chromatic: { disableSnapshot: false },
13+
},
14+
} satisfies Meta<typeof DismissableBanner>
15+
16+
export default meta
17+
type Story = StoryObj<typeof meta>
18+
19+
export const Basic: Story = {
20+
args: {
21+
storageKey: "dismissable-banner-1",
22+
children: <Center>This is a dismissable banner notification.</Center>,
23+
},
24+
render: (args) => <DismissableBanner {...args} />,
25+
}
26+
27+
export const WithLongText: Story = {
28+
args: {
29+
storageKey: "dismissable-banner-5",
30+
children: (
31+
<Center>
32+
<Text>
33+
This is a dismissable banner with a very long text content to see how
34+
it handles overflow and wrapping. It should be able to manage the text
35+
properly without breaking the layout.
36+
</Text>
37+
</Center>
38+
),
39+
},
40+
render: (args) => <DismissableBanner {...args} />,
41+
}
42+
43+
export const WithIcon: Story = {
44+
args: {
45+
storageKey: "dismissable-banner-6",
46+
children: (
47+
<Center>
48+
<Icon as={FaInfoCircle} mr={2} />
49+
This banner includes an icon.
50+
</Center>
51+
),
52+
},
53+
render: (args) => <DismissableBanner {...args} />,
54+
}

src/components/Banners/DismissableBanner.tsx renamed to src/components/Banners/DismissableBanner/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"
33
import { Center, CloseButton } from "@chakra-ui/react"
44

55
// Components
6-
import BannerNotification from "../BannerNotification"
6+
import BannerNotification from "../../BannerNotification"
77

88
// Interface
99
export type DismissableBannerProps = {

0 commit comments

Comments
 (0)