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