Skip to content

Commit

Permalink
Fix banner auto-closing in control unit contact form
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed May 22, 2024
1 parent 6e29521 commit aad88be
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test:unit:watch": "npm run test:unit -- --watch"
},
"dependencies": {
"@mtes-mct/monitor-ui": "17.0.0",
"@mtes-mct/monitor-ui": "17.2.2",
"@reduxjs/toolkit": "1.9.7",
"@rsuite/responsive-nav": "5.0.1",
"@sentry/browser": "7.73.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function ControlUnitContactList({ controlUnit, onSubmit }: ControlUnitCon
addMainWindowBanner({
children:
'Cette unité n’a actuellement plus d’adresse de diffusion. Elle ne recevra plus de préavis ni de bilan de ses activités de contrôle.',
closingDelay: 115000,
closingDelay: 15000,
isClosable: true,
isFixed: true,
level: Level.WARNING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import type { Promisable } from 'type-fest'

type ItemProps = {
bannerProps: BannerStackItemProps
bannerStackRank: number
bannerStackId: number
onCloseOrAutoclose: (bannerStackKey: number) => Promisable<void>
}
export function Item({ bannerProps, bannerStackRank, onCloseOrAutoclose }: ItemProps) {
export function Item({ bannerProps, bannerStackId, onCloseOrAutoclose }: ItemProps) {
const controlledBannerProps: BannerProps = {
...bannerProps,
onAutoClose: () => onCloseOrAutoclose(bannerStackRank),
onClose: () => onCloseOrAutoclose(bannerStackRank),
onAutoClose: () => onCloseOrAutoclose(bannerStackId),
onClose: () => onCloseOrAutoclose(bannerStackId),
top: '0'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function BannerStack() {
return (
<Wrapper>
{bannerStackItems.map(({ id, props }) => (
<Item key={`banner-${id}`} bannerProps={props} bannerStackRank={id} onCloseOrAutoclose={remove} />
<Item key={`banner-${id}`} bannerProps={props} bannerStackId={id} onCloseOrAutoclose={remove} />
))}
</Wrapper>
)
Expand Down

0 comments on commit aad88be

Please sign in to comment.