Skip to content

Commit bd39ea7

Browse files
authored
Polish README.md files before migration (#6772)
* Polish README.md files before migration * Update links
1 parent e54fb99 commit bd39ea7

File tree

6 files changed

+53
-16
lines changed

6 files changed

+53
-16
lines changed

polaris-react/src/components/Combobox/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,14 @@ function MultiselectTagComboboxExample() {
558558
if (!value || matchIndex === -1) return option;
559559

560560
const start = option.slice(0, matchIndex);
561-
const highlight = option.slice(matchIndex, matchIndex + trimValue.length);
562-
const end = option.slice(matchIndex + trimValue.length, option.length);
561+
const highlight = option.slice(
562+
matchIndex,
563+
`${matchIndex}${trimValue.length}`,
564+
);
565+
const end = option.slice(
566+
`${matchIndex}${trimValue.length}`,
567+
option.length,
568+
);
563569

564570
return (
565571
<p>

polaris-react/src/components/DropZone/README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ function DropZoneExample() {
104104
alt={file.name}
105105
source={
106106
validImageTypes.includes(file.type)
107-
? window.URL.createObjectURL(file)
107+
? // eslint-disable-next-line node/no-unsupported-features/node-builtins
108+
window.URL.createObjectURL(file)
108109
: NoteMinor
109110
}
110111
/>
@@ -162,6 +163,7 @@ function DropZoneWithImageFileUpload() {
162163
<Thumbnail
163164
size="small"
164165
alt={file.name}
166+
// eslint-disable-next-line node/no-unsupported-features/node-builtins
165167
source={window.URL.createObjectURL(file)}
166168
/>
167169
<div>
@@ -223,7 +225,8 @@ function DropZoneExample() {
223225
alt={file.name}
224226
source={
225227
validImageTypes.includes(file.type)
226-
? window.URL.createObjectURL(file)
228+
? // eslint-disable-next-line node/no-unsupported-features/node-builtins
229+
window.URL.createObjectURL(file)
227230
: NoteMinor
228231
}
229232
/>
@@ -267,7 +270,8 @@ function DropZoneWithDropOnPageExample() {
267270
alt={file.name}
268271
source={
269272
validImageTypes.includes(file.type)
270-
? window.URL.createObjectURL(file)
273+
? // eslint-disable-next-line node/no-unsupported-features/node-builtins
274+
window.URL.createObjectURL(file)
271275
: NoteMinor
272276
}
273277
/>
@@ -329,6 +333,7 @@ function DropZoneAcceptingSVGFilesExample() {
329333
<Thumbnail
330334
size="small"
331335
alt={file.name}
336+
// eslint-disable-next-line node/no-unsupported-features/node-builtins
332337
source={window.URL.createObjectURL(file)}
333338
/>
334339
<div>
@@ -396,7 +401,8 @@ function NestedDropZoneExample() {
396401
alt={file.name}
397402
source={
398403
validImageTypes.includes(file.type)
399-
? window.URL.createObjectURL(file)
404+
? // eslint-disable-next-line node/no-unsupported-features/node-builtins
405+
window.URL.createObjectURL(file)
400406
: NoteMinor
401407
}
402408
/>
@@ -474,7 +480,8 @@ function DropZoneExample() {
474480
alt={file.name}
475481
source={
476482
validImageTypes.includes(file.type)
477-
? window.URL.createObjectURL(file)
483+
? // eslint-disable-next-line node/no-unsupported-features/node-builtins
484+
window.URL.createObjectURL(file)
478485
: NoteMinor
479486
}
480487
/>
@@ -525,7 +532,8 @@ function DropZoneWithCustomFileDialogExample() {
525532
alt={file.name}
526533
source={
527534
validImageTypes.indexOf(file.type) > -1
528-
? window.URL.createObjectURL(file)
535+
? // eslint-disable-next-line node/no-unsupported-features/node-builtins
536+
window.URL.createObjectURL(file)
529537
: NoteMinor
530538
}
531539
/>

polaris-react/src/components/Frame/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,16 @@ function FrameExample() {
226226
const loadingMarkup = isLoading ? <Loading /> : null;
227227

228228
const skipToContentTarget = (
229-
<a id="SkipToContentTarget" ref={skipToContentRef} tabIndex={-1} />
229+
<VisuallyHidden>
230+
<a
231+
id="SkipToContentTarget"
232+
ref={skipToContentRef}
233+
tabIndex={-1}
234+
href="#SkipLink"
235+
>
236+
Account details
237+
</a>
238+
</VisuallyHidden>
230239
);
231240

232241
const actualPageMarkup = (
@@ -562,7 +571,16 @@ function FrameExample() {
562571
const loadingMarkup = isLoading ? <Loading /> : null;
563572

564573
const skipToContentTarget = (
565-
<a id="SkipToContentTarget" ref={skipToContentRef} tabIndex={-1} />
574+
<VisuallyHidden>
575+
<a
576+
id="SkipToContentTarget"
577+
ref={skipToContentRef}
578+
tabIndex={-1}
579+
href="#SkipLink"
580+
>
581+
Account details
582+
</a>
583+
</VisuallyHidden>
566584
);
567585

568586
const actualPageMarkup = (

polaris-react/src/components/Modal/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,10 @@ function ModalWithScrollListenerExample() {
591591

592592
const handleChange = useCallback(() => setActive(!active), [active]);
593593

594-
const handleScrollBottom = useCallback(() => alert('Scrolled to bottom'), []);
594+
const handleScrollBottom = useCallback(
595+
() => console.log('Scrolled to bottom'),
596+
[],
597+
);
595598

596599
const activator = <Button onClick={handleChange}>Open</Button>;
597600

polaris-react/src/components/Page/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ Use for detail pages, which should have pagination and breadcrumbs, and also oft
133133
{
134134
content: 'Duplicate',
135135
accessibilityLabel: 'Secondary action label',
136-
onAction: () => alert('Duplicate action'),
136+
onAction: () => console.log('Duplicate action'),
137137
},
138138
{
139139
content: 'View on your store',
140-
onAction: () => alert('View on your store action'),
140+
onAction: () => console.log('View on your store action'),
141141
},
142142
]}
143143
actionGroups={[
@@ -148,7 +148,7 @@ Use for detail pages, which should have pagination and breadcrumbs, and also oft
148148
{
149149
content: 'Share on Facebook',
150150
accessibilityLabel: 'Individual action label',
151-
onAction: () => alert('Share on Facebook action'),
151+
onAction: () => console.log('Share on Facebook action'),
152152
},
153153
],
154154
},
@@ -362,7 +362,7 @@ Use action groups for sets of actions that relate to one another, particularly w
362362
{
363363
title: 'Copy',
364364
onClick: (openActions) => {
365-
alert('Copy action');
365+
console.log('Copy action');
366366
openActions();
367367
},
368368
actions: [{content: 'Copy to clipboard'}],

polaris-react/src/components/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ Create an element using the Polaris React `AppProvider` component. The `AppProvi
7878
```js
7979
const app = (
8080
<AppProvider i18n={enTranslations}>
81-
<Button onClick={() => alert('Button clicked!')}>Example button</Button>
81+
<Button onClick={() => console.log('Button clicked!')}>
82+
Example button
83+
</Button>
8284
</AppProvider>
8385
);
8486
```

0 commit comments

Comments
 (0)