Skip to content

Commit f41a765

Browse files
committed
[Banner] Wrap children in Box
1 parent 79fad1c commit f41a765

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

polaris-react/src/components/Banner/Banner.stories.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,17 @@ export function All() {
265265
Custom icon
266266
</Text>
267267
<AllBanners icon={DiscountsMajor} onDismiss={() => {}} />
268+
<Text as="h2" variant="headingMd">
269+
With links
270+
</Text>
271+
<AllBanners
272+
onDismiss={() => {}}
273+
children={
274+
<>
275+
Text with <Link url="">monochrome link</Link>.
276+
</>
277+
}
278+
/>
268279
<Text as="h2" variant="headingMd">
269280
In card
270281
</Text>
@@ -295,6 +306,19 @@ export function All() {
295306
<LegacyCard sectioned>
296307
<AllBanners icon={DiscountsMinor} onDismiss={() => {}} />
297308
</LegacyCard>
309+
<Text as="h2" variant="headingMd">
310+
In card with links
311+
</Text>
312+
<LegacyCard sectioned>
313+
<AllBanners
314+
onDismiss={() => {}}
315+
children={
316+
<>
317+
Text with <Link url="">monochrome link</Link>.
318+
</>
319+
}
320+
/>
321+
</LegacyCard>
298322
</VerticalStack>
299323
);
300324
}

polaris-react/src/components/Banner/components/BannerExperimental/BannerExperimental.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function BannerExperimental({
9090
<VerticalStack gap="2">
9191
<VerticalStack gap="05">
9292
{bannerTitle}
93-
{children}
93+
<Box>{children}</Box>
9494
</VerticalStack>
9595
{actionButtons}
9696
</VerticalStack>
@@ -128,7 +128,7 @@ export function BannerExperimental({
128128
{hasContent && (
129129
<Box padding={{xs: '3', sm: '4'}} paddingBlockStart="3">
130130
<VerticalStack gap="2">
131-
{children}
131+
<Box>{children}</Box>
132132
{actionButtons}
133133
</VerticalStack>
134134
</Box>

0 commit comments

Comments
 (0)