From 2fa791d17ae9ac9ecd0fe16d96ba40c8f55e187f Mon Sep 17 00:00:00 2001 From: MishaZhem Date: Tue, 20 Aug 2024 17:24:47 +0300 Subject: [PATCH] chore: remove extra code --- .../nft/nft-item/nft-item.component.html | 16 +++---- .../nft/nft-item/nft-item.component.less | 7 --- .../nft/nft-item/nft-item.component.ts | 4 -- .../crypto/components/nft/nft.service.ts | 44 ++++++++++++++----- 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.html b/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.html index 6192fcfe9..52bb4c037 100644 --- a/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.html +++ b/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.html @@ -1,13 +1,6 @@ @let nftData = nft(); @if (nftData) {
- {{ nftData.name }} }
+ {{ nftData.name }} @for (column of columns; track $index) { diff --git a/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.less b/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.less index a888e01b1..2e678f2eb 100644 --- a/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.less +++ b/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.less @@ -11,13 +11,6 @@ justify-content: space-between; } -.close { - position: absolute; - top: 1rem; - right: 0; - z-index: 2; -} - .text { display: flex; width: 100%; diff --git a/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.ts b/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.ts index fc0cb220b..d02e4fed9 100644 --- a/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.ts +++ b/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft-item/nft-item.component.ts @@ -8,7 +8,6 @@ import { ChangeDetectionStrategy, Component, EventEmitter, - inject, input, Output, } from '@angular/core'; @@ -25,7 +24,6 @@ import {TuiAvatar, TuiBadge} from '@taiga-ui/kit'; import {TuiHeader} from '@taiga-ui/layout'; import type {NFT} from '../nft.service'; -import {NftService} from '../nft.service'; @Component({ standalone: true, @@ -52,8 +50,6 @@ import {NftService} from '../nft.service'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class NftItemComponent { - protected readonly nftService = inject(NftService); - protected readonly columns = ['type', 'priceUsd', 'from', 'to', 'time']; @Output() diff --git a/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft.service.ts b/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft.service.ts index 883a03e96..d7603e76f 100644 --- a/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft.service.ts +++ b/apps/taiga-lumbermill/src/dashboards/crypto/components/nft/nft.service.ts @@ -5,16 +5,10 @@ export interface NFT { readonly src: string; readonly price: number; readonly tags: string[]; + readonly transactions: Transaction[]; } -export const INITIAL_DATA: NFT[] = [ - {name: 'Beth', src: './nft/1.jpg', price: 1, tags: ['Premium', 'VIP']}, - {name: 'Pryor', src: './nft/2.jpg', price: 2, tags: ['Premium', 'VIP']}, - {name: 'Olea', src: './nft/3.jpg', price: 3, tags: ['Premium', 'VIP']}, - {name: 'Imogen', src: './nft/4.jpg', price: 4, tags: ['Premium', 'VIP']}, -]; - -export interface Transactions { +export interface Transaction { readonly type: string; readonly priceUsd: number; readonly from: string; @@ -22,7 +16,7 @@ export interface Transactions { readonly time: number; } -export const INITIAL_DATA_TABLE: Transactions[] = [ +export const INITIAL_DATA_TABLE: Transaction[] = [ { type: 'Putting up for sale', priceUsd: 2, @@ -53,10 +47,40 @@ export const INITIAL_DATA_TABLE: Transactions[] = [ }, ]; +export const INITIAL_DATA: NFT[] = [ + { + name: 'Beth', + src: './nft/1.jpg', + price: 1, + tags: ['Premium', 'VIP'], + transactions: INITIAL_DATA_TABLE, + }, + { + name: 'Pryor', + src: './nft/2.jpg', + price: 2, + tags: ['Premium', 'VIP'], + transactions: INITIAL_DATA_TABLE, + }, + { + name: 'Olea', + src: './nft/3.jpg', + price: 3, + tags: ['Premium', 'VIP'], + transactions: INITIAL_DATA_TABLE, + }, + { + name: 'Imogen', + src: './nft/4.jpg', + price: 4, + tags: ['Premium', 'VIP'], + transactions: INITIAL_DATA_TABLE, + }, +]; + @Injectable({ providedIn: 'root', }) export class NftService { public readonly nfts = INITIAL_DATA; - public readonly transactions = INITIAL_DATA_TABLE; }