Add color to outgoing and incoming challenges (#9235)

* add colour to incoming challenge

* add color to outgoing challenge

* align color in incoming challenge

* use colorChoice rather than finalColor

* yarn run format

* sbt scalafmtAll
pull/9349/head
Adam Morris 2021-07-04 02:58:07 +10:00 committed by GitHub
parent b370f12758
commit 7a7ee0a5c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -41,6 +41,8 @@ object bits {
)
)
),
div(cls := "mode")(modeName(c.mode))
div(cls := "mode")(
s"${c.colorChoice.toString()}${modeName(c.mode)}"
)
)
}

View File

@ -164,6 +164,10 @@
.head .user-link {
margin-left: -5px;
}
.color-icon::before {
vertical-align: text-top;
}
}
.create {

View File

@ -47,10 +47,11 @@ function challenge(ctrl: Ctrl, dir: ChallengeDirection) {
[
h('div.content', [
h('span.head', renderUser(dir === 'in' ? c.challenger : c.destUser)),
h(
'span.desc',
[ctrl.trans()(c.rated ? 'rated' : 'casual'), timeControl(c.timeControl), c.variant.name].join(' • ')
),
h('span.desc', [
h('span.is.is2.color-icon.' + (c.color || 'random')),
' • ',
[ctrl.trans()(c.rated ? 'rated' : 'casual'), timeControl(c.timeControl), c.variant.name].join(' • '),
]),
]),
h('i', {
attrs: { 'data-icon': c.perf.icon },