Skip to content

Commit cfa8688

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

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,29 @@ const Components = ({
4343
type,
4444
editPageLinkPath,
4545
}: Props) => {
46-
const statusBanner = status ? <StatusBanner status={status} /> : 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+
);
4756
const propList =
48-
type && status?.value !== 'Deprecated' ? <PropsTable types={type} /> : null;
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} />}
67+
{typedStatus && <StatusBanner status={typedStatus} />}
68+
{componentExamples}
5869
{propList}
5970
<Markdown text={readme.body} />
6071
</Longform>

0 commit comments

Comments
 (0)