add redux in csc

This commit is contained in:
Tykayn 2025-08-08 11:31:27 +02:00 committed by tykayn
parent a89007a81b
commit 3534919502
14 changed files with 277 additions and 12 deletions

View file

@ -0,0 +1,15 @@
<div class="alert is-{{alertKind}}">
@if (alertKind == "warning"){
<i class="ri-triangle-line"></i>
}
@if (alertKind == "danger"){
<i class="ri-triangle-line"></i>
}
@if (alertKind == "error"){
<i class="ri-triangle-line"></i>
}
<slot name="main">
{{message}}
</slot>
<ng-content></ng-content>
</div>

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AlertBox } from './alert-box';
describe('AlertBox', () => {
let component: AlertBox;
let fixture: ComponentFixture<AlertBox>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AlertBox]
})
.compileComponents();
fixture = TestBed.createComponent(AlertBox);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,22 @@
import {Component, Input} from '@angular/core';
import {NgClass} from '@angular/common';
@Component({
selector: 'app-alert-box',
imports: [
],
templateUrl: './alert-box.html',
styleUrl: './alert-box.scss'
})
export class AlertBox {
get alertKind(): string {
return this._alertKind;
}
set alertKind(value: string) {
this._alertKind = value;
}
@Input() public _alertKind: string = "warning";
@Input() public message: string = "";
}

View file

@ -7,7 +7,10 @@
"@angular/forms": "^20.1.0",
"bulma": "^1.0.4",
"remixicon": "^4.6.0",
"shepherd.js": "^14.5.1"
"shepherd.js": "^14.5.1",
"@ngrx/store": "^20.0.0",
"@ngrx/store-devtools": "^20.0.0"
},
"dependencies": {
"tslib": "^2.3.0"

View file

@ -27,3 +27,4 @@
@use '_layout_demo.scss';
@use '_main_button.scss';