Skip to content

Commit 5381e04

Browse files
kodster28KianNH
andauthored
[Chore] Remove unused or inaccurate components (#24252)
* [Chore] Remove 2 unused components * Remove productsbytag * Remove plan info * Remove one-off pages components from component listing * update title * Update logic in ResourceBySelector a bit + replace TroubleshootingList * update to hide descriptions for now * Format' * remove default * remove more * Update src/components/ResourcesBySelector.tsx Co-authored-by: Kian <[email protected]> * prettier --------- Co-authored-by: Kian <[email protected]>
1 parent 8183445 commit 5381e04

File tree

27 files changed

+52
-950
lines changed

27 files changed

+52
-950
lines changed

src/components/NetworkMap.astro

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

src/components/PlanInfo.astro

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

src/components/ProductsByTag.astro

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

src/components/ResourcesBySelector.astro

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ const props = z.object({
1717
directory: z.string().optional(),
1818
filterables: z.custom<ResourcesData>().array().optional(),
1919
columns: z.union([z.literal(2), z.literal(3)]).default(2),
20+
showDescriptions: z.boolean().default(true),
2021
});
2122
22-
const { tags, types, products, directory, filterables, columns } = props.parse(
23-
Astro.props,
24-
);
23+
const {
24+
tags,
25+
types,
26+
products,
27+
directory,
28+
filterables,
29+
columns,
30+
showDescriptions,
31+
} = props.parse(Astro.props);
2532
2633
const docs = await getCollection("docs");
2734
const videos = await getCollection("stream");
@@ -70,6 +77,7 @@ const facets = resources.reduce(
7077
facets={facets}
7178
filters={filterables}
7279
columns={columns}
80+
showDescriptions={showDescriptions}
7381
client:load
7482
/>
7583
</div>

src/components/ResourcesBySelector.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ interface Props {
1212
facets: Record<string, string[]>;
1313
filters?: ResourcesData[];
1414
columns: number;
15+
showDescriptions: boolean;
1516
}
1617

1718
export default function ResourcesBySelector({
1819
resources,
1920
facets,
2021
filters,
2122
columns,
23+
showDescriptions,
2224
}: Props) {
2325
const [selectedFilter, setSelectedFilter] = useState<string | null>(null);
2426

@@ -89,18 +91,31 @@ export default function ResourcesBySelector({
8991
? `/videos/${page.data.url}/`
9092
: `/${page.id}/`;
9193

94+
let title;
95+
96+
if (page.collection === "docs") {
97+
const titleItem = page.data.head.find(
98+
(item) => item.tag === "title",
99+
);
100+
title = titleItem ? titleItem.content : page.data.title;
101+
} else {
102+
title = page.data.title;
103+
}
104+
92105
return (
93106
<a
94107
key={page.id}
95108
href={href}
96109
className="flex flex-col gap-2 rounded-sm border border-solid border-gray-200 p-6 text-black no-underline hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-800"
97110
>
98111
<p className="decoration-accent underline decoration-2 underline-offset-4">
99-
{page.data.title}
112+
{title}
100113
</p>
101-
<span className="line-clamp-3" title={page.data.description}>
102-
{page.data.description}
103-
</span>
114+
{showDescriptions && (
115+
<span className="line-clamp-3" title={page.data.description}>
116+
{page.data.description}
117+
</span>
118+
)}
104119
</a>
105120
);
106121
})}

src/components/TroubleshootingList.astro

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

src/components/WorkerStarter.astro

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

src/components/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export { default as ListExamples } from "./ListExamples.astro";
3333
export { default as ListTutorials } from "./ListTutorials.astro";
3434
export { default as Markdown } from "./Markdown.astro";
3535
export { default as MetaInfo } from "./MetaInfo.astro";
36-
export { default as NetworkMap } from "./NetworkMap.astro";
3736
export { default as PackageManagers } from "./PackageManagers.astro";
3837
export { default as PagesBuildEnvironment } from "./PagesBuildEnvironment.astro";
3938
export { default as PagesBuildEnvironmentLanguages } from "./PagesBuildEnvironmentLanguages.astro";
@@ -43,11 +42,9 @@ export { default as PagesBuildPresetsTable } from "./PagesBuildPresetsTable.astr
4342
export { default as PagesLanguageSupport } from "./PagesLanguageSupport.astro";
4443
export { default as PartialsUsage } from "./PartialsUsage.astro";
4544
export { default as Plan } from "./Plan.astro";
46-
export { default as PlanInfo } from "./PlanInfo.astro";
4745
export { default as ProductChangelog } from "./ProductChangelog.astro";
4846
export { default as ProductReleaseNotes } from "./ProductReleaseNotes.astro";
4947
export { default as ProductFeatures } from "./ProductFeatures.astro";
50-
export { default as ProductsByTag } from "./ProductsByTag.astro";
5148
export { default as PublicStats } from "./PublicStats.astro";
5249
export { default as RelatedProduct } from "./RelatedProduct.astro";
5350
export { default as Render } from "./Render.astro";
@@ -57,7 +54,6 @@ export { default as RuleID } from "./RuleID.astro";
5754
export { default as SpotlightAuthorDetails } from "./SpotlightAuthorDetails.astro";
5855
export { default as Stream } from "./Stream.astro";
5956
export { default as TagsUsage } from "./TagsUsage.astro";
60-
export { default as TroubleshootingList } from "./TroubleshootingList.astro";
6157
export { default as TunnelCalculator } from "./TunnelCalculator.astro";
6258
export { default as Type } from "./Type.astro";
6359
export { default as TypeScriptExample } from "./TypeScriptExample.astro";
@@ -66,7 +62,6 @@ export { default as WARPReleases } from "./WARPReleases.astro";
6662
export { default as Width } from "./Width.astro";
6763
export { default as WorkersArchitectureDiagram } from "./WorkersArchitectureDiagram.astro";
6864
export { default as WorkersIsolateDiagram } from "./WorkersIsolateDiagram.astro";
69-
export { default as WorkerStarter } from "./WorkerStarter.astro";
7065
export { default as WorkersTemplates } from "./WorkersTemplates.astro";
7166
export { default as YouTube } from "./YouTube.astro";
7267
export { default as YouTubeVideos } from "./YouTubeVideos.astro";

src/content/docs/dns/dnssec/troubleshooting.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
pcx_content_type: troubleshooting
33
source: https://support.cloudflare.com/hc/en-us/articles/360021111972-Troubleshooting-DNSSEC
44
title: Troubleshooting
5+
description: Learn how to troubleshoot issues with DNSSEC
56
sidebar:
67
order: 9
78
head:

src/content/docs/dns/troubleshooting/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ sidebar:
66
label: Full resources list
77
---
88

9-
import { TroubleshootingList } from "~/components"
9+
import { ResourcesBySelector } from "~/components"
1010

1111
The following topics are useful for troubleshooting DNS issues.
1212

13-
<TroubleshootingList />
13+
<ResourcesBySelector directory="dns" types={["faq", "troubleshooting"]} filterables={["pcx_content_type"]} showDescriptions={false} />

0 commit comments

Comments
 (0)