Skip to content

Commit

Permalink
Merge pull request #3198 from aura-nw/baseline/main_20240327
Browse files Browse the repository at this point in the history
Baseline/main 20240327
  • Loading branch information
nhphuc2411 authored Mar 27, 2024
2 parents 19825de + 0002903 commit 4296d92
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/app/core/services/token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class TokenService extends CommonService {
filterBalanceNative$ = new BehaviorSubject<number>(null);
totalTransfer$ = new BehaviorSubject<number>(null);
excludedAddresses = this.environmentService.chainConfig.excludedAddresses;
pathDenom$ = new BehaviorSubject<string>(null);

get tokensMarket() {
return this.tokensMarket$.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<div class="card-body">
<!-- Filter -->
<div class="d-xl-flex justify-content-between align-items-center mb-4" *ngIf="!loading">
<span class="mb-0 fw-semibold text--gray-light-2 mr-lg-6 h3">
NFTs <span *ngIf="listCollection[0]?.quantity">({{ listCollection[0]?.quantity || 0 }})</span>
</span>
<span class="mb-0 fw-semibold text--gray-light-2 mr-lg-6 h3">NFTs ({{ listCollection[0]?.quantity || 0 }})</span>
<div class="d-flex flex-column flex-lg-row align-items-end justify-content-end gap-2">
<ng-container *ngIf="!errTxt">
<div class="d-flex align-items-center justify-content-center ml-2 ml-lg-0 w-100">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.aura-form.single-input-field.account-search-form {
width: 100%;

@media (min-width: 992px) {
width: 370px;
}
Expand All @@ -23,7 +24,7 @@
width: 100%;

@media (min-width: 991.98px) {
width: 220px;
width: 250px;
}

text-align: left;
Expand Down Expand Up @@ -97,7 +98,7 @@
padding: var(--spacer-3) var(--spacer-2);
background-color: var(--aura-gray-10);

& > * {
&>* {
color: var(--aura-white);
}

Expand Down Expand Up @@ -125,8 +126,9 @@

@media (min-width: 991.98px) {
max-width: 87%;

&.label {
max-width: 145px;
max-width: 140px;
}
}
}
Expand All @@ -139,15 +141,18 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

@media (max-width: 430px) {
max-width: 90px;
}

@media (min-width: 991.98px) {
max-width: 150px;
}

@media (min-width: 1367px) {
max-width: 180px;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,11 @@ export class TokenHoldersTabComponent implements OnInit {

return this.tokenService.getListAmountNative(addressList).pipe(
map((res) => {
accountBalance?.forEach((item, index) => {
item.amount = item.balance = _.get(res.data[index], 'amount');
item.owner = item.account?.address;
item.percent_hold = BigNumber(item.amount).dividedBy(tokenSupplyOrigin).multipliedBy(100);
accountBalance?.forEach((item) => {
const element = res?.data?.find((k) => k.address === item?.account?.address);
item.amount = item.balance = _.get(element, 'amount');
item.owner = element?.address;
item.percent_hold = BigNumber(element.amount).dividedBy(tokenSupplyOrigin).multipliedBy(100);
item.value =
BigNumber(item.amount)
.multipliedBy(this.tokenDetail?.price || 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { LegacyPageEvent as PageEvent } from '@angular/material/legacy-paginator
import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table';
import { ActivatedRoute, Router } from '@angular/router';
import * as _ from 'lodash';
import { Subject, takeUntil } from 'rxjs';
import { ContractRegisterType } from 'src/app/core/constants/contract.enum';
import { EModeToken } from 'src/app/core/constants/token.enum';
import { EnvironmentService } from 'src/app/core/data-services/environment.service';
import { TokenService } from 'src/app/core/services/token.service';
import { getTypeTx } from 'src/app/core/utils/common/info-common';
import {
LENGTH_CHARACTER,
NULL_ADDRESS,
Expand All @@ -22,8 +24,6 @@ import {
import { TableTemplate } from '../../../../../../core/models/common.model';
import { shortenAddress } from '../../../../../../core/utils/common/shorten';
import { convertTxIBC } from '../../../../../../global/global';
import { getTypeTx } from 'src/app/core/utils/common/info-common';
import { Subject, takeUntil } from 'rxjs';

@Component({
selector: 'app-token-transfers-tab',
Expand Down Expand Up @@ -83,6 +83,7 @@ export class TokenTransfersTabComponent implements OnInit, AfterViewInit {
EModeToken = EModeToken;
destroyed$ = new Subject<void>();
linkAddress: string;
isExistDenom = false;

coinMinimalDenom = this.environmentService.chainInfo.currencies[0].coinMinimalDenom;
denom = this.environmentService.chainInfo.currencies[0].coinDenom;
Expand Down Expand Up @@ -122,7 +123,6 @@ export class TokenTransfersTabComponent implements OnInit, AfterViewInit {
ngOnDestroy(): void {
this.destroyed$.next();
this.destroyed$.complete();

if (this.timerGetUpTime) {
clearInterval(this.timerGetUpTime);
}
Expand All @@ -136,9 +136,14 @@ export class TokenTransfersTabComponent implements OnInit, AfterViewInit {
this.getListTransactionTokenCW20(nextKey, isReload);
}
} else {
setTimeout(() => {
if (this.isExistDenom) {
this.getListTransactionTokenIBC(nextKey);
}, 500);
} else {
this.tokenService.pathDenom$
.pipe(takeUntil(this.destroyed$))
.subscribe(() => this.isExistDenom ?? this.getListTransactionTokenIBC(nextKey));
this.isExistDenom = true;
}
}
}

Expand Down Expand Up @@ -278,7 +283,7 @@ export class TokenTransfersTabComponent implements OnInit, AfterViewInit {
}

getListTransactionTokenIBC(nextKey = null) {
const denomFilter = this.tokenDetail.channelPath?.path + '/' + this.tokenDetail.channelPath?.base_denom;
const denomFilter = this.tokenDetail?.channelPath?.path + '/' + this.tokenDetail?.channelPath?.base_denom;
let payload = {
limit: this.pageData.pageSize,
heightLT: nextKey,
Expand Down
1 change: 1 addition & 0 deletions src/app/pages/token/token-detail/token-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export class TokenDetailComponent implements OnInit {
getInfoTokenIBC(denom) {
this.ibcService.getChannelInfoByDenom(encodeURIComponent(denom)).subscribe((res) => {
this.tokenDetail['channelPath'] = _.get(res, 'denom_trace');
this.tokenService.pathDenom$.next(_.get(res, 'denom_trace'));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
<app-name-tag
[value]="item['address']"
[isEnableRouter]="!item['address']?.startsWith('Null')"
[linkRouter]="[
(item['address'] || item['toAddress'] | isContract) ? '/contracts' : '/account',
item['address'] || item['toAddress']
]"
[maxCharacter]="10"></app-name-tag>
</ng-container>
<div [copyBtn]="item['address']" [btnClass]="['pl-2']" *ngIf="item['address'] | nameTagTooltipPipe">
Expand Down

0 comments on commit 4296d92

Please sign in to comment.