Skip to content

Commit

Permalink
Limit banner children prop to string type in main window banner stack
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed May 2, 2024
1 parent 252b34d commit 5fc1e09
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Banner, type BannerProps } from '@mtes-mct/monitor-ui'
import styled from 'styled-components'

import type { BannerStackItemProps } from './types'
import type { BannerStackItemProps } from '../../types'
import type { Promisable } from 'type-fest'

type ItemProps = {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { bannerStackAdapter, mainWindowActions } from '../slice'

import type { BannerStackItemProps } from '../components/BannerStack/types'
import type { BannerStackItemProps } from '../types'
import type { HomeAppThunk } from '@store/index'

/**
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/features/MainWindow/slice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createEntityAdapter, createSlice, type EntityState, type PayloadAction } from '@reduxjs/toolkit'

import type { BannerStackItem } from './components/BannerStack/types'
import type { BannerStackItem } from './types'

export const bannerStackAdapter = createEntityAdapter({
selectId: (bannerStackItem: BannerStackItem) => bannerStackItem.rank,
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/features/MainWindow/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
import type { BannerProps } from '@mtes-mct/monitor-ui'

export type BannerStackItem = {
props: BannerStackItemProps
rank: number
}
export type BannerStackItemProps = Omit<BannerProps, 'chilren' | 'onAutoClose' | 'onClose' | 'top'> & {
children: string
}

export enum MainWindowConfirmationModalActionType {
'DELETE_CONTROL_UNIT_CONTACT' = 'DELETE_CONTROL_UNIT_CONTACT',
'DELETE_CONTROL_UNIT_RESOURCE' = 'DELETE_CONTROL_UNIT_RESOURCE'
Expand Down

0 comments on commit 5fc1e09

Please sign in to comment.