Skip to content

Commit

Permalink
Sidebar (#1228)
Browse files Browse the repository at this point in the history
* Flytt sidebarklasse ut av panel

.. slik at vi kan slette panel

* klasse sidebar på VenstreVinduContainer

* Fix warning
  • Loading branch information
bjornreppen authored Apr 1, 2019
1 parent c51ff34 commit 2b35d03
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
44 changes: 23 additions & 21 deletions src/Grunnkart/Grunnkart.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,27 +210,29 @@ class Grunnkart extends React.Component {
}}
>
{context.aktivTab === "meny" && (
<VenstreVinduContainer
aktiveLag={this.state.aktiveLag}
mapBounds={this.state.actualBounds}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
onFitBounds={this.handleFitBounds}
erAktivert={erAktivert}
opplystKode={this.state.opplystKode}
onToggleLayer={() => {
this.handleToggleLayer();
if (!context.visAktiveLag) context.onToggleAktiveLag();
}}
onRemoveSelectedLayer={this.handleRemoveSelectedLayer}
meta={this.state.meta}
searchFor={this.state.searchFor}
onClearSearchFor={this.handleClearSearchFor}
onUpdateLayerProp={this.handleUpdateLayerProp}
onUpdateMetaProp={this.handleUpdateMetaProp}
visAktiveLag={context.visAktiveLag}
onToggleAktiveLag={context.onToggleAktiveLag}
/>
<div className="sidebar">
<VenstreVinduContainer
aktiveLag={this.state.aktiveLag}
mapBounds={this.state.actualBounds}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
onFitBounds={this.handleFitBounds}
erAktivert={erAktivert}
opplystKode={this.state.opplystKode}
onToggleLayer={() => {
this.handleToggleLayer();
if (!context.visAktiveLag) context.onToggleAktiveLag();
}}
onRemoveSelectedLayer={this.handleRemoveSelectedLayer}
meta={this.state.meta}
searchFor={this.state.searchFor}
onClearSearchFor={this.handleClearSearchFor}
onUpdateLayerProp={this.handleUpdateLayerProp}
onUpdateMetaProp={this.handleUpdateMetaProp}
visAktiveLag={context.visAktiveLag}
onToggleAktiveLag={context.onToggleAktiveLag}
/>
</div>
)}
<Kart
bounds={this.state.fitBounds}
Expand Down
9 changes: 6 additions & 3 deletions src/Informasjon/Informasjon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import "./Informasjon.css";

const Informasjon = props => {
if (props.location.pathname !== "/") return null;
const [turnOffInfo, setturnOffInfo] = useState("på");
const [showInfo, setShowInfo] = useState(true);
return (
<React.Fragment>
{turnOffInfo !== "turn off" && (
{showInfo !== "turn off" && (
<div
className="info_component"
onClick={() => props.history.push("/Natur_i_Norge/Landskap/")}
onClick={() => {
props.history.push("/Natur_i_Norge/Landskap/");
setShowInfo(false);
}}
>
<div className="infoBox">
<div className="top_image">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Panel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";

const Panel = ({ children }) => <div className="sidebar">{children}</div>;
const Panel = ({ children }) => <div>{children}</div>;

export default Panel;

0 comments on commit 2b35d03

Please sign in to comment.