add alert box
This commit is contained in:
parent
db2bef5a3c
commit
0a8088b459
3 changed files with 8 additions and 8 deletions
|
@ -26,7 +26,7 @@ export class ToolsOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleFilter(filter: filterType, newState: boolean) {
|
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);
|
const filterIndex = this.filters.findIndex(f => f.name === filter.name);
|
||||||
|
|
||||||
if (filterIndex !== -1) {
|
if (filterIndex !== -1) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type {Meta, StoryObj} from '@storybook/angular';
|
import type {Meta, StoryObj} from '@storybook/angular';
|
||||||
import {moduleMetadata} from '@storybook/angular';
|
import {moduleMetadata} from '@storybook/angular';
|
||||||
import {AlertBox} from 'sae-lib/alert-box/alert-box';
|
import {AlertBox} from 'sae-lib/alert-box/alert-box';
|
||||||
import {CommonModule} from '@angular/common';
|
// import {CommonModule} from '@angular/common';
|
||||||
|
|
||||||
const meta: Meta<AlertBox> = {
|
const meta: Meta<AlertBox> = {
|
||||||
title: 'Components/AlertBox',
|
title: 'Components/AlertBox',
|
||||||
|
@ -9,8 +9,8 @@ const meta: Meta<AlertBox> = {
|
||||||
tags: ['autodocs'],
|
tags: ['autodocs'],
|
||||||
decorators: [
|
decorators: [
|
||||||
moduleMetadata({
|
moduleMetadata({
|
||||||
imports: [CommonModule],
|
// imports: [CommonModule],
|
||||||
providers: []
|
// providers: []
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
argTypes: {
|
argTypes: {
|
||||||
|
|
|
@ -169,9 +169,9 @@ function appReducer(state = initialState.app, action: AppActions) {
|
||||||
...action.payload
|
...action.payload
|
||||||
};
|
};
|
||||||
case ActionTypes.SWITCH_TO_NEXT_THEME:
|
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);
|
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;
|
const nextThemeIndex = (currentThemeIndex + 1) % state.themesList.length;
|
||||||
// Get the next theme
|
// Get the next theme
|
||||||
const nextTheme = state.themesList[nextThemeIndex];
|
const nextTheme = state.themesList[nextThemeIndex];
|
||||||
|
@ -182,9 +182,9 @@ function appReducer(state = initialState.app, action: AppActions) {
|
||||||
activeTheme: nextTheme
|
activeTheme: nextTheme
|
||||||
};
|
};
|
||||||
case ActionTypes.SWITCH_TO_NEXT_LANGUAGE:
|
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);
|
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;
|
const nextLangIndex = (currentLangIndex + 1) % state.langsList.length;
|
||||||
// Get the next language
|
// Get the next language
|
||||||
const nextLang = state.langsList[nextLangIndex];
|
const nextLang = state.langsList[nextLangIndex];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue