1
1
mirror of https://github.com/primer/css.git synced 2025-01-07 14:58:54 +03:00

use real avatars

This commit is contained in:
Shawn Allen 2019-07-22 16:46:23 -07:00
parent d73daf52b3
commit 80829c15d2

View File

@ -38,11 +38,12 @@ module.exports = async function(source) {
} }
}, },
avatar_for: ([username, size], kwargs) => { avatar_for: ([username, size], kwargs) => {
const name = username === 'current_user' ? 'github' : username
const attrs = Object.entries(kwargs) const attrs = Object.entries(kwargs)
.map(([key, value]) => ` ${key}="${value}"`) .map(([key, value]) => ` ${key}="${value}"`)
.join(' ') .join(' ')
const s = size * 2 const s = size * 2
return `<img src="https://github.com/github.png?s=${s}" width="${size}" height="${size}"${attrs}>` return `<img src="https://github.com/${name}.png?s=${s}" width="${size}" height="${size}"${attrs}>`
} }
/* eslint-enable */ /* eslint-enable */
} }