Skip to content

Commit

Permalink
add logic for no url
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmojicatech committed Dec 18, 2022
1 parent e7886e8 commit f0089ab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
<div class="stats-container">
<span class="player-container">
<ion-avatar>
<img [src]="stat.imgUrl" />
<img *ngIf="stat.imgUrl && stat.imgUrl !== 'undefined'; else noImage" [src]="stat.imgUrl" />
<ng-template #noImage>
<img src="https://ionicframework.com/docs/img/demos/avatar.svg" />
</ng-template>
</ion-avatar>
<span>{{stat.player}}</span>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class FantasyFootballComponent implements OnInit, OnDestroy {
{
id: pos.id,
player: pos.player,
imgUrl: pos.imageUrl,
imgUrl: pos.imageUrl ?? 'https://ionicframework.com/docs/img/demos/avatar.svg',
stat: +pos[currentPositionMapState[index].availableStats[currentStatHeader]]
}
)).sort((prev, next) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<ion-content *ngIf="player$ | async as player">

<ion-card>
<img [src]="player.imageUrl" />
<img *ngIf="player.imageUrl && player.imageUrl !== 'undefined'; else noImage" [src]="player.imageUrl" />
<ng-template #noImage>
<img src="https://ionicframework.com/docs/img/demos/avatar.svg" />
</ng-template>
<ion-card-header>{{player.player}}</ion-card-header>
</ion-card>

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"docker-deploy-fantalytic-api": "docker build -t paulmojicatech/fantalytic-api -f fantalytic-api-dockerfile . && docker push paulmojicatech/fantalytic-api",
"fantalytic-web-scraper-cron": "nx build --project fantalytic-web-scraper-cron && cd dist/apps/fantalytic-web-scraper-cron && node ./main.js",
"fantalytic-mobile-build-sync-open-ios": "rm -rf apps/fantalytic-mobile/www/* && nx build --project=fantalytic-mobile --configuration prod && cp -a dist/apps/fantalytic-mobile/* apps/fantalytic-mobile/www && cd apps/fantalytic-mobile && cap sync ios && cap open ios && cd ../..",
"fantalytic-mobile-build-sync-open-android": "rm -rf apps/fantalytic-mobile/www/* && nx build --project=fantalytic-mobile --configuration prod && cp -a dist/apps/fantalytic-mobile/* apps/fantalytic-mobile/www && cd apps/fantalytic-mobile && cap sync android && cap open android && cd ../..",
"docker-deploy-fantalytic-web-scraper-cron": "nx build --project fantalytic-web-scraper-cron && docker build -t paulmojicatech/fantalytic-web-scraper-cron-image -f fantalytic-web-scraper-cron-image-dockerfile . && docker push paulmojicatech/fantalytic-web-scraper-cron-image"
},
"private": true,
Expand Down

0 comments on commit f0089ab

Please sign in to comment.