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 Sep 26, 2024
1 parent 9d3e805 commit 7e1e041
Show file tree
Hide file tree
Showing 4 changed files with 41 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 @@ -246,7 +246,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 @@ -258,7 +258,7 @@ export function Content({ detail, isValidatingOnChange, onClose, onSubmit, onVer
}
>
{isVerifiedAndSent ? 'Diffusé' : 'Diffuser'}
</Button>
</SyledButtonWithIcon>
)}
</Footer>
</FrontendErrorBoundary>
Expand Down Expand Up @@ -327,17 +327,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 @@ -11,6 +11,7 @@ import { Accent, Button, customDayjs, Dropdown, Icon } from '@mtes-mct/monitor-u
import { downloadFile } from '@utils/downloadFile'
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 @@ -86,7 +87,7 @@ export function DownloadButton({
return (
<>
{hasAuthorizedLandingDownload && (
<Dropdown accent={Accent.SECONDARY} Icon={Icon.Download} placement="topEnd" title="Télécharger">
<StyledDropdown accent={Accent.SECONDARY} Icon={Icon.Download} placement="topEnd" title="Télécharger">
<>
{!isPriorNotificationDocumentAvailable && (
<Dropdown.Item disabled title="Document non généré">
Expand Down Expand Up @@ -114,7 +115,7 @@ export function DownloadButton({
</Dropdown.Item>
)}
</>
</Dropdown>
</StyledDropdown>
)}
{!hasAuthorizedLandingDownload && (
<>
Expand Down Expand Up @@ -144,3 +145,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 7e1e041

Please sign in to comment.