Skip to content

Commit

Permalink
tmp: potentially replace directive
Browse files Browse the repository at this point in the history
  • Loading branch information
damienwebdev committed Sep 26, 2023
1 parent b6c6cec commit 039aefb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<button *ngIf="!hideCloseButton" daff-icon-button color="theme-contrast" class="daff-sidebar-header__close-button" (click)="onCloseSidebar($event)">
<fa-icon [icon]="faTimes" size="sm"></fa-icon>
</button>
<ng-content select="[daffSidebarHeaderTitle]"></ng-content>
<div class="daff-sidebar-header__close-button" *ngIf="_close">
<ng-content select="[daffSidebarHeaderClose]"></ng-content>
</div>
<div class="daff-sidebar-header__title" *ngIf="_title">
<ng-content select="[daffSidebarHeaderTitle]"></ng-content>
</div>
<ng-content></ng-content>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
EventEmitter,
Input,
ViewEncapsulation,
ContentChild,
ElementRef,
} from '@angular/core';
import { faTimes } from '@fortawesome/free-solid-svg-icons';

Expand All @@ -22,11 +24,9 @@ export class DaffSidebarHeaderComponent {

@HostBinding('class.daff-sidebar-header') class = true;

@HostBinding('class.hide-button') get hideClass() {
return this.hideCloseButton;
}
@ContentChild('[daffSidebarHeaderTitle]', { read: ElementRef }) _title: ElementRef;

@Input() hideCloseButton = false;
@ContentChild('[daffSidebarHeaderClose]', { read: ElementRef }) _close: ElementRef;

@Output() closeSidebar: EventEmitter<void> = new EventEmitter();

Expand Down

0 comments on commit 039aefb

Please sign in to comment.