mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-22 01:36:55 +01:00
Merge pull request #230 from bigchaindb/fix/empty-meetup
Check for existing next meetup
This commit is contained in:
commit
118f458c3c
@ -7,15 +7,23 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
// just grab the first item of array
|
||||
const nextEvent = events[0]
|
||||
const element = document.getElementsByClassName('js-social-link--meetup')[0]
|
||||
|
||||
if (nextEvent) {
|
||||
const name = nextEvent.name
|
||||
const link = nextEvent.link
|
||||
const date = new Date(nextEvent.time).toLocaleDateString('en-us', { month: 'short', day: 'numeric' })
|
||||
const element = document.getElementsByClassName('js-social-link--meetup')[0]
|
||||
const date = new Date(nextEvent.time).toLocaleDateString('en-us', {
|
||||
month: 'short',
|
||||
day: 'numeric'
|
||||
})
|
||||
const elementTitle = document.getElementsByClassName('meetup-title')[0]
|
||||
|
||||
elementTitle.innerHTML = '<span class="hero__community__label">' + date + '</span> ' + '<strong>' + name + '</strong>'
|
||||
elementTitle.innerHTML = `<span class="hero__community__label">${date}</span><strong>${name}</strong>`
|
||||
elementTitle.style.opacity = 1
|
||||
element.href = link
|
||||
} else {
|
||||
element.classList.add('hide')
|
||||
}
|
||||
}
|
||||
|
||||
fetch(url)
|
||||
|
Loading…
Reference in New Issue
Block a user