Skip to content

Commit 181685e

Browse files
committed
add networks
1 parent b53ab8c commit 181685e

File tree

4 files changed

+67
-13
lines changed

4 files changed

+67
-13
lines changed

src/components/ChangelogSnippet/ChangelogCard.astro

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,17 @@ interface Props {
1111
autoExpand?: boolean
1212
showCopyButton?: boolean
1313
disableHover?: boolean
14+
showNetworksAndTopic?: boolean
1415
}
1516
16-
const { item, showBorder = true, autoExpand = false, showCopyButton = true, disableHover = false } = Astro.props
17+
const {
18+
item,
19+
showBorder = true,
20+
autoExpand = false,
21+
showCopyButton = true,
22+
disableHover = false,
23+
showNetworksAndTopic = false,
24+
} = Astro.props
1725
1826
// Format the date
1927
const formatDate = (dateString: string) => {
@@ -47,6 +55,15 @@ const formattedDate = formatDate(item["date-of-release"])
4755
</div>
4856

4957
<div class={styles.content} data-expandable="content">
58+
{
59+
showNetworksAndTopic && (item.networks || item.topic) && (
60+
<div class={styles.networksAndTopicSection}>
61+
{item.networks && <div set:html={item.networks} />}
62+
{item.topic && <span class="prod-chip">{item.topic}</span>}
63+
</div>
64+
)
65+
}
66+
5067
<Typography
5168
variant="h6"
5269
style={{
@@ -308,13 +325,12 @@ const formattedDate = formatDate(item["date-of-release"])
308325
.log-item__list-chains {
309326
display: flex;
310327
align-items: center;
311-
gap: 8px;
328+
gap: var(--space-1x);
312329
}
313330

314331
.log-item__img-chain {
315332
width: 24px;
316333
height: 24px;
317-
border-radius: 50%;
318334
object-fit: cover;
319335
}
320336

@@ -324,11 +340,11 @@ const formattedDate = formatDate(item["date-of-release"])
324340
justify-content: center;
325341
width: 24px;
326342
height: 24px;
327-
border-radius: 50%;
328-
background-color: var(--muted);
343+
background-color: var(--gray-950);
329344
font-size: 10px;
330345
font-weight: 600;
331-
color: var(--color-text-secondary);
346+
color: var(--white);
347+
border-radius: 3px;
332348
}
333349

334350
/* Hidden filter elements */
@@ -352,4 +368,16 @@ const formattedDate = formatDate(item["date-of-release"])
352368
[data-disable-hover="true"].withBorder:hover .contentFooter {
353369
background: none !important;
354370
}
371+
372+
/* Product Chip */
373+
.prod-chip {
374+
background-color: var(--muted-more);
375+
color: var(--mirage);
376+
border-radius: 4px;
377+
margin-bottom: 0;
378+
padding: var(--space-1x) var(--space-2x);
379+
font-size: 12px;
380+
line-height: 16px;
381+
display: inline-block;
382+
}
355383
</style>

src/components/ChangelogSnippet/ChangelogCard.module.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
& .card {
17-
padding: var(--space-6x);
17+
padding: var(--space-4x);
1818
}
1919
}
2020

@@ -99,6 +99,15 @@
9999
flex: 1;
100100
}
101101

102+
/* Networks and Topic Section */
103+
.networksAndTopicSection {
104+
display: flex;
105+
align-items: center;
106+
gap: var(--space-3x);
107+
margin-bottom: var(--space-4x);
108+
flex-wrap: wrap;
109+
}
110+
102111
/* Content Footer */
103112
.contentFooter {
104113
position: absolute;
@@ -181,8 +190,8 @@
181190

182191
@media screen and (max-width: 768px) {
183192
.card {
184-
padding: var(--space-4x);
185-
gap: var(--space-4x);
193+
padding: 0 !important;
194+
gap: 0;
186195
flex-direction: column;
187196
}
188197

@@ -220,6 +229,7 @@
220229

221230
.copyButton {
222231
width: 32px;
232+
opacity: 1;
223233
}
224234
}
225235

src/pages/changelog/[...id].astro

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ const pageTitle = `Changelog and Releases | ${CONFIG.SITE.title}`
8585
</div>
8686

8787
<div class="changelog-content">
88-
<ChangelogCard item={log} showBorder={false} autoExpand={true} showCopyButton={false} disableHover={true} />
88+
<ChangelogCard
89+
showNetworksAndTopic
90+
item={log}
91+
showBorder={false}
92+
autoExpand={true}
93+
showCopyButton={false}
94+
disableHover={true}
95+
/>
8996
</div>
9097
</main>
9198
</BaseLayout>

src/pages/changelog/index.astro

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (appId && apiKey) {
3131
3232
const firstResult = req.results[0]
3333
const results = "hits" in firstResult ? (firstResult.hits as ChangelogItem[]) : []
34-
34+
console.log(results[1])
3535
// logs are returned sorted by created_at DESC
3636
logs = results
3737
}
@@ -45,7 +45,7 @@ if (appId && apiKey) {
4545
</header>
4646

4747
<section class="changelog-list">
48-
{logs?.map((log) => <ChangelogCard showBorder={false} item={log} />)}
48+
{logs?.map((log) => <ChangelogCard showNetworksAndTopic showBorder={false} item={log} />)}
4949
</section>
5050
</main>
5151
</BaseLayout>
@@ -75,13 +75,22 @@ if (appId && apiKey) {
7575
margin-bottom: var(--space-16x);
7676
}
7777

78+
@media screen and (max-width: 428px) {
79+
.title {
80+
font-size: 2rem !important;
81+
}
82+
}
83+
7884
@media screen and (max-width: 768px) {
85+
.changelog-list {
86+
gap: var(--space-12x);
87+
}
7988
.tag {
8089
font-size: 12px;
8190
margin-bottom: var(--space-3x);
8291
}
8392
.title {
84-
font-size: 2rem;
93+
font-size: 2.5rem;
8594
}
8695
.header {
8796
margin-bottom: var(--space-10x);

0 commit comments

Comments
 (0)