Skip to content

Commit

Permalink
Merge pull request #9 from criar-art/titles-optionals
Browse files Browse the repository at this point in the history
Make Title and Subtitle Optional in UpWindowAngularComponent
  • Loading branch information
lucasferreiralimax authored Oct 15, 2024
2 parents 124d1b2 + 356036a commit 7bf4450
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,25 @@
×
</button>
}
<div class="up-window-header">
<h3 id="dialog-title" class="up-window-title">{{ title }}</h3>
<h4 id="dialog-description" class="up-window-subtitle">
{{ subtitle }}
</h4>
</div>

@if(title || subtitle) {
<div class="up-window-header">
@if(title) {
<h3 id="dialog-title" class="up-window-title">{{ title }}</h3>
}

@if(subtitle) {
<h4 id="dialog-description" class="up-window-subtitle">
{{ subtitle }}
</h4>
}
</div>
}

<div class="up-window-body">
<ng-content></ng-content>
</div>

<div class="up-window-footer" [ngClass]="'align-' + buttonAlignment">
<button
class="btn btn-cancel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
.up-window-header {
display: flex;
flex-direction: column;
margin-bottom: 20px;
}

.up-window-title,
Expand All @@ -67,7 +68,7 @@
}

.up-window-body {
margin: 20px 0;
margin: 0 0 20px;
}

.up-window-footer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ import {
encapsulation: ViewEncapsulation.None,
})
export class UpWindowAngularComponent implements OnInit, OnDestroy {
@Input() title: string = 'Default Title';
@Input() subtitle: string = 'Default Subtitle';
@Input() size: string = 'medium';
@Input() title?: string;
@Input() subtitle?: string;
@Input() class: string | undefined;
@Input() isOpen: WritableSignal<boolean> = signal(false);
@Input() animation: string = 'fade';
Expand Down
2 changes: 0 additions & 2 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ <h2 class="content-title">Mode</h2>
</button>
<up-window-angular
[isOpen]="isWindowOpenFullScreen"
title="FullScreen Window"
subtitle="This window mode FullScreen."
[fullScreen]="true"
>
Mode FullScreen content!
Expand Down

0 comments on commit 7bf4450

Please sign in to comment.