Decrease map page height if banner is enabled (for #272)
This commit is contained in:
parent
5cfc8aae39
commit
fc930fe433
2 changed files with 12 additions and 2 deletions
|
@ -4,6 +4,7 @@ import { connect } from "react-redux";
|
||||||
import { Button } from "semantic-ui-react";
|
import { Button } from "semantic-ui-react";
|
||||||
import { Layer, Source } from "react-map-gl";
|
import { Layer, Source } from "react-map-gl";
|
||||||
import produce from "immer";
|
import produce from "immer";
|
||||||
|
import classNames from "classnames";
|
||||||
|
|
||||||
import type { Location } from "types";
|
import type { Location } from "types";
|
||||||
import { Page, Map } from "components";
|
import { Page, Map } from "components";
|
||||||
|
@ -110,7 +111,7 @@ const getEventsTextLayer = () => ({
|
||||||
});
|
});
|
||||||
|
|
||||||
function MapPage({ login }) {
|
function MapPage({ login }) {
|
||||||
const { obsMapSource } = useConfig() || {};
|
const { obsMapSource, banner } = useConfig() || {};
|
||||||
const [clickLocation, setClickLocation] = useState<Location | null>(null);
|
const [clickLocation, setClickLocation] = useState<Location | null>(null);
|
||||||
|
|
||||||
const mapConfig = useMapConfig();
|
const mapConfig = useMapConfig();
|
||||||
|
@ -198,7 +199,12 @@ function MapPage({ login }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page fullScreen title="Map">
|
<Page fullScreen title="Map">
|
||||||
<div className={styles.mapContainer}>
|
<div
|
||||||
|
className={classNames(
|
||||||
|
styles.mapContainer,
|
||||||
|
banner ? styles.hasBanner : null
|
||||||
|
)}
|
||||||
|
>
|
||||||
{layerSidebar && (
|
{layerSidebar && (
|
||||||
<div className={styles.mapSidebar}>
|
<div className={styles.mapSidebar}>
|
||||||
<LayerSidebar />
|
<LayerSidebar />
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
|
||||||
|
&.hasBanner {
|
||||||
|
height: calc(100vh - @menuHeight - 50px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mapSidebar {
|
.mapSidebar {
|
||||||
|
|
Loading…
Add table
Reference in a new issue