Skip to content

Commit 597b78b

Browse files
authored
remove draft pattern from patterns index page (#8473)
<!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Draft pages should not be visible on the `Pattern Page`. This PR resolves this. ### WHAT is this pull request doing? Before: ![Screenshot 2023-02-23 at 2 02 54 pm](https://user-images.githubusercontent.com/12119389/220812495-87916a64-7f79-4c92-9748-14b6f60bd4e3.png) After: ![Screenshot 2023-02-23 at 2 02 45 pm](https://user-images.githubusercontent.com/12119389/220812511-33714fd7-00b3-463a-a97c-73a7e2905dd0.png) ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) <!-- Give as much information as needed to experiment with the component in the playground. --> <details> <summary>Copy-paste this code in <code>playground/Playground.tsx</code>:</summary> ```jsx import React from 'react'; import {Page} from '../src'; export function Playground() { return ( <Page title="Playground"> {/* Add the code you want to test in here */} </Page> ); } ``` </details> ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 9ab9313 commit 597b78b

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

.changeset/seven-boxes-punch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'polaris.shopify.com': patch
3+
---
4+
5+
Remove draft pattern pages from PatternsPage

polaris.shopify.com/src/components/PatternsPage/index.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,20 @@ export const PatternsPage = () => (
3131
/>
3232
</div>
3333
<Grid>
34-
{Object.values(patterns).map(({frontMatter: pattern}, index) => (
35-
<GridItem
36-
key={index}
37-
title={pattern.title}
38-
description={pattern.description ?? ''}
39-
url={pattern.url ?? ''}
40-
renderPreview={() => (
41-
<Preview alt={pattern.title} src={pattern.previewImg} />
42-
)}
43-
status={pattern.status as Status}
44-
/>
45-
))}
34+
{Object.values(patterns)
35+
.filter(({frontMatter: {draft}}) => !draft)
36+
.map(({frontMatter: pattern}, index) => (
37+
<GridItem
38+
key={index}
39+
title={pattern.title}
40+
description={pattern.description ?? ''}
41+
url={pattern.url ?? ''}
42+
renderPreview={() => (
43+
<Preview alt={pattern.title} src={pattern.previewImg} />
44+
)}
45+
status={pattern.status as Status}
46+
/>
47+
))}
4648
</Grid>
4749
</Stack>
4850
</Page>

0 commit comments

Comments
 (0)