-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSideMap.tsx
51 lines (46 loc) · 1.05 KB
/
SideMap.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import styled from 'styled-components';
import MapCaller from './Map/MapCaller';
const StyledAside = styled.aside`
min-height: 100%;
`;
const StyledMap = styled.div`
position: sticky;
top: 40px;
`;
const StyledLink = styled.a`
color: ${(props) => props.theme.color.links};
text-decoration-line: underline;
word-break: break-word;
width: fit-content;
:hover {
cursor: pointer;
}
`;
const SideMap = ({ mapData, isMapExpanded, setIsMapExpanded }) => {
return (
<StyledAside>
<StyledMap>
{!isMapExpanded && (
<>
<MapCaller
initialData={mapData}
height="230px"
width="230px"
expanded={false}
/>
<StyledLink
data-testid="expand-map"
onClick={(e) => {
e.preventDefault();
setIsMapExpanded(true);
}}
>
Expand
</StyledLink>
</>
)}
</StyledMap>
</StyledAside>
);
};
export default SideMap;