Skip to content

Commit

Permalink
Fix basemap selector style (#1569)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt authored Oct 2, 2024
2 parents 4102a88 + 42fd007 commit 1865ae6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

- _view-sync_ did not clean up unpublished boreholes.
- User permissions were not checked when detaching files from boreholes.
- The basemap selector buttons were not displayed correctly on hover

## v2.1.870 - 2024-09-27

Expand Down
17 changes: 11 additions & 6 deletions src/client/src/components/basemapSelector/basemapSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ const BasemapSelectorBox = styled(Box)({
borderRadius: "100px",
});

const BasemapButton = styled(Button)({
const BasemapSelectorButton = styled(Button)({
borderRadius: "50%",
padding: 0,
animationTimingFunction: "ease-in-out",
animationDuration: "0.4s",
minWidth: 0,
margin: 0,
"&:hover": {
opacity: "60%",
},
});

const BasemapButton = styled(BasemapSelectorButton)({
height: "40px",
width: "40px",
marginRight: theme.spacing(1.5),
marginTop: theme.spacing(0.5),
marginBottom: theme.spacing(0.5),
});

const ImageBox = styled(Box)({
borderRadius: "50%",
display: "block",
Expand Down Expand Up @@ -75,8 +82,6 @@ export const BasemapSelector = memo(({ marginBottom }: { marginBottom: string })
<ImageBox
sx={{
border: `${layer.name === currentBasemapName ? "2px solid #cb5d53" : "none"}`,
marginRight: "1em",
marginLeft: 0,
}}>
{layer && <img alt={layer.name} src={imageUrlMap[layer.name]} />}
</ImageBox>
Expand All @@ -96,15 +101,15 @@ export const BasemapSelector = memo(({ marginBottom }: { marginBottom: string })
</Box>
</Stack>
) : (
<BasemapButton onClick={toggleShowSelector}>
<BasemapSelectorButton onClick={toggleShowSelector}>
{currentBasemapName == "nomap" ? (
<LargerImageBox></LargerImageBox>
) : (
<LargerImageBox>
{currentBasemapName && <img alt={currentBasemapName} src={imageUrlMap[currentBasemapName]} />}
</LargerImageBox>
)}
</BasemapButton>
</BasemapSelectorButton>
)}
</BasemapSelectorBox>
);
Expand Down

0 comments on commit 1865ae6

Please sign in to comment.