Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Title and Subtitle Optional in UpWindowAngularComponent #9

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

lucasferreiralimax
Copy link
Member

This pull request modifies the UpWindowAngularComponent to make the title and subtitle inputs optional. This change enhances the flexibility of the component, allowing it to be used in scenarios where these elements may not be necessary.

Changes Made

  • Updated the @Input properties for title and subtitle to allow undefined values, making them optional.
  • Added conditional rendering for the title and subtitle in the template, ensuring that the corresponding HTML elements are only generated when values are provided.

Code Snippet

// In up-window-angular.component.ts
@Input() title?: string; // Now optional
@Input() subtitle?: string; // Now optional
@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>
  }

Testing

  • Verified that the component functions correctly without a title or subtitle.
  • Confirmed that existing functionality remains intact and unaffected by these changes.

@lucasferreiralimax lucasferreiralimax self-assigned this Oct 15, 2024
@lucasferreiralimax lucasferreiralimax merged commit 7bf4450 into master Oct 15, 2024
1 check passed
@lucasferreiralimax lucasferreiralimax deleted the titles-optionals branch October 15, 2024 03:42
Copy link

Visit the preview URL for this PR (updated for commit 356036a):

https://up-window-angular--pr9-titles-optionals-08rqoz36.web.app

(expires Tue, 22 Oct 2024 03:42:54 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 7822e0d6e40bbbcb5ceaa0eda2c38488d7b613f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant