Skip to content

Commit a081f9e

Browse files
committed
Allow post-article-edit-button show or hide options via @input()
1 parent 016fb28 commit a081f9e

5 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/app/shared/components/post-article/post-article.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Header -->
2-
<app-post-header [title]="title"></app-post-header>
2+
<app-post-header [title]="title" [showEditBtn]="showEditBtn"></app-post-header>
33
<!-- End Header -->
44

55
<article id="post-article">

src/app/shared/components/post-article/post-article.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ import {Component, Input} from "@angular/core";
77
})
88
export class PostArticleComponent {
99
@Input() title: string;
10+
@Input() showEditBtn = true;
1011
}

src/app/shared/components/post-header/post-header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<header class="post-header">
22
<h1 class="post-header-text">{{title}}</h1>
3-
<a class="edit-button button btn btn-sm" href="{{settings.gitHubRepo}}" target="blank">
3+
<a *ngIf="showEditBtn" class="edit-button button btn btn-sm" href="{{settings.gitHubRepo}}" target="blank">
44
<i class="fa fa-pencil"></i>
55
Edit
66
</a>

src/app/shared/components/post-header/post-header.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ import {environment} from "../../../../environments/environment";
88
})
99
export class PostHeaderComponent {
1010
@Input() title: string;
11+
@Input() showEditBtn = true;
1112
settings = environment;
1213
}

src/app/shared/components/versions/versions.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div class="post">
44
<!-- Article -->
5-
<app-post-article [title]="'DotNet Validator Versions'">
5+
<app-post-article [title]="'DotNet Validator Versions'" [showEditBtn]="false">
66

77
<ng-container class="article">
88

0 commit comments

Comments
 (0)