Skip to content

Commit

Permalink
Add pending send banner in prior notification form
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Jun 21, 2024
1 parent af5225e commit 932118a
Showing 1 changed file with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PriorNotification } from '@features/PriorNotification/PriorNotification
import { updateEditedPriorNotificationComputedValues } from '@features/PriorNotification/useCases/updateEditedPriorNotificationComputedValues'
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { Accent, Button, FormikEffect, Icon, usePrevious } from '@mtes-mct/monitor-ui'
import { Accent, Banner, Button, FormikEffect, Icon, Level, usePrevious } from '@mtes-mct/monitor-ui'
import { getDefinedObject } from '@utils/getDefinedObject'
import { useFormikContext } from 'formik'
import { isEqual } from 'lodash'
Expand Down Expand Up @@ -81,6 +81,12 @@ export function Card({ isValidatingOnChange, onClose, onSubmit, onVerifyAndSend,
<Wrapper>
<FormikEffect onChange={updateComputedValuesIfMecessary as any} />

{editedPriorNotificationDetail?.state === PriorNotification.State.PENDING_SEND && (
<StyledBanner isCollapsible level={Level.WARNING} top="100px">
Le préavis est en cours de diffusion.
</StyledBanner>
)}

<FrontendErrorBoundary>
<Header isNewPriorNotification={isNewPriorNotification} onClose={onClose} vesselId={values.vesselId} />

Expand Down Expand Up @@ -138,9 +144,31 @@ const Wrapper = styled.div`
display: flex;
flex-direction: column;
height: 100%;
position: relative;
width: 560px;
`

const StyledBanner = styled(Banner)`
box-shadow: inset 0 3px 6px ${p => p.theme.color.lightGray};
padding: 0;
> div > p {
font-size: 16px;
font-weight: 500;
padding-top: 3px;
}
> .banner-button {
position: relative;
> button {
position: absolute;
right: 32px;
top: -7.5px;
}
}
`

const Body = styled.div`
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 932118a

Please sign in to comment.