fixed formatting and removed not needed padding

This commit is contained in:
Mitarashi 2022-01-05 14:27:52 +02:00
parent 6dd64b02fc
commit 33dd55067b
2 changed files with 6 additions and 7 deletions

View file

@ -174,9 +174,8 @@
.tweet-stat {
padding-top: 5px;
padding-right: 8px;
min-width: 1em;
margin-right: 0.2em;
margin-right: 0.8em;
}
.show-thread {

View file

@ -181,16 +181,16 @@ proc renderCard(card: Card; prefs: Prefs; path: string): VNode =
tdiv(class="card-content-container"):
renderCardContent(card)
func condNumber(stat: int): string {.inline.} =
func formatStat(stat: int): string =
if stat > 0: insertSep($stat, ',')
else: ""
proc renderStats(stats: TweetStats; views: string): VNode =
buildHtml(tdiv(class="tweet-stats")):
span(class="tweet-stat"): icon "comment", condNumber(stats.replies)
span(class="tweet-stat"): icon "retweet", condNumber(stats.retweets)
span(class="tweet-stat"): icon "quote" , condNumber(stats.quotes)
span(class="tweet-stat"): icon "heart" , condNumber(stats.likes)
span(class="tweet-stat"): icon "comment", formatStat(stats.replies)
span(class="tweet-stat"): icon "retweet", formatStat(stats.retweets)
span(class="tweet-stat"): icon "quote", formatStat(stats.quotes)
span(class="tweet-stat"): icon "heart", formatStat(stats.likes)
if views.len > 0:
span(class="tweet-stat"): icon "play", insertSep(views, ',')