-
+
+
-
setExpandedSmallAccordion(!isExpandedSmallAccordion)}
@@ -84,7 +83,7 @@ export function RegulatoryAreas({
/>
)
})}
-
+
)
}
@@ -92,3 +91,9 @@ export function RegulatoryAreas({
const StyledLayerList = styled(LayerSelector.LayerList)`
height: auto;
`
+const StyledPanel = styled(RegulatoryPanel)<{ $marginLeft: number }>`
+ left: ${p =>
+ `calc(
+ ${p.$marginLeft}px + 40px + 64px
+ )`}; // 40px is the padding, 64px is the width of the sidebar
+`
diff --git a/frontend/src/features/Dashboard/components/DashboardForm/SmallAccordion.tsx b/frontend/src/features/Dashboard/components/DashboardForm/SelectedAccordion.tsx
similarity index 81%
rename from frontend/src/features/Dashboard/components/DashboardForm/SmallAccordion.tsx
rename to frontend/src/features/Dashboard/components/DashboardForm/SelectedAccordion.tsx
index c3ce599f1..999518be1 100644
--- a/frontend/src/features/Dashboard/components/DashboardForm/SmallAccordion.tsx
+++ b/frontend/src/features/Dashboard/components/DashboardForm/SelectedAccordion.tsx
@@ -1,7 +1,7 @@
import { Accent, Icon, IconButton } from '@mtes-mct/monitor-ui'
import styled from 'styled-components'
-type AccordionProps = {
+type SelectedAccordionProps = {
children: React.ReactNode
isExpanded: boolean
isReadOnly?: boolean
@@ -9,16 +9,20 @@ type AccordionProps = {
title: string
}
-export function SmallAccordion({
+export function SelectedAccordion({
children,
isExpanded,
isReadOnly = false,
setExpandedAccordion,
title
-}: AccordionProps) {
+}: SelectedAccordionProps) {
return (
-
+
{title}
@@ -31,7 +35,9 @@ export function SmallAccordion({
/>
)}
- {children}
+
+ {children}
+
)
}
@@ -39,7 +45,6 @@ export function SmallAccordion({
const AccordionContainer = styled.div`
background-color: ${p => p.theme.color.blueGray25};
box-shadow: 0px 3px 6px #70778540;
- cursor: pointer;
padding-bottom: 4px;
`
const StyledIconButton = styled(IconButton)<{ $isExpanded: boolean }>`
@@ -48,6 +53,7 @@ const StyledIconButton = styled(IconButton)<{ $isExpanded: boolean }>`
`
const AccordionHeader = styled.header`
color: ${p => p.theme.color.blueYonder};
+ cursor: pointer;
display: flex;
font-weight: 500;
justify-content: space-between;
diff --git a/frontend/src/features/Dashboard/components/DashboardForm/index.tsx b/frontend/src/features/Dashboard/components/DashboardForm/index.tsx
index 9e4da3899..d32dd4432 100644
--- a/frontend/src/features/Dashboard/components/DashboardForm/index.tsx
+++ b/frontend/src/features/Dashboard/components/DashboardForm/index.tsx
@@ -3,7 +3,7 @@ import { SideWindowContent } from '@features/SideWindow/style'
import { useAppDispatch } from '@hooks/useAppDispatch'
import { useAppSelector } from '@hooks/useAppSelector'
import { Accent, Icon, IconButton } from '@mtes-mct/monitor-ui'
-import { useState } from 'react'
+import { useRef, useState } from 'react'
import styled from 'styled-components'
import { Accordion } from './Accordion'
@@ -13,6 +13,9 @@ import { dashboardActions } from '../../slice'
export function DashboardForm() {
const extractedArea = useAppSelector(state => state.dashboard.extractedArea)
+ const firstColumnRef = useRef
(null)
+ const firstColumnWidth = firstColumnRef.current?.clientWidth
+
const dispatch = useAppDispatch()
const dashboardId = 1 // TODO replace with real value
const [expandedAccordionFirstColumn, setExpandedAccordionFirstColumn] = useState(
@@ -51,8 +54,9 @@ export function DashboardForm() {
return (
-
+