Skip to content

Commit

Permalink
adds button to quickly copy the community id to clipboad
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhoune committed Oct 6, 2023
1 parent 8bba9bd commit c0511a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
*ngIf="members$ | async as members; else loading"
>
<h2>{{ communityName$ | async }} Community Members</h2>
<div class="flex">
<button
mat-raised-button
(click)="copyToIdClipboard()"
class="m-auto"
aria-label="Example icon button with a home icon"
>
Copy Community Id <mat-icon> content_copy </mat-icon>
</button>
</div>

<mat-list class="flex flex-col mb-4">
<mat-list-item *ngFor="let member of members">
<mat-icon matListIcon>account_circle</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ export class CommunityInfoComponent implements OnInit, OnDestroy {
this.user = undefined;
}
}
async copyToIdClipboard() {
const groupdId = await firstValueFrom(
this.ngrxStore.select(SELECTED_GROUP).pipe(
take(1),
map((group) => group.id),
),
);
navigator.clipboard.writeText(groupdId);
}

async addUserToGroup() {
if (!this.user) return;
Expand Down

0 comments on commit c0511a7

Please sign in to comment.