Skip to content

Commit

Permalink
fix: add no url icon
Browse files Browse the repository at this point in the history
  • Loading branch information
xjh22222228 committed Aug 3, 2024
1 parent 4372a83 commit 902f5da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/components/logo/logo.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
<img
*ngIf="url"
*ngIf="url; else noSrc"
[src]="url"
class="icon dark-border-color"
class="icon"
[ngStyle]="{ width: size + 'px', height: size + 'px' }"
draggable="false"
loading="lazy"
[alt]="name ? name[0] : ''"
/>

<ng-template #noSrc>
<div
class="circle"
[ngStyle]="{
width: size + 'px',
height: size + 'px'
}"
>
{{ name ? name[0] : '' }}
</div>
</ng-template>
2 changes: 2 additions & 0 deletions src/components/logo/logo.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
justify-content: center;
align-items: center;
border-radius: 50%;
background-color: #1890ff;
font-size: 18px;
}

0 comments on commit 902f5da

Please sign in to comment.