diff --git a/src/components/Event.js b/src/components/Event.js index 2104edc..e02b187 100644 --- a/src/components/Event.js +++ b/src/components/Event.js @@ -13,14 +13,42 @@ const cats = [ id: 43, title: 'Online meetup', color: '#FCF9BE' + }, + { + id: 49, + title: 'Meetup (komunita)', + color: '#CFFDE1' } ] +const langs = { + "česky": { emoji: "🇨🇿" }, + "anglicky": { emoji: "🇬🇧" } +} + +function renderLangs (e) { + let arr = [] + for (const lang of Object.keys(langs)) { + if (e.tags.includes(lang)) { + arr.push(langs[lang].emoji) + } + } + return arr +} + + export default function Event({ event }) { if (!event) { return null } const e = event + const placeMatch = e.title.match(/^([^@]+)@(.+)$/) + if (placeMatch) { + e.title = placeMatch[1] + e.place = placeMatch[2] + } + e.langs = renderLangs(e) + const start = new Date(e.start) const url = "https://forum.gwei.cz/t/" + e.slug + "/" + e.id let cat = cats.find(c => c.id === e.category_id) @@ -41,9 +69,17 @@ export default function Event({ event }) {
{e.title}
+
+ {e.langs.map(lang => ( + {lang} + ))} + {cat.title} +
{format(start, 'HH:mm', { locale: cs })}
-
{cat.title}
- {/*
XXX
*/} + {e.place ? +
{e.place}
+ : ""} +
{e.image_url ? diff --git a/src/components/EventList.js b/src/components/EventList.js index d8e3ff4..86f3cce 100644 --- a/src/components/EventList.js +++ b/src/components/EventList.js @@ -20,6 +20,7 @@ async function transformFeed (data) { image_url: t.image_url, excerpt: t.excerpt, category_id: t.category_id, + tags: t.tags, } }) const months = [] diff --git a/src/css/custom.css b/src/css/custom.css index 0088153..c168b42 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -121,4 +121,9 @@ img.inline-image { .gwei-event .event-image img { max-height: 100%; +} + +.gwei-event .event-lang { + display: inline-block; + margin-right: 0.5em; } \ No newline at end of file