mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 04:43:03 -05:00
feat: add number of total answers
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
let loading = true;
|
||||
let error = null;
|
||||
let isUsernamePresent = false;
|
||||
let globalCount = 0;
|
||||
|
||||
token.subscribe(token => {
|
||||
if (token) {
|
||||
@@ -34,6 +35,8 @@
|
||||
break;
|
||||
}
|
||||
|
||||
globalCount = globalCount + items.length;
|
||||
|
||||
items.forEach(pr => {
|
||||
const userLogin = pr.user.login;
|
||||
if (prCounts[userLogin]) {
|
||||
@@ -76,6 +79,7 @@
|
||||
{#if !$isConnected}
|
||||
<div class="important-block not-connected">Log in to Github to see the list</div>
|
||||
{:else}
|
||||
🔥Total Answers: <span class="global-count">{ globalCount }</span>
|
||||
{#if isUsernamePresent}
|
||||
<div class="link-username">
|
||||
<a href={`#${$username}`}>Check my position</a>
|
||||
@@ -102,6 +106,11 @@
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.global-count {
|
||||
color: red;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.link-username {
|
||||
margin-top: 2rem;
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user