-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kit): support
fallback
for avatar
when img not found by `ava…
…tarUrl` (#4243)
- Loading branch information
Showing
8 changed files
with
110 additions
and
13 deletions.
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
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
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
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/components/avatar/examples/6/index.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,12 @@ | ||
<tui-avatar | ||
new | ||
class="avatar" | ||
[avatarUrl]="waterplea" | ||
></tui-avatar> | ||
|
||
<tui-avatar | ||
new | ||
fallback="tuiIconUserLarge" | ||
class="tui-space_left-3 avatar" | ||
[avatarUrl]="wrongUrl" | ||
></tui-avatar> |
16 changes: 16 additions & 0 deletions
16
projects/demo/src/modules/components/avatar/examples/6/index.less
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,16 @@ | ||
@import 'taiga-ui-local'; | ||
|
||
:host { | ||
display: flex; | ||
} | ||
|
||
.avatar { | ||
.shadow(1); | ||
|
||
background: transparent; | ||
border: 1px solid; | ||
|
||
&:hover { | ||
.shadow(5); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
projects/demo/src/modules/components/avatar/examples/6/index.ts
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,15 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: 'tui-avatar-example-6', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiAvatarExample6 { | ||
readonly waterplea = 'https://avatars.githubusercontent.com/u/11832552?v=4'; | ||
readonly wrongUrl = 'https://taiga-ui.dev/assets/images/test-not-found.png'; | ||
} |
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
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