Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add verified information on user's lists #93

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading