Show country flag emoji

This commit is contained in:
nymkappa
2022-07-18 00:55:47 +02:00
parent f16076b401
commit ccdeb108ee
5 changed files with 26 additions and 5 deletions

View File

@@ -35,7 +35,11 @@
<tr *ngFor="let country of countries">
<td class="text-left rank">{{ country.rank }}</td>
<td class="text-left text-truncate name">
<a [routerLink]="['/lightning/nodes/country' | relativeUrl, country.iso]">{{ country.name.en }}</a>
<div class="d-flex">
<span style="font-size: 20px">{{ country.flag }}</span>
&nbsp;
<a class="mt-auto mb-auto" [routerLink]="['/lightning/nodes/country' | relativeUrl, country.iso]">{{ country.name.en }}</a>
</div>
</td>
<td class="text-right share">{{ country.share }}%</td>
<td class="text-right nodes">{{ country.count }}</td>

View File

@@ -9,6 +9,7 @@ import { StateService } from 'src/app/services/state.service';
import { download } from 'src/app/shared/graphs.utils';
import { AmountShortenerPipe } from 'src/app/shared/pipes/amount-shortener.pipe';
import { RelativeUrlPipe } from 'src/app/shared/pipes/relative-url/relative-url.pipe';
import { getFlagEmoji } from 'src/app/shared/graphs.utils';
@Component({
selector: 'app-nodes-per-country-chart',
@@ -50,6 +51,7 @@ export class NodesPerCountryChartComponent implements OnInit {
for (let i = 0; i < data.length; ++i) {
data[i].rank = i + 1;
data[i].iso = data[i].iso.toLowerCase();
data[i].flag = getFlagEmoji(data[i].iso);
}
return data.slice(0, 100);
}),