Skip to content

Commit

Permalink
add dynamic title in article card
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitsinghkaler committed Jul 22, 2021
1 parent 6fbc74f commit fa6062c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
</div>
<div class="article-body">
<!-- Todo check spacing is 36px but should be 30px -->
<h3 class="article-title m-0">{{article.title}}</h3>
<span #ref>
<ng-content></ng-content>
</span>
<ng-container *ngIf="!ref.hasChildNodes()">
<h3 class="article-title m-0">{{article.title}}</h3>
</ng-container>
<div class="flex article-tags">
<a class="article-tag" *ngFor="let tag of article.tag_list">
#{{tag}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Article } from 'src/app/models/articles';
export class ArticleCardComponent implements OnInit {
@Input() article!: Article;
constructor() {}


ngOnInit(): void {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<a class="featured-img" style.background-image="url({{featured?.cover_image}})"></a>
<!-- Todo make featured title big -->
<app-article-card *ngIf="featured" [article]="featured"></app-article-card>
<app-article-card *ngIf="featured" [article]="featured">
<h3 class="featured-title">{{featured?.title}}</h3>
</app-article-card>
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ app-article-card {
background-size: cover;
background-position: center center;
}

.featured-title{
font-size: 1.875rem;
}

0 comments on commit fa6062c

Please sign in to comment.