File tree Expand file tree Collapse file tree 5 files changed +35
-19
lines changed Expand file tree Collapse file tree 5 files changed +35
-19
lines changed Original file line number Diff line number Diff line change 1+ import { FC , PropsWithChildren } from "react" ;
2+ import { useSelector } from "react-redux" ;
3+
4+ import { getMapHeight } from "./selectors" ;
5+
6+ export const HeightContainer : FC < PropsWithChildren > = ( { children } ) => {
7+ const height = useSelector ( getMapHeight ) ;
8+
9+ return < div style = { { height } } > { children } </ div > ;
10+ } ;
Original file line number Diff line number Diff line change 1+ import { State } from "@/js/types" ;
2+
3+ export const getMapHeight = ( state : State ) => state . chart . height ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { useData } from "@/hooks/useData";
88import { selectPaper } from "@/js/actions" ;
99import { AllPossiblePapersType } from "@/js/types" ;
1010
11+ import { HeightContainer } from "./HeightContainer" ;
1112import { OPTIONS } from "./options" ;
1213import { Pin } from "./Pin" ;
1314import { getHoveredItemId , getSelectedItemId } from "./selectors" ;
@@ -28,22 +29,24 @@ export const Geomap: FC = () => {
2829 ) ;
2930
3031 return (
31- < MapContainer { ...MAP } className = "geomap_container" >
32- < TileLayer { ...LAYER } />
33- { filteredData &&
34- filteredData . map ( ( item ) => {
35- const { safe_id : id } = item ;
36- const isActive = selectedItemId === id || hoveredItemId === id ;
37-
38- return (
39- < Pin
40- key = { id + isActive }
41- data = { item }
42- isActive = { isActive }
43- onClick = { handlePinClick }
44- />
45- ) ;
46- } ) }
47- </ MapContainer >
32+ < HeightContainer >
33+ < MapContainer className = "geomap_container" { ...MAP } >
34+ < TileLayer { ...LAYER } />
35+ { filteredData &&
36+ filteredData . map ( ( item ) => {
37+ const { safe_id : id } = item ;
38+ const isActive = selectedItemId === id || hoveredItemId === id ;
39+
40+ return (
41+ < Pin
42+ key = { id + isActive }
43+ data = { item }
44+ isActive = { isActive }
45+ onClick = { handlePinClick }
46+ />
47+ ) ;
48+ } ) }
49+ </ MapContainer >
50+ </ HeightContainer >
4851 ) ;
4952} ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { Options } from "./types";
33export const OPTIONS : Options = {
44 MAP : {
55 center : [ 48.216651235748074 , 16.39589688527869 ] ,
6- zoom : 4 ,
6+ zoom : 2 ,
77 minZoom : 2 ,
88 maxBounds : [
99 [ - 85 , - 180 ] ,
Original file line number Diff line number Diff line change 11/* ########### Geomap ########### */
22
33.geomap_container {
4- height : 100 vh ;
4+ height : 100 % ;
55 width : 100% ;
66}
77
You can’t perform that action at this time.
0 commit comments