From ee1d0dfb6d179d8742b6a3eb6ffce6a08fb16c9f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Jun 2019 15:14:13 +0200 Subject: Improve account username copy button --- client/src/app/+accounts/accounts.component.html | 6 +++++- client/src/app/+accounts/accounts.component.scss | 8 +++++++- client/src/app/+accounts/accounts.component.ts | 8 +++++++- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/+accounts/accounts.component.html b/client/src/app/+accounts/accounts.component.html index 1172f7ba7..0e9719dcf 100644 --- a/client/src/app/+accounts/accounts.component.html +++ b/client/src/app/+accounts/accounts.component.html @@ -8,9 +8,13 @@
{{ account.displayName }}
{{ account.nameWithHost }} - +
Banned Muted diff --git a/client/src/app/+accounts/accounts.component.scss b/client/src/app/+accounts/accounts.component.scss index 3cedda889..273e5c43a 100644 --- a/client/src/app/+accounts/accounts.component.scss +++ b/client/src/app/+accounts/accounts.component.scss @@ -15,4 +15,10 @@ my-user-moderation-dropdown, .badge { font-size: 13px; -} \ No newline at end of file +} + +.copy-button { + border: none; + padding: 5px; + margin-top: -2px; +} diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index d9786fb5c..3118d7562 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts @@ -7,6 +7,7 @@ import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/oper import { Subscription } from 'rxjs' import { AuthService, Notifier, RedirectService } from '@app/core' import { User, UserRight } from '../../../../shared' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ templateUrl: './accounts.component.html', @@ -25,7 +26,8 @@ export class AccountsComponent implements OnInit, OnDestroy { private notifier: Notifier, private restExtractor: RestExtractor, private redirectService: RedirectService, - private authService: AuthService + private authService: AuthService, + private i18n: I18n ) {} ngOnInit () { @@ -56,6 +58,10 @@ export class AccountsComponent implements OnInit, OnDestroy { this.redirectService.redirectToHomepage() } + activateCopiedMessage () { + this.notifier.success(this.i18n('Username copied')) + } + private getUserIfNeeded (account: Account) { if (!account.userId) return if (!this.authService.isLoggedIn()) return -- cgit v1.2.3