Fix wrong tweet header text

This commit is contained in:
Zed 2019-08-06 15:57:47 +02:00
parent 9487d11fcb
commit 4660d23667
1 changed files with 6 additions and 5 deletions

View File

@ -4,10 +4,11 @@ import karax/[karaxdsl, vdom, vstyles]
import ../types, ../utils, ../formatters
import tweet, timeline, renderutils
proc renderStat(stat, text: string): VNode =
buildHtml(li(class=text)):
span(class="profile-stat-header"): text capitalizeAscii(text)
span(class="profile-stat-num"): text stat
proc renderStat(num, class: string; text=""): VNode =
let t = if text.len > 0: text else: class
buildHtml(li(class=class)):
span(class="profile-stat-header"): text capitalizeAscii(t)
span(class="profile-stat-num"): text num
proc renderProfileCard*(profile: Profile): VNode =
buildHtml(tdiv(class="profile-card")):
@ -26,7 +27,7 @@ proc renderProfileCard*(profile: Profile): VNode =
tdiv(class="profile-card-extra-links"):
ul(class="profile-statlist"):
renderStat(profile.tweets, "posts")
renderStat(profile.tweets, "posts", text="Tweets")
renderStat(profile.followers, "followers")
renderStat(profile.following, "following")