Skip to content

Commit df7dbd0

Browse files
committed
feat: add verified badge
1 parent 01257da commit df7dbd0

File tree

2 files changed

+49
-8
lines changed

2 files changed

+49
-8
lines changed

src/app/search/search-result/search-result.component.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,20 @@ img + i {
9595
text-align: center;
9696
}
9797

98+
.verified {
99+
background: transparent;
100+
display: inline-block;
101+
font-style: normal;
102+
vertical-align: baseline;
103+
position: relative;
104+
}
105+
106+
.verified i {
107+
font-size: 18px;
108+
top: 2px;
109+
position: relative;
110+
}
111+
98112
@media (min-width: 299px) {
99113
mat-card.mat-card {
100114
width: 346px;

src/app/search/search-result/search-result.component.html

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
*ngFor="let package of packages; trackBy: packageName"
44
class="ngxtools-palette-accent mat-elevation-z4"
55
>
6-
<span class="ngxtools-palette-warn" [ngClass]="{ 'is-schematic': package.computedMetadata?.schematics }"></span>
6+
<span
7+
class="ngxtools-palette-warn"
8+
[ngClass]="{ 'is-schematic': package.computedMetadata?.schematics }"
9+
></span>
710
<mat-card-header>
811
<div mat-card-avatar class="header-image">
912
<img
@@ -16,12 +19,18 @@
1619
>account_circle</i
1720
>
1821
</div>
19-
<mat-card-title>{{ package.name }}</mat-card-title>
22+
<mat-card-title
23+
>{{ package.name }}
24+
<span *ngIf="package.owner.name === 'angular'" class="verified">
25+
<i class="material-icons">verified_user</i>
26+
</span
27+
></mat-card-title>
2028
<mat-card-subtitle
2129
(click)="searchByKeyword(package.owner.name)"
2230
[innerHtml]="package._highlightResult.owner?.name?.value"
23-
>{{ package.owner.name }}</mat-card-subtitle
2431
>
32+
{{ package.owner.name }}
33+
</mat-card-subtitle>
2534
</mat-card-header>
2635
<mat-card-content>
2736
<p [innerHTML]="package._highlightResult.description?.value">
@@ -73,7 +82,9 @@
7382
<a
7483
class="twitter-share-button"
7584
mat-button
76-
href="https://twitter.com/intent/tweet?text={{buildTweetText(package)}}"
85+
href="https://twitter.com/intent/tweet?text={{
86+
buildTweetText(package)
87+
}}"
7788
target="__blank"
7889
rel="noopener"
7990
>
@@ -82,10 +93,26 @@
8293
</mat-card-actions>
8394
<mat-card-footer>
8495
<p>
85-
<span title="Latest version {{ package.version }}"><i class="material-icons">label</i>{{ package.version }}</span>
86-
<span title="License {{package.license || 'N/A'}}" class="license__truncate"><i class="material-icons">copyright</i>{{ package.license || 'N/A' }}</span>
87-
<span title="Total downloads for the last 30 days {{package.humanDownloadsLast30Days}}"><i class="material-icons">cloud_download</i>{{ package.humanDownloadsLast30Days }}</span>
88-
<span title="Last Update on {{package.modified | date:'fullTime'}}"><i class="material-icons">calendar_today</i>{{ package.modified | date:'shortDate' }}</span>
96+
<span title="Latest version {{ package.version }}"
97+
><i class="material-icons">label</i>{{ package.version }}</span
98+
>
99+
<span
100+
title="License {{ package.license || 'N/A' }}"
101+
class="license__truncate"
102+
><i class="material-icons">copyright</i
103+
>{{ package.license || 'N/A' }}</span
104+
>
105+
<span
106+
title="Total downloads for the last 30 days {{
107+
package.humanDownloadsLast30Days
108+
}}"
109+
><i class="material-icons">cloud_download</i
110+
>{{ package.humanDownloadsLast30Days }}</span
111+
>
112+
<span title="Last Update on {{ package.modified | date: 'fullTime' }}"
113+
><i class="material-icons">calendar_today</i
114+
>{{ package.modified | date: 'shortDate' }}</span
115+
>
89116
</p>
90117
<p class="keywords">
91118
<span

0 commit comments

Comments
 (0)