Skip to content

Commit 15b7276

Browse files
committed
[polaris.shopify.com] Update Components to hide prop list for deprecated components
1 parent 4a6ba4b commit 15b7276

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

polaris.shopify.com/pages/components/[component].tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,34 @@ const Components = ({
4343
type,
4444
editPageLinkPath,
4545
}: Props) => {
46-
const statusBanner = status ? <StatusBanner status={status} /> : null;
47-
const propList =
48-
type && status?.value !== 'Deprecated' ? <PropsTable types={type} /> : null;
46+
const typedStatus: Status | undefined = status
47+
? {
48+
value: status.value.toLowerCase() as Status['value'],
49+
message: status.message,
50+
}
51+
: undefined;
52+
53+
const componentExamples = Boolean(examples.length) && (
54+
<ComponentExamples examples={examples} />
55+
);
56+
const propsTable =
57+
type && status?.value !== 'Deprecated' ? (
58+
<PropsTable componentName={title} types={type} />
59+
) : null;
4960

5061
return (
5162
<Page title={title} editPageLinkPath={editPageLinkPath}>
5263
<PageMeta title={title} description={description} />
5364

5465
<Longform>
5566
<Markdown text={description} />
56-
{statusBanner}
57-
{Boolean(examples.length) && <ComponentExamples examples={examples} />}
58-
{propList}
67+
{typedStatus && <StatusBanner status={typedStatus} />}
68+
{componentExamples}
69+
</Longform>
70+
71+
{propsTable}
72+
73+
<Longform firstParagraphIsLede={false}>
5974
<Markdown text={readme.body} />
6075
</Longform>
6176
</Page>

0 commit comments

Comments
 (0)