Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,27 @@ function refreshTable(newData) {
const tdUsername = document.createElement('td')
const username = document.createElement('a')
const rank = document.createElement('span')

username.href = data[contributor.username].home
username.innerText = contributor.username
rank.innerText = index + 1
tr.id = contributor.username

tdUsername.appendChild(username)
tdUsername.appendChild(rank)

// joining date (if available)
const joiningDate =
data[contributor.username].joinedAt ||
data[contributor.username].createdAt

if (joiningDate) {
const joined = document.createElement('div')
joined.className = 'joining-date'
joined.innerText = `Joined: ${moment(joiningDate).format('MMM YYYY')}`
tdUsername.appendChild(joined)
}

tr.id = contributor.username
tr.appendChild(tdUsername)

// empty td tag
Expand Down
7 changes: 7 additions & 0 deletions src/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,11 @@ td span {
.inactiveLink {
pointer-events: none;
cursor: default;
}

.joining-date {
font-size: 12px;
color: #9BA2AB;
margin-top: 4px;
text-align: left;
}