fix shield tournament icon

This commit is contained in:
Thibault Duplessis 2021-06-15 15:05:28 +02:00
parent d933ca8ae3
commit eff1d475ce
2 changed files with 4 additions and 3 deletions

View file

@ -567,7 +567,7 @@ object JsonView {
implicit private[tournament] def perfTypeWrites(implicit lang: Lang): OWrites[PerfType] =
OWrites { pt =>
Json
.obj("name" -> pt.trans)
.obj("key" -> pt.key, "name" -> pt.trans)
.add("icon" -> mobileBcIcons.get(pt)) // mobile BC only
}

View file

@ -1,6 +1,7 @@
import { h, VNode } from 'snabbdom';
import TournamentController from '../ctrl';
import { dataIcon } from './util';
import perfIcons from 'common/perfIcons';
function startClock(time) {
return {
@ -55,7 +56,7 @@ function image(d): VNode | undefined {
attrs: { src: lichess.assetUrl('images/' + s.iconImg) },
});
return h('i.img', {
attrs: dataIcon((s && s.iconFont) || ''),
attrs: dataIcon(s?.iconFont || ''),
});
}
@ -69,7 +70,7 @@ function title(ctrl: TournamentController) {
{
attrs: { href: '/tournament/shields' },
},
d.perf.icon
perfIcons[d.perf.key]
),
d.fullName,
]);