Skip to content

Commit

Permalink
Add verified information on user's lists
Browse files Browse the repository at this point in the history
  • Loading branch information
mczachurski committed Sep 16, 2024
1 parent 03c3106 commit 6dcfa3b
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class FollowButtonsSectionComponent implements OnInit {

onOriginalProfile(): void {
if (this.user?.activityPubProfile) {
this.windowService.openPage(this.user.activityPubProfile);
this.windowService.openPage(this.user.url ?? this.user.activityPubProfile);
}
}

Expand Down
14 changes: 12 additions & 2 deletions src/app/components/widgets/users-card/users-card.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@
</div>

<div class="overflow-ellipsis width-100">
<div class="overflow-ellipsis"><a [routerLink]="[ '/@' + user.userName ]" class="margin-right-5 fw-600">{{ userDisplayService.displayName(user) }}</a></div>
<div class="fw-400 fs-90 text-muted overflow-ellipsis">&#64;{{ user.userName }}</div>
<div class="overflow-ellipsis">
<a [routerLink]="[ '/@' + user.userName ]" class="margin-right-5 fw-600">{{ userDisplayService.displayName(user) }}</a>
</div>
<div class="fw-400 fs-90 text-muted overflow-ellipsis">
<div>&#64;{{ user.userName }}</div>
@if (userDisplayService.verifiedUrl(user)) {
<div class="verification-badge text-success">
<mat-icon [inline]="true" class="fill-symbol verification-icon">check</mat-icon>
<span [innerHTML]="userDisplayService.verifiedUrl(user)" class="green-link"></span>
</div>
}
</div>

<div *ngIf="showBio" class="bio" [innerHTML]="user.bioHtml"></div>
<div class="fw-300 fs-90 flex-row flex-wrap">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
align-items: center;
}

.verification-badge {

.verification-icon {
width: 14px;
height: 14px;
}
}

.user-statuses-tag {
display: none;
}
Expand Down
1 change: 1 addition & 0 deletions src/app/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Role } from "./role";

export class User {
public id?: string;
public url?: string;
public isLocal?: boolean;
public isBlocked?: boolean;
public isApproved?: boolean;
Expand Down
14 changes: 14 additions & 0 deletions src/app/services/common/user-display.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,18 @@ export class UserDisplayService {

return '';
}

verifiedUrl(user: User | undefined): string | undefined {
if(!user || !user.fields || user.fields.length === 0) {
return undefined;
}

for(const field of user.fields) {
if (field.isVerified) {
return field.valueHtml;
}
}

return undefined;
}
}
24 changes: 24 additions & 0 deletions src/styles/app-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,30 @@
}
}

.green-link {
a {
&:link {
color: mat.m2-get-color-from-palette($green, 800);
text-decoration: none;
}

&:visited {
color: mat.m2-get-color-from-palette($green, 800);
text-decoration: none;
}

&:hover {
color: mat.m2-get-color-from-palette($green, 800);
text-decoration: none;
}

&:active {
color: mat.m2-get-color-from-palette($green, 800);
text-decoration: none;
}
}
}

.text-error {
color: mat.m2-get-color-from-palette($error);
}
Expand Down

0 comments on commit 6dcfa3b

Please sign in to comment.