Skip to content

Commit e28c2f9

Browse files
committed
remove area logic for now
1 parent 4f58277 commit e28c2f9

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

src/components/ProductChangelog.astro

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { slug } from "github-slugger";
77
import RSSButton from "~/components/RSSButton.astro";
88
import AnchorHeading from "~/components/AnchorHeading.astro";
99
import { format } from "date-fns";
10-
import ProductPills from "~/components/changelog/ProductPills.astro";
11-
1210
const props = z
1311
.object({
1412
product: reference("products"),
@@ -21,13 +19,11 @@ const props = z
2119
const input = await props.parseAsync(Astro.props);
2220
let filter: GetChangelogsOptions["filter"];
2321
let rss: string;
24-
let areaFeed: boolean
2522
if ("product" in input) {
2623
rss = `/changelog/rss/${input.product.id}.xml`;
2724
filter = (e) => {
2825
return !e.data.hidden && e.data.products.some(({ id }) => id === input.product.id);
2926
};
30-
areaFeed = false;
3127
} else {
3228
rss = `/changelog/rss/${slug(input.area)}.xml`;
3329
const products = await getCollection("products", (e) => {
@@ -36,7 +32,6 @@ if ("product" in input) {
3632
filter = (e) => {
3733
return e.data.products.some((x) => products.some((y) => x.id === y.id));
3834
};
39-
areaFeed = true;
4035
}
4136
const changelogs = await getChangelogs({ filter });
4237
---
@@ -45,29 +40,15 @@ const changelogs = await getChangelogs({ filter });
4540

4641
{
4742
changelogs.map(async (entry) => {
48-
const { Content } = await render(entry);
4943

50-
// If areaFeed is true, add ProductPills
51-
if (areaFeed === true) {
52-
return (
53-
<AnchorHeading depth={2} title={format(entry.data.date, "yyyy-MM-dd")} />
54-
<ProductPills products={entry.data.products} />
55-
<br />
56-
<strong>{entry.data.title}</strong>
57-
<br />
58-
<Content />
59-
);
60-
}
6144

62-
// Default output
45+
const { Content } = await render(entry);
6346
return (
64-
<>
65-
<AnchorHeading depth={2} title={format(entry.data.date, "yyyy-MM-dd")} />
66-
<br />
67-
<strong>{entry.data.title}</strong>
68-
<br />
69-
<Content />
70-
</>
47+
<AnchorHeading depth={2} title={format(entry.data.date, "yyyy-MM-dd")} />
48+
<br/>
49+
<strong>{entry.data.title}</strong>
50+
<br/>
51+
<Content />
7152
);
7253
})
7354
}

0 commit comments

Comments
 (0)