Skip to content

Commit

Permalink
Fix prior notification list, card & form box-sizing [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Aug 27, 2024
1 parent 5ed77bb commit a324b6a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
5 changes: 5 additions & 0 deletions frontend/src/components/SideWindowCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function SideWindowCard({ children, onBackgroundClick, ...nativeProps }:
}

const Box = styled.div`
box-sizing: border-box;
bottom: 0;
display: flex;
justify-content: flex-end;
Expand All @@ -26,6 +27,10 @@ const Box = styled.div`
right: 0;
top: 0;
z-index: 1000;
* {
box-sizing: border-box;
}
`

const Overlay = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export function Content({ detail, isValidatingOnChange, onClose, onSubmit, onVer
</Button>

{!isNewPriorNotification && (
<Button
<SyledButtonWithIcon
accent={Accent.PRIMARY}
disabled={isReadOnly || isVerifiedAndSent}
Icon={isVerifiedAndSent ? Icon.Check : Icon.Send}
Expand All @@ -232,7 +232,7 @@ export function Content({ detail, isValidatingOnChange, onClose, onSubmit, onVer
}
>
{isVerifiedAndSent ? 'Diffusé' : 'Diffuser'}
</Button>
</SyledButtonWithIcon>
)}
</Footer>
</FrontendErrorBoundary>
Expand Down Expand Up @@ -291,17 +291,26 @@ const Intro = styled.p<{
`

const Footer = styled.div`
align-items: center;
border-top: 1px solid ${p => p.theme.color.lightGray};
column-gap: 8px;
display: flex;
justify-content: flex-end;
padding: 16px 32px;
min-height: 30px;
> .Element-Button:not(:first-child) {
margin-left: 8px;
> .Element-Button {
> span:last-child {
padding-top: 1px;
}
}
`

const SyledButtonWithIcon = styled(Button)`
align-items: stretch;
padding: 4px 12px;
> div {
margin-left: 8px;
> span {
align-items: center;
display: flex;
}
`
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Accent, Button, customDayjs, Dropdown, Icon } from '@mtes-mct/monitor-u
import { downloadAsPdf } from '@utils/downloadAsPdf'
import printJS from 'print-js'
import { useMemo } from 'react'
import styled from 'styled-components'

import { HTML_STYLE } from './template'
import { getHasAuthorizedLandingDownload, getHtmlContent } from './utils'
Expand Down Expand Up @@ -79,7 +80,12 @@ export function DownloadButton({
return (
<>
{hasAuthorizedLandingDownload && (
<Dropdown accent={Accent.SECONDARY} Icon={Icon.Download} placement="topEnd" title="Télécharger les documents">
<StyledDropdown
accent={Accent.SECONDARY}
Icon={Icon.Download}
placement="topEnd"
title="Télécharger les documents"
>
<>
{!isPriorNotificationDocumentAvailable && (
<Dropdown.Item disabled title="Document non généré">
Expand Down Expand Up @@ -107,7 +113,7 @@ export function DownloadButton({
</Dropdown.Item>
)}
</>
</Dropdown>
</StyledDropdown>
)}
{!hasAuthorizedLandingDownload && (
<>
Expand Down Expand Up @@ -137,3 +143,15 @@ export function DownloadButton({
</>
)
}

const StyledDropdown = styled(Dropdown)`
font-size: 13px;
* {
font-size: 13px;
}
> button {
padding: 3px 12px;
}
`
5 changes: 5 additions & 0 deletions frontend/src/features/SideWindow/components/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ import styled from 'styled-components'
import { NoRsuiteOverrideWrapper } from '../../../ui/NoRsuiteOverrideWrapper'

export const Page = styled(NoRsuiteOverrideWrapper)`
box-sizing: border-box;
display: flex;
flex-direction: column;
flex-grow: 1;
margin-bottom: 20px;
overflow: auto;
* {
box-sizing: border-box;
}
`

0 comments on commit a324b6a

Please sign in to comment.