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

Add common-section-card component #1524

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="common-section-card-container">
<header class="header-container">
<ng-content select="[header]"></ng-content>
</header>
<section class="content-container">
<ng-content select="[content]"></ng-content>
</section>
<section class="footer-container">
<ng-content select="[footer]"></ng-content>
</section>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CommonSectionCardComponent } from './common-section-card.component';

describe('CommonSectionCardComponent', () => {
let component: CommonSectionCardComponent;
let fixture: ComponentFixture<CommonSectionCardComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [CommonSectionCardComponent]
})
.compileComponents();

fixture = TestBed.createComponent(CommonSectionCardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';

/**
* A component nested in this component can be displayed in the **header**, **content** or **footer** slot.
* The **header** slot should contain a component that wraps a **app-common-section-card-header**.
* The **content** slot should contain a component that wraps a **app-common-section-card-content**.
* The **footer** slot should contain a component that wraps a **app-common-section-card-footer**.
* Simply nest the component and add the slot name as an attribute.
*
* Example usage:
*
* ```
* <app-common-section-card>
* <div header>Hi I'm in the header slot</div>
* <div content>Hi I'm in the content slot</div>
* <div footer>Hi I'm in the content slot</div>
* </app-common-section-card>
* ```
*/
@Component({
selector: 'app-common-section-card',
standalone: true,
imports: [CommonModule, TranslateModule],
templateUrl: './common-section-card.component.html',
styleUrl: './common-section-card.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CommonSectionCardComponent {
}
Loading