Skip to content

Commit 105081c

Browse files
committed
fix(community): correct KubeCon date range and prevent badge clipping
Signed-off-by: LakshanSS <lakshan230897@gmail.com>
1 parent 2275dbe commit 105081c

2 files changed

Lines changed: 13 additions & 28 deletions

File tree

src/pages/community/events.json

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@
22
"events": [
33
{
44
"month": "JUN",
5-
"day": "11",
6-
"category": "Meetups",
7-
"title": "Cloud Native Hyderabad",
8-
"meta": "Virtual · Open to all",
9-
"primaryAction": "Register",
10-
"primaryActionHref": "https://ocgroups.dev/cncf/group/cloud-native-hyderabad/event/tr9jkbf"
11-
},
12-
{
13-
"month": "JUN",
14-
"day": "18 19",
5+
"day": "18–19",
156
"category": "Conferences",
167
"title": "KubeCon + CloudNativeCon India 2026",
178
"meta": "Bengaluru, India",
@@ -27,19 +18,5 @@
2718
"primaryAction": "Add to calendar",
2819
"primaryActionHref": "https://zoom-lfx.platform.linuxfoundation.org/meetings/openchoreo?view=list"
2920
}
30-
],
31-
"pastEvents": [
32-
{
33-
"date": "June 4",
34-
"title": "Kubernetes Sri Lanka",
35-
"action": "More Details",
36-
"actionHref": "https://ocgroups.dev/cncf/group/f8dnmxt/event/hkf8t4e"
37-
},
38-
{
39-
"date": "June 3",
40-
"title": "Cloud Native London",
41-
"action": "More Details",
42-
"actionHref": "https://www.meetup.com/cloud-native-london/events/312972430/?eventOrigin=group_upcoming_events"
43-
}
4421
]
4522
}

src/pages/community/index.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Layout from '@theme/Layout';
33
import Link from '@docusaurus/Link';
44
import styles from './styles.module.css';
55
import communityEvents from './events.json';
6+
import pastEventsData from './past-events.json';
67

78
type EventCategory = 'Meetups' | 'Community calls' | 'Conferences';
89

@@ -20,11 +21,11 @@ type PastEventItem = {
2021
date: string;
2122
title: string;
2223
action: string;
23-
actionHref: string;
24+
href: string;
2425
};
2526

2627
const events = communityEvents.events as EventItem[];
27-
const pastEvents = communityEvents.pastEvents as PastEventItem[];
28+
const pastEvents = pastEventsData.pastEvents as PastEventItem[];
2829

2930
const filters = [
3031
'All',
@@ -168,7 +169,14 @@ export default function Community(): React.JSX.Element {
168169

169170
return (
170171
<article className={styles.eventCard} key={event.title}>
171-
<div className={styles.eventDate}>
172+
<div
173+
className={[
174+
styles.eventDate,
175+
event.day.length > 2 ? styles.eventDateRange : '',
176+
]
177+
.filter(Boolean)
178+
.join(' ')}
179+
>
172180
<span>{event.month}</span>
173181
<strong>{event.day}</strong>
174182
</div>
@@ -223,7 +231,7 @@ export default function Community(): React.JSX.Element {
223231
<strong>{event.title}</strong>
224232
<Link
225233
className='button button--link button--sm'
226-
to={event.actionHref}
234+
to={event.href}
227235
>
228236
{event.action}
229237
</Link>

0 commit comments

Comments
 (0)