-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: new component for sub account UI
- Loading branch information
1 parent
50978bd
commit 2525f27
Showing
5 changed files
with
498 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
157 changes: 157 additions & 0 deletions
157
src/app/grouped-account-select/grouped-account-select.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
<div | ||
class="spinner-border" | ||
style="width: 8rem; height: 8rem" | ||
*ngIf="loadingAccounts; else accountsSection" | ||
></div> | ||
<ng-template #accountsSection> | ||
<div class="section--accounts" *ngIf="hasVisibleAccounts"> | ||
<div class="section--accounts__header margin-bottom--medium"> | ||
Select an account | ||
</div> | ||
|
||
<ng-container | ||
*ngFor=" | ||
let group of accountGroups | keyvalue : keyValueSort; | ||
let i = index | ||
" | ||
> | ||
<div *ngIf="group.value.accounts.length" class="margin-bottom--large"> | ||
<ul | ||
class="section--accounts__list container--scrollbar margin-bottom--small" | ||
> | ||
<li | ||
*ngFor="let account of group.value.accounts; let j = index" | ||
data-control-name="account-select-item" | ||
> | ||
<div class="display--flex items--center margin-top--small"> | ||
<button | ||
class="section--accounts__item margin-right--small" | ||
(click)="selectAccount(account.publicKey)" | ||
role="button" | ||
> | ||
<div class="display--flex items--center"> | ||
<img | ||
class="avatar--rounded avatar--large margin-right--small" | ||
[appAvatar]="account.publicKey" | ||
/> | ||
<div> | ||
<div> | ||
<span [title]="getAccountDisplayName(account)">{{ | ||
getAccountDisplayName(account) | ||
| truncateAddressOrUsername | ||
}}</span> | ||
<span | ||
*ngIf="account.lastUsed && !this.globalVars.isMobile()" | ||
class="font-size--xsmall text--green-lighter margin-left--small" | ||
>Last used</span | ||
> | ||
</div> | ||
<div | ||
*ngIf="this.globalVars.isMobile()" | ||
class="display--flex" | ||
> | ||
<span class="font-size--xsmall" | ||
>Account: {{ account.accountNumber }}</span | ||
> | ||
<span | ||
*ngIf="account.lastUsed" | ||
class="font-size--xsmall text--green-lighter margin-left--auto" | ||
>Last used</span | ||
> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="display--flex items--center"> | ||
<div | ||
*ngIf="!this.globalVars.isMobile()" | ||
class="display--flex flex--column items--end" | ||
> | ||
<span class="font-size--xsmall margin-right--small" | ||
>Account: {{ account.accountNumber }}</span | ||
> | ||
</div> | ||
<img | ||
[src]=" | ||
getLoginMethodIcon( | ||
accountService.getLoginMethodWithPublicKeyBase58Check( | ||
group.key | ||
) | ||
) | ||
" | ||
class="section--accounts__icon" | ||
/> | ||
</div> | ||
</button> | ||
<button | ||
*ngIf="!isMetaMaskAccountGroup(group.key)" | ||
class="styleless-button" | ||
(click)="hideAccount(group.key, account)" | ||
> | ||
<i-feather name="power" class="text--blue-base"></i-feather> | ||
</button> | ||
</div> | ||
</li> | ||
</ul> | ||
<div *ngIf="!isMetaMaskAccountGroup(group.key)"> | ||
<div class="display--flex"> | ||
<button | ||
class="button--small button--primary display--flex items--center margin-right--small" | ||
style="width: auto; white-space: nowrap" | ||
aria-label="Add account" | ||
(click)="addSubAccount(group.key)" | ||
> | ||
<i-feather | ||
name="user-plus" | ||
class="margin-right--xsmall" | ||
style="height: 16px; width: 16px" | ||
/> | ||
Account | ||
</button> | ||
<button | ||
class="button--small button--secondary display--flex items--center" | ||
style="width: auto; white-space: nowrap" | ||
(click)="toggleRecoverSubAccountForm(group.key)" | ||
> | ||
<i-feather | ||
name="power" | ||
class="margin-right--xsmall" | ||
style="height: 16px; width: 16px" | ||
/> | ||
Recover | ||
</button> | ||
</div> | ||
<form | ||
*ngIf="group.value.showRecoverSubAccountInput" | ||
(submit)="recoverSubAccount($event, group.key)" | ||
class="margin-top--small margin-left--small" | ||
> | ||
<label for="account-number" class="display--block font-size--small" | ||
>Enter account number:</label | ||
> | ||
<input | ||
[(ngModel)]="accountNumberToRecover" | ||
name="account-number" | ||
id="account-number" | ||
type="number" | ||
step="1" | ||
/> | ||
<button | ||
type="submit" | ||
class="button--primary button--small margin-left--small" | ||
style="width: auto; white-space: nowrap" | ||
> | ||
Submit | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</ng-template> | ||
<div | ||
*ngIf="hasVisibleAccounts" | ||
class="text--divider margin-top--medium margin-bottom--medium" | ||
> | ||
or | ||
</div> | ||
<app-log-in-options></app-log-in-options> |
Empty file.
Oops, something went wrong.