Skip to content

Commit

Permalink
Align items in add new layer modal
Browse files Browse the repository at this point in the history
Signed-off-by: Junqiu Lei <[email protected]>
  • Loading branch information
junqiu-lei committed Feb 18, 2023
1 parent 816ce79 commit ca91a05
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
15 changes: 14 additions & 1 deletion public/components/add_layer_panel/add_layer_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,18 @@
}

.addLayerDialog__description {
width: 272px;
width: 16 * $euiSizeM;
}

.addLayer__types {
width: 5 * $euiSizeL;
height: 5 * $euiSizeL;
}

.addLayer__modalBody {
padding: 0;

.addLayer__selection {
width: 10 * $euiSizeL
}
}
16 changes: 8 additions & 8 deletions public/components/add_layer_panel/add_layer_panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
EuiKeyPadMenuItem,
EuiSpacer,
EuiText,
EuiKeyPadMenu,
} from '@elastic/eui';
import './add_layer_panel.scss';
import {
Expand Down Expand Up @@ -77,6 +78,7 @@ export const AddLayerPanel = ({
onMouseEnter={() => setHighlightItem(layerItem)}
onMouseLeave={() => setHighlightItem(null)}
onBlur={() => setHighlightItem(null)}
className={'addLayer__types'}
>
<EuiIcon type={layerItem.icon} size="xl" color="secondary" />
</EuiKeyPadMenuItem>
Expand All @@ -95,6 +97,7 @@ export const AddLayerPanel = ({
onMouseEnter={() => setHighlightItem(layerItem)}
onMouseLeave={() => setHighlightItem(null)}
onBlur={() => setHighlightItem(null)}
className="addLayer__types"
>
<EuiIcon type={layerItem.icon} size="xl" color="secondary" />
</EuiKeyPadMenuItem>
Expand Down Expand Up @@ -141,27 +144,24 @@ export const AddLayerPanel = ({
<h2>Add layer</h2>
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<EuiModalBody className="addLayer__modalBody">
<EuiFlexGroup>
<EuiFlexItem>
<EuiFlexItem className="addLayer__selection">
<EuiTitle size="s">
<h6>Data layer</h6>
</EuiTitle>
<EuiSpacer size="s" />
<EuiFlexGroup gutterSize="xs">{dataLayerItems}</EuiFlexGroup>
<EuiSpacer size="s" />
<EuiKeyPadMenu>{dataLayerItems}</EuiKeyPadMenu>
<EuiHorizontalRule margin="xs" />
<EuiSpacer size="m" />
<EuiTitle size="s">
<h6>Base layer</h6>
</EuiTitle>
<EuiSpacer size="s" />
<EuiFlexGroup gutterSize="xs">{baseLayersItems}</EuiFlexGroup>
<EuiKeyPadMenu>{baseLayersItems}</EuiKeyPadMenu>
</EuiFlexItem>
<EuiFlexItem className="addLayerDialog__description">
<EuiTitle size="s">
<h6>{highlightItem?.name ? highlightItem.name : 'Select a layer type'}</h6>
</EuiTitle>
<EuiSpacer size="m" />
<EuiText>
{highlightItem?.description
? highlightItem.description
Expand Down

0 comments on commit ca91a05

Please sign in to comment.