File tree Expand file tree Collapse file tree 4 files changed +22
-6
lines changed Expand file tree Collapse file tree 4 files changed +22
-6
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 @@ -4,15 +4,18 @@ import { FC } from "react";
44import { MapContainer , ZoomControl } from "react-leaflet" ;
55
66import { CONFIG } from "./config" ;
7+ import { HeightContainer } from "./HeightContainer" ;
78import { LayersSwitcher } from "./LayersSwitcher" ;
89import { Pins } from "./Pins" ;
910
1011const { MAP , ZOOM_CONTROL } = CONFIG ;
1112
1213export const Geomap : FC = ( ) => (
13- < MapContainer { ...MAP } className = "geomap_container" >
14- < ZoomControl { ...ZOOM_CONTROL } />
15- < LayersSwitcher />
16- < Pins />
17- </ MapContainer >
14+ < HeightContainer >
15+ < MapContainer { ...MAP } className = "geomap_container" >
16+ < ZoomControl { ...ZOOM_CONTROL } />
17+ < LayersSwitcher />
18+ < Pins />
19+ </ MapContainer >
20+ </ HeightContainer >
1821) ;
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 z-index : 0 ;
77}
You can’t perform that action at this time.
0 commit comments