Skip to content

Commit b98f8e5

Browse files
committed
[Modal] Update stories and clean up Modal.Header
1 parent 4666873 commit b98f8e5

File tree

3 files changed

+20
-38
lines changed

3 files changed

+20
-38
lines changed

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
DropZone,
88
Modal,
99
Stack,
10+
Text,
1011
TextContainer,
1112
TextField,
1213
} from '@shopify/polaris';
@@ -42,11 +43,11 @@ export function Default() {
4243
>
4344
<Modal.Section>
4445
<TextContainer>
45-
<p>
46+
<Text variant="bodyMd" as="span">
4647
Use Instagram posts to share your products with millions of
4748
people. Let shoppers buy from your store without leaving
4849
Instagram.
49-
</p>
50+
</Text>
5051
</TextContainer>
5152
</Modal.Section>
5253
</Modal>
@@ -92,11 +93,11 @@ export function WithPrimaryAction() {
9293
<Stack vertical>
9394
<Stack.Item>
9495
<TextContainer>
95-
<p>
96+
<Text variant="bodyMd" as="span">
9697
You can share this discount link with your customers via email
9798
or social media. Your discount will be automatically applied
9899
at checkout.
99-
</p>
100+
</Text>
100101
</TextContainer>
101102
</Stack.Item>
102103
<Stack.Item fill>
@@ -336,11 +337,11 @@ export function WithoutATitle() {
336337
>
337338
<Modal.Section titleHidden>
338339
<TextContainer>
339-
<p>
340+
<Text variant="bodyMd" as="span">
340341
Use Instagram posts to share your products with millions of
341342
people. Let shoppers buy from your store without leaving
342343
Instagram.
343-
</p>
344+
</Text>
344345
</TextContainer>
345346
</Modal.Section>
346347
</Modal>
@@ -372,9 +373,9 @@ export function WithScrollListener() {
372373
{Array.from({length: 50}, (_, index) => (
373374
<Modal.Section key={index}>
374375
<TextContainer>
375-
<p>
376+
<Text variant="bodyMd" as="span">
376377
Item <a href="#Content">#{index}</a>
377-
</p>
378+
</Text>
378379
</TextContainer>
379380
</Modal.Section>
380381
))}
@@ -421,11 +422,11 @@ export function WithActivatorRef() {
421422
>
422423
<Modal.Section>
423424
<TextContainer>
424-
<p>
425+
<Text variant="bodyMd" as="span">
425426
Use Instagram posts to share your products with millions of
426427
people. Let shoppers buy from your store without leaving
427428
Instagram.
428-
</p>
429+
</Text>
429430
</TextContainer>
430431
</Modal.Section>
431432
</Modal>
@@ -468,11 +469,11 @@ export function WithoutAnActivatorProp() {
468469
>
469470
<Modal.Section>
470471
<TextContainer>
471-
<p>
472+
<Text variant="bodyMd" as="span">
472473
Use Instagram posts to share your products with millions of
473474
people. Let shoppers buy from your store without leaving
474475
Instagram.
475-
</p>
476+
</Text>
476477
</TextContainer>
477478
</Modal.Section>
478479
</Modal>

polaris-react/src/components/Modal/components/Header/Header.scss

Lines changed: 0 additions & 15 deletions
This file was deleted.

polaris-react/src/components/Modal/components/Header/Header.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {Columns} from '../../../Columns';
66
import {Inline} from '../../../Inline';
77
import {Text} from '../../../Text';
88

9-
import styles from './Header.scss';
10-
119
export interface HeaderProps {
1210
id: string;
1311
titleHidden: boolean;
@@ -24,11 +22,11 @@ export function Header({
2422
onClose,
2523
}: HeaderProps) {
2624
const titleHiddenMarkup = (
27-
<div className={styles.titleHidden}>
25+
<Box position="absolute" insetInlineEnd="0" zIndex="1">
2826
<Inline align="end">
2927
<CloseButton titleHidden={titleHidden} onClick={onClose} />
3028
</Inline>
31-
</div>
29+
</Box>
3230
);
3331

3432
if (titleHidden || !children) {
@@ -49,13 +47,11 @@ export function Header({
4947
{children}
5048
</Text>
5149
</Inline>
52-
<Inline>
53-
<CloseButton
54-
pressed={closing}
55-
titleHidden={titleHidden}
56-
onClick={onClose}
57-
/>
58-
</Inline>
50+
<CloseButton
51+
pressed={closing}
52+
titleHidden={titleHidden}
53+
onClick={onClose}
54+
/>
5955
</Columns>
6056
</Box>
6157
);

0 commit comments

Comments
 (0)