Skip to content

Commit 5dcd485

Browse files
Merge pull request #37 from PyConAPAC/update-events-ui-2025-2
Update Events Section UI - make date readable
2 parents 09b622c + 2f04f3f commit 5dcd485

File tree

3 files changed

+63
-35
lines changed

3 files changed

+63
-35
lines changed

src/views/events/EventData.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,70 @@ export const events = [
77
title: 'PyCon APAC',
88
location: 'Ateneo de Manila University, Quezon City, Philippines',
99
link: 'https://pycon-apac.python.ph/',
10+
countryCode: 'PH',
1011
},
1112
{
1213
date: '18-20 June',
1314
title: 'PyCon SG',
1415
location: 'Singapore Institute of Technology, Singapore',
1516
link: 'https://pycon.sg',
17+
countryCode: 'SG',
1618
},
1719
{
1820
date: '15-17 August',
1921
title: 'PyCon KR',
2022
location: 'Dongguk University, Seoul, South Korea',
2123
link: 'https://2025.pycon.kr/',
24+
countryCode: 'KR',
2225
},
2326
{
2427
date: '5-7 September',
2528
title: 'PyCon TW ',
2629
location: 'Taipei, Taiwan',
2730
link: 'https://tw.pycon.org/2025/en-us',
31+
countryCode: 'TW',
2832
},
2933
{
3034
date: '12-15 Sep',
3135
title: 'PyCon India',
3236
location: 'Nimhans Convention Center, Bangalore, India',
3337
link: 'https://in.pycon.org/2025/',
38+
countryCode: 'IN',
3439
},
3540
{
3641
date: '12-16 Sep',
3742
title: 'PyCon AU',
3843
location: 'Melbourne, Australia',
3944
link: 'https://2025.pycon.org.au',
45+
countryCode: 'AU',
4046
},
4147
{
4248
date: '26-27 Sep',
4349
title: 'PyCon JP',
4450
location: 'Hiroshima, Japan',
4551
link: 'https://2025.pycon.jp',
52+
countryCode: 'JP',
4653
},
4754
{
4855
date: '11-12 Oct (tentative)',
4956
title: 'PyCon HK',
5057
location: 'City University of Hong Kong, Hong Kong',
5158
link: 'https://pycon.hk',
59+
countryCode: 'HK',
5260
},
5361
{
5462
date: '17-18 Oct',
5563
title: 'PyCon TH',
5664
location: 'Avani Sukhumvit Bangkok Hotel, Bangkok, Thailand',
5765
link: 'https://th.pycon.org',
66+
countryCode: 'TH',
5867
},
5968
{
6069
date: '21-23 Nov',
6170
title: 'PyCon NZ',
6271
location: 'Wellington waterfront, New Zealand',
6372
link: 'https://kiwipycon.nz',
73+
countryCode: 'NZ',
6474
}
6575
];
6676

src/views/events/Events.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,23 @@ export default function Events() {
3333
<br />
3434
</div>
3535
<div className="medium-text text-white">
36-
{/* <ul>
37-
{events.map((event: any, index: number) => (
38-
<li>{event.date}: <strong>{event.title}</strong> {event.location} {event.link && <a href={event.link}>🔗</a>}</li>
39-
))}
40-
</ul>*/}
4136
<div className="event-cards">
4237
{events.map((event, index) => (
43-
<a
44-
key={index}
45-
href={event.link}
46-
className="event-card"
47-
target="_blank"
48-
rel="noopener noreferrer"
49-
>
50-
<span className="event-date">{event.date}</span>
51-
<span className="event-title">{event.title}</span>
52-
<span className="event-location">{event.location}</span>
53-
</a>
38+
<a
39+
key={index}
40+
href={event.link}
41+
className="event-card"
42+
target="_blank"
43+
rel="noopener noreferrer"
44+
>
45+
<div className="event-date-card">{event.date}</div>
46+
<div className="event-details">
47+
<div className="event-title">
48+
{countryCodeToFlag(event.countryCode)} {event.title}
49+
</div>
50+
<div className="event-location">{event.location}</div>
51+
</div>
52+
</a>
5453
))}
5554
</div>
5655

@@ -71,7 +70,7 @@ export default function Events() {
7170
<div className="medium-text text-white" style={{opacity: '60%'}}>
7271
<ul>
7372
{upcomingEvents.map((event: any, index: number) => (
74-
<li key={index}>{event.date}: <strong>{event.title}</strong> {event.location} {event.link && <a href={event.link}>🔗</a>}</li>
73+
<li key={index}>{event.date}: <strong>{event.title}</strong> {event.location} {event.link && <a href={event.link}>🔗</a>}</li>
7574
))}
7675
</ul>
7776
</div>
@@ -156,3 +155,10 @@ export default function Events() {
156155
</div>
157156
)
158157
}
158+
159+
160+
const countryCodeToFlag = (code: string) => {
161+
if (!code || code.length !== 2) return '';
162+
const offset = 127397;
163+
return String.fromCodePoint(...code.toUpperCase().split('').map(c => c.charCodeAt(0) + offset));
164+
};

src/views/events/style.css

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -142,46 +142,58 @@
142142
display: flex;
143143
flex-direction: column;
144144
gap: 0.5rem;
145-
margin-top: 1rem;
145+
width: 100%;
146146
}
147147

148148
.event-card {
149149
display: flex;
150150
align-items: center;
151-
gap: 1.5rem;
152-
padding: 0.75rem 1rem;
151+
padding: 1rem;
153152
background: #f5f3fa;
154153
border: 1px solid #ddd;
155154
border-radius: 8px;
156155
color: #1a1a1a;
157156
text-decoration: none;
158157
transition: background 0.2s ease, transform 0.2s ease;
159-
font-size: 0.95rem;
160-
white-space: nowrap;
161-
overflow: hidden;
162-
text-overflow: ellipsis;
158+
gap: 1rem;
159+
width: 100%;
163160
}
164161

165-
.event-card:hover {
166-
background: #ece8f5;
162+
.event-date-card {
163+
background: #dcd6f7;
164+
border-radius: 6px;
165+
padding: 0.5rem 0.75rem;
166+
font-size: 0.85rem;
167+
font-weight: 600;
168+
white-space: nowrap;
169+
color: #2c1e4a;
170+
flex-shrink: 0;
167171
}
168172

169-
.event-date {
170-
flex: 0 0 auto;
171-
min-width: 100px;
172-
color: #555;
173+
.event-details {
174+
display: flex;
175+
flex-direction: column;
176+
flex: 1;
177+
min-width: 0;
173178
}
174179

175180
.event-title {
176181
font-weight: 600;
177-
flex: 0 0 auto;
178-
min-width: 120px;
179-
color: #222;
182+
font-size: 1rem;
183+
margin-bottom: 0.25rem;
184+
display: flex;
185+
align-items: center;
186+
gap: 0.4rem;
187+
color: #1a1a1a;
188+
overflow: hidden;
189+
text-overflow: ellipsis;
190+
white-space: nowrap;
180191
}
181192

182193
.event-location {
183-
flex: 1;
194+
font-size: 0.9rem;
195+
color: #555;
184196
overflow: hidden;
185197
text-overflow: ellipsis;
186-
color: #444;
198+
white-space: nowrap;
187199
}

0 commit comments

Comments
 (0)