Skip to content

Commit c396217

Browse files
authored
Hotfix – Corrige les boutons du menu de gauche (#3658)
## Linked issues None ---- - [ ] Tests E2E (Cypress)
2 parents 4fae5df + 1a58a3a commit c396217

File tree

2 files changed

+46
-57
lines changed

2 files changed

+46
-57
lines changed

frontend/src/features/LayersSidebar/components/index.tsx

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { AdministrativeZones } from '../../AdministrativeZone/components/Adminis
1111
import { BaseMaps } from '../../BaseMap/components/BaseMaps'
1212
import { MapComponent } from '../../commonStyles/MapComponent'
1313
import { CustomZones } from '../../CustomZone/components/CustomZones'
14+
import { MapButton } from '../../MainWindow/components/MapButtons/MapButton'
1415
import { RegulationSearch } from '../../Regulation/components/RegulationSearch'
1516
import { RegulatoryZoneMetadata } from '../../Regulation/components/RegulatoryZoneMetadata'
1617
import { RegulatoryZones } from '../../Regulation/components/RegulatoryZones'
@@ -35,20 +36,19 @@ export function LayersSidebar() {
3536
<NamespaceContext.Consumer>
3637
{namespace => (
3738
<>
38-
<SidebarLayersIcon
39-
$hasHealthcheckTextWarning={!!healthcheckTextWarning.length}
40-
$isActive={leftMapBoxOpened === MapBox.REGULATIONS || regulatoryZoneMetadataPanelIsOpen}
41-
$isHidden={!!previewFilteredVesselsMode}
42-
accent={Accent.PRIMARY}
43-
aria-label="Arbre des couches"
44-
Icon={Icon.MapLayers}
45-
onClick={() =>
46-
dispatch(setLeftMapBoxOpened(leftMapBoxOpened === MapBox.REGULATIONS ? undefined : MapBox.REGULATIONS))
47-
}
48-
size={Size.LARGE}
49-
title="Arbre des couches"
50-
/>
51-
39+
<SidebarLayersButton isHidden={!!previewFilteredVesselsMode}>
40+
<SidebarLayersIcon
41+
$isActive={leftMapBoxOpened === MapBox.REGULATIONS || regulatoryZoneMetadataPanelIsOpen}
42+
accent={Accent.PRIMARY}
43+
aria-label="Arbre des couches"
44+
Icon={Icon.MapLayers}
45+
onClick={() =>
46+
dispatch(setLeftMapBoxOpened(leftMapBoxOpened === MapBox.REGULATIONS ? undefined : MapBox.REGULATIONS))
47+
}
48+
size={Size.LARGE}
49+
title="Arbre des couches"
50+
/>
51+
</SidebarLayersButton>
5252
<Sidebar
5353
$isOpen={leftMapBoxOpened === MapBox.REGULATIONS}
5454
$isVisible={leftMapBoxOpened === MapBox.REGULATIONS || regulatoryZoneMetadataPanelIsOpen}
@@ -117,19 +117,16 @@ const Layers = styled.div<{
117117
max-height: calc(100vh - ${p => (p.$hasHealthcheckTextWarning ? '210px' : '160px')});
118118
`
119119

120-
const SidebarLayersIcon = styled(IconButton)<{
121-
$hasHealthcheckTextWarning: boolean
122-
$isActive: boolean
123-
$isHidden: boolean
124-
}>`
125-
${p => (p.$isActive ? `background: ${p.theme.color.blueGray};` : '')}
126-
${p => (p.$isActive ? `border-color: ${p.theme.color.blueGray};` : '')}
127-
border-radius: 2px;
128-
height: 40px;
129-
left: 10px;
130-
margin-top: ${p => (p.$hasHealthcheckTextWarning ? 50 : 0)}px;
120+
const SidebarLayersButton = styled(MapButton)`
131121
position: absolute;
132122
top: 10px;
133-
visibility: ${p => (p.$isHidden ? 'hidden' : 'visible')};
123+
left: 10px;
124+
`
125+
126+
const SidebarLayersIcon = styled(IconButton)<{ $isActive: boolean }>`
127+
border-radius: 2px;
134128
width: 40px;
129+
height: 40px;
130+
${p => (p.$isActive ? `background: ${p.theme.color.blueGray};` : '')}
131+
${p => (p.$isActive ? `border-color: ${p.theme.color.blueGray};` : '')}
135132
`

frontend/src/features/PriorNotification/components/PriorNotificationListButton.tsx

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { RTK_FORCE_REFETCH_QUERY_OPTIONS, RTK_THIRTY_SECONDS_POLLING_QUERY_OPTIONS } from '@api/constants'
22
import { ALL_SEAFRONT_GROUP } from '@constants/seafront'
3+
import { MapButton } from '@features/MainWindow/components/MapButtons/MapButton'
34
import { useGetPriorNotificationsToVerifyQuery } from '@features/PriorNotification/priorNotificationApi'
45
import { sideWindowActions } from '@features/SideWindow/slice'
56
import { openSideWindowPath } from '@features/SideWindow/useCases/openSideWindowPath'
@@ -43,40 +44,31 @@ export function PriorNotificationListButton() {
4344
}
4445

4546
return (
46-
<PriorNotificationListIcon
47-
$isActive={isActive}
48-
$isHidden={!!previewFilteredVesselsMode}
49-
$isSuperUser={isSuperUser}
50-
accent={Accent.PRIMARY}
51-
aria-label="Afficher la liste des préavis"
52-
badgeNumber={data?.perSeafrontGroupCount && data?.perSeafrontGroupCount[ALL_SEAFRONT_GROUP]}
53-
Icon={Icon.Fishery}
54-
onClick={toggleSideWindow}
55-
size={Size.LARGE}
56-
title="Afficher la liste des préavis"
57-
/>
47+
<Wrapper $isSuperUser={isSuperUser} isHidden={!!previewFilteredVesselsMode}>
48+
<PriorNotificationListIcon
49+
$isActive={isActive}
50+
accent={Accent.PRIMARY}
51+
aria-label="Afficher la liste des préavis"
52+
badgeNumber={data?.perSeafrontGroupCount && data?.perSeafrontGroupCount[ALL_SEAFRONT_GROUP]}
53+
Icon={Icon.Fishery}
54+
onClick={toggleSideWindow}
55+
size={Size.LARGE}
56+
title="Afficher la liste des préavis"
57+
/>
58+
</Wrapper>
5859
)
5960
}
6061

61-
const PriorNotificationListIcon = styled(IconButton)<{
62-
$hasHealthcheckTextWarning?: boolean | undefined
63-
$isActive: boolean
64-
$isHidden?: boolean | undefined
65-
$isSuperUser: boolean
66-
}>`
67-
${p => (p.$isActive ? `background: ${p.theme.color.blueGray};` : '')}
68-
${p => (p.$isActive ? `border-color: ${p.theme.color.blueGray};` : '')}
69-
border-radius: 2px;
70-
height: 40px;
71-
left: 10px;
72-
margin-top: ${p => (p.$hasHealthcheckTextWarning ? 50 : 0)}px;
62+
const Wrapper = styled(MapButton)<{ $isSuperUser: boolean }>`
7363
position: absolute;
74-
top: ${p => (p.$isSuperUser ? 282 : 170)}px;
75-
visibility: ${p => (p.$isHidden ? 'hidden' : 'visible')};
76-
width: 40px;
64+
top: ${p => (p.$isSuperUser ? 232 : 120)}px;
65+
left: 10px;
66+
`
7767

78-
> button {
79-
height: 40px;
80-
width: 40px;
81-
}
68+
const PriorNotificationListIcon = styled(IconButton)<{ $isActive: boolean }>`
69+
border-radius: 2px;
70+
width: 40px;
71+
height: 40px;
72+
${p => (p.$isActive ? `background: ${p.theme.color.blueGray};` : '')}
73+
${p => (p.$isActive ? `border-color: ${p.theme.color.blueGray};` : '')}
8274
`

0 commit comments

Comments
 (0)