@@ -11,6 +11,7 @@ import { AdministrativeZones } from '../../AdministrativeZone/components/Adminis
11
11
import { BaseMaps } from '../../BaseMap/components/BaseMaps'
12
12
import { MapComponent } from '../../commonStyles/MapComponent'
13
13
import { CustomZones } from '../../CustomZone/components/CustomZones'
14
+ import { MapButton } from '../../MainWindow/components/MapButtons/MapButton'
14
15
import { RegulationSearch } from '../../Regulation/components/RegulationSearch'
15
16
import { RegulatoryZoneMetadata } from '../../Regulation/components/RegulatoryZoneMetadata'
16
17
import { RegulatoryZones } from '../../Regulation/components/RegulatoryZones'
@@ -35,20 +36,19 @@ export function LayersSidebar() {
35
36
< NamespaceContext . Consumer >
36
37
{ namespace => (
37
38
< >
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 >
52
52
< Sidebar
53
53
$isOpen = { leftMapBoxOpened === MapBox . REGULATIONS }
54
54
$isVisible = { leftMapBoxOpened === MapBox . REGULATIONS || regulatoryZoneMetadataPanelIsOpen }
@@ -117,19 +117,16 @@ const Layers = styled.div<{
117
117
max-height: calc(100vh - ${ p => ( p . $hasHealthcheckTextWarning ? '210px' : '160px' ) } );
118
118
`
119
119
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 ) `
131
121
position: absolute;
132
122
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;
134
128
width: 40px;
129
+ height: 40px;
130
+ ${ p => ( p . $isActive ? `background: ${ p . theme . color . blueGray } ;` : '' ) }
131
+ ${ p => ( p . $isActive ? `border-color: ${ p . theme . color . blueGray } ;` : '' ) }
135
132
`
0 commit comments