Skip to content

Commit 1979f2d

Browse files
authored
Fixed layers UI bug (#416)
2 parents 207d1b1 + f4af3df commit 1979f2d

File tree

2 files changed

+57
-73
lines changed

2 files changed

+57
-73
lines changed

frontend/src/components/MapView/MapOptions.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,9 @@
158158
font-size: 2rem;
159159
border-top-width: 1px;
160160
}
161+
162+
.layers-container {
163+
display: flex;
164+
gap: 1rem;
165+
padding: 1rem;
166+
}

frontend/src/components/MapView/MapOptions.tsx

Lines changed: 51 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Fragment, useContext, useState } from "react";
2-
import { Paper, Popover, Grid, Typography, Box, Tooltip } from "@mui/material";
2+
import { Popover, Typography, Box, Tooltip } from "@mui/material";
33
import "./MapOptions.css";
44
import { Polygon, StackSimple, ThreeD } from "@phosphor-icons/react";
55
import SearchBar from "../SearchBar/SearchBar";
@@ -103,78 +103,56 @@ const MapOptions: React.FC<MapOptionsProps> = ({
103103
horizontal: "right",
104104
}}
105105
>
106-
<Paper
107-
elevation={3}
108-
sx={{
109-
padding: "25px",
110-
borderRadius: "8px",
111-
backgroundColor: "#f9f9f9",
112-
width: "250px",
113-
height: "100px",
114-
}}
115-
>
116-
<Grid
117-
container
118-
spacing={2}
119-
justifyContent="center"
120-
alignItems="center"
121-
>
122-
<Grid item>
123-
<Box textAlign="center" sx={{ marginLeft: 2 }}>
124-
<img
125-
className="image-hover-effect"
126-
src="/normal_view.png"
127-
alt="Normal"
128-
width="50"
129-
height="50"
130-
onClick={() => {
131-
handleMapTypeChange(MapTypes.Normal);
132-
handleClose();
133-
}}
134-
/>
135-
<Typography variant="body2" sx={{ marginTop: 0.5 }}>
136-
Normal
137-
</Typography>
138-
</Box>
139-
</Grid>
140-
<Grid item>
141-
<Box textAlign="center" sx={{ marginLeft: 2 }}>
142-
<img
143-
className="image-hover-effect"
144-
src="/satellite_view.png"
145-
alt="Satellite"
146-
width="50"
147-
height="50"
148-
onClick={() => {
149-
handleMapTypeChange(MapTypes.Satellite);
150-
handleClose();
151-
}}
152-
/>
153-
<Typography variant="body2" sx={{ marginTop: 0.5 }}>
154-
Satellite
155-
</Typography>
156-
</Box>
157-
</Grid>
158-
<Grid item>
159-
<Box textAlign="center" sx={{ marginLeft: 2 }}>
160-
<img
161-
className="image-hover-effect"
162-
src="/aerial_view.png"
163-
alt="Aerial"
164-
width="50"
165-
height="50"
166-
onClick={() => {
167-
handleMapTypeChange(MapTypes.Aerial);
168-
handleClose();
169-
}}
170-
/>
171-
<Typography variant="body2" sx={{ marginTop: 0.5 }}>
172-
dop40c
173-
</Typography>
174-
</Box>
175-
</Grid>
176-
</Grid>
177-
</Paper>
106+
<div className="layers-container">
107+
<Box textAlign="center">
108+
<img
109+
className="image-hover-effect"
110+
src="/normal_view.png"
111+
alt="Normal"
112+
width="50"
113+
height="50"
114+
onClick={() => {
115+
handleMapTypeChange(MapTypes.Normal);
116+
handleClose();
117+
}}
118+
/>
119+
<Typography variant="body2" sx={{ marginTop: 0.5 }}>
120+
Normal
121+
</Typography>
122+
</Box>
123+
<Box textAlign="center">
124+
<img
125+
className="image-hover-effect"
126+
src="/satellite_view.png"
127+
alt="Satellite"
128+
width="50"
129+
height="50"
130+
onClick={() => {
131+
handleMapTypeChange(MapTypes.Satellite);
132+
handleClose();
133+
}}
134+
/>
135+
<Typography variant="body2" sx={{ marginTop: 0.5 }}>
136+
Satellite
137+
</Typography>
138+
</Box>
139+
<Box textAlign="center">
140+
<img
141+
className="image-hover-effect"
142+
src="/aerial_view.png"
143+
alt="Aerial"
144+
width="50"
145+
height="50"
146+
onClick={() => {
147+
handleMapTypeChange(MapTypes.Aerial);
148+
handleClose();
149+
}}
150+
/>
151+
<Typography variant="body2" sx={{ marginTop: 0.5 }}>
152+
dop40c
153+
</Typography>
154+
</Box>
155+
</div>
178156
</Popover>
179157
</div>
180158
);

0 commit comments

Comments
 (0)