Skip to content

Commit 45353aa

Browse files
committed
feat: add number of total answers
1 parent 11dd689 commit 45353aa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/src/components/leaderboard/LeaderboardAnswer.svelte

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
let loading = true;
88
let error = null;
99
let isUsernamePresent = false;
10+
let globalCount = 0;
1011
1112
token.subscribe(token => {
1213
if (token) {
@@ -34,6 +35,8 @@
3435
break;
3536
}
3637
38+
globalCount = globalCount + items.length;
39+
3740
items.forEach(pr => {
3841
const userLogin = pr.user.login;
3942
if (prCounts[userLogin]) {
@@ -76,6 +79,7 @@
7679
{#if !$isConnected}
7780
<div class="important-block not-connected">Log in to Github to see the list</div>
7881
{:else}
82+
🔥Total Answers: <span class="global-count">{ globalCount }</span>
7983
{#if isUsernamePresent}
8084
<div class="link-username">
8185
<a href={`#${$username}`}>Check my position</a>
@@ -102,6 +106,11 @@
102106
margin-top: 1rem;
103107
}
104108
109+
.global-count {
110+
color: red;
111+
font-size: 20px;
112+
}
113+
105114
.link-username {
106115
margin-top: 2rem;
107116
width: 100%;

0 commit comments

Comments
 (0)