add alert box

This commit is contained in:
Tykayn 2025-09-10 13:01:25 +02:00 committed by tykayn
parent db2bef5a3c
commit 0a8088b459
3 changed files with 8 additions and 8 deletions

View file

@ -26,7 +26,7 @@ export class ToolsOptions {
}
toggleFilter(filter: filterType, newState: boolean) {
// Find the index of the filter in the array
// Find the main-button of the filter in the array
const filterIndex = this.filters.findIndex(f => f.name === filter.name);
if (filterIndex !== -1) {

View file

@ -1,7 +1,7 @@
import type {Meta, StoryObj} from '@storybook/angular';
import {moduleMetadata} from '@storybook/angular';
import {AlertBox} from 'sae-lib/alert-box/alert-box';
import {CommonModule} from '@angular/common';
// import {CommonModule} from '@angular/common';
const meta: Meta<AlertBox> = {
title: 'Components/AlertBox',
@ -9,8 +9,8 @@ const meta: Meta<AlertBox> = {
tags: ['autodocs'],
decorators: [
moduleMetadata({
imports: [CommonModule],
providers: []
// imports: [CommonModule],
// providers: []
})
],
argTypes: {

View file

@ -169,9 +169,9 @@ function appReducer(state = initialState.app, action: AppActions) {
...action.payload
};
case ActionTypes.SWITCH_TO_NEXT_THEME:
// Find the index of the current active theme
// Find the main-button of the current active theme
const currentThemeIndex = state.themesList.indexOf(state.activeTheme);
// Calculate the index of the next theme (or go back to the first theme if at the end)
// Calculate the main-button of the next theme (or go back to the first theme if at the end)
const nextThemeIndex = (currentThemeIndex + 1) % state.themesList.length;
// Get the next theme
const nextTheme = state.themesList[nextThemeIndex];
@ -182,9 +182,9 @@ function appReducer(state = initialState.app, action: AppActions) {
activeTheme: nextTheme
};
case ActionTypes.SWITCH_TO_NEXT_LANGUAGE:
// Find the index of the current language
// Find the main-button of the current language
const currentLangIndex = state.langsList.indexOf(state.lang);
// Calculate the index of the next language (or go back to the first language if at the end)
// Calculate the main-button of the next language (or go back to the first language if at the end)
const nextLangIndex = (currentLangIndex + 1) % state.langsList.length;
// Get the next language
const nextLang = state.langsList[nextLangIndex];