Skip to content

Commit

Permalink
feat(addon-commerce): ThumbnailCard add <img> support (#8789)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlufy authored Sep 2, 2024
1 parent 77a1eea commit 9fdb499
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
[icon]="iconEnd"
/>
</div>
<div class="t-left t-icon">
<ng-content select="img" />
</div>
<ng-content />
<ng-container *ngIf="paymentSystem">
<tui-icon
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<tui-thumbnail-card
iconEnd="@tui.user"
paymentSystem="visa"
>
<img src="https://brands-prod.cdn-tinkoff.ru/general_logo/sber.png" />
1234
</tui-thumbnail-card>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:host {
display: flex;
gap: 1rem;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {NgFor} from '@angular/common';
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiThumbnailCard} from '@taiga-ui/addon-commerce';

@Component({
standalone: true,
imports: [TuiThumbnailCard, NgFor],
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
export default class Example {}
8 changes: 7 additions & 1 deletion projects/demo/src/modules/components/thumbnail-card/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ import type {TuiSizeL, TuiSizeS} from '@taiga-ui/core';
changeDetection,
})
export default class Example {
protected readonly examples = ['Sizes', 'A cool one', 'Backgrounds'];
protected readonly examples = [
'Sizes',
'A cool one',
'Backgrounds',
'External colored icon',
];

protected readonly iconVariants = ['', '@tui.lock', '@tui.cloud', '@tui.user'];
protected iconStart = this.iconVariants[0]!;
protected iconEnd = this.iconVariants[0]!;
Expand Down

0 comments on commit 9fdb499

Please sign in to comment.