Update
ci/woodpecker/push/woodpecker Pipeline was successful
Podrobnosti
ci/woodpecker/push/woodpecker Pipeline was successful
Podrobnosti
This commit is contained in:
rodič
3b1d519284
revize
9838b3cc97
|
@ -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 }) {
|
|||
<div class="event-body">
|
||||
<div class="event-title"><a href={url}>{e.title}</a></div>
|
||||
<div class="event-subtitle">
|
||||
<div class="subtitle event-category" style={{backgroundColor:cat.color}}>
|
||||
{e.langs.map(lang => (
|
||||
<span class="event-lang">{lang}</span>
|
||||
))}
|
||||
{cat.title}
|
||||
</div>
|
||||
<div class="subtitle event-time">{format(start, 'HH:mm', { locale: cs })}</div>
|
||||
<div class="subtitle event-category" style={{backgroundColor:cat.color}}>{cat.title}</div>
|
||||
{/*<div class="subtitle event-place">XXX</div>*/}
|
||||
{e.place ?
|
||||
<div class="subtitle event-place">{e.place}</div>
|
||||
: ""}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{e.image_url ?
|
||||
|
|
|
@ -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 = []
|
||||
|
|
|
@ -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;
|
||||
}
|
Načítá se…
Odkázat v novém úkolu