Fix ThemeSwitcher style and map click
This commit is contained in:
parent
e87e334edd
commit
4939c1dfb0
@ -1,4 +1,4 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component, Fragment } from 'react';
|
||||||
import { Map, TileLayer, ZoomControl, AttributionControl } from 'react-leaflet-universal';
|
import { Map, TileLayer, ZoomControl, AttributionControl } from 'react-leaflet-universal';
|
||||||
|
|
||||||
import '../../node_modules/leaflet/dist/leaflet.css'
|
import '../../node_modules/leaflet/dist/leaflet.css'
|
||||||
@ -71,6 +71,7 @@ class ColouringMap extends Component {
|
|||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<Fragment>
|
||||||
<Map
|
<Map
|
||||||
center={position}
|
center={position}
|
||||||
zoom={this.state.zoom}
|
zoom={this.state.zoom}
|
||||||
@ -86,8 +87,9 @@ class ColouringMap extends Component {
|
|||||||
{ highlightLayer }
|
{ highlightLayer }
|
||||||
<ZoomControl position="topright" />
|
<ZoomControl position="topright" />
|
||||||
<AttributionControl prefix="" />
|
<AttributionControl prefix="" />
|
||||||
<ThemeSwitcher onSubmit={this.themeSwitch} currentTheme={this.state.theme} />
|
|
||||||
</Map>
|
</Map>
|
||||||
|
<ThemeSwitcher onSubmit={this.themeSwitch} currentTheme={this.state.theme} />
|
||||||
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,22 @@
|
|||||||
.theme-switcher {
|
.theme-switcher {
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 30px;
|
bottom: 55px;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
float: right;
|
float: right;
|
||||||
background: white;
|
background: white;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 380px){
|
||||||
|
.theme-switcher {
|
||||||
|
bottom: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (min-width: 1020px){
|
||||||
|
.theme-switcher {
|
||||||
|
bottom: 24px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.theme-switcher .btn {
|
.theme-switcher .btn {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -4,7 +4,8 @@ import './theme-switcher.css';
|
|||||||
|
|
||||||
const ThemeSwitcher = (props) => (
|
const ThemeSwitcher = (props) => (
|
||||||
<form class={`theme-switcher ${props.currentTheme}`} onSubmit={props.onSubmit}>
|
<form class={`theme-switcher ${props.currentTheme}`} onSubmit={props.onSubmit}>
|
||||||
<button class="btn btn-outline btn-outline-dark" type="submit">
|
<button class="btn btn-outline btn-outline-dark"
|
||||||
|
type="submit">
|
||||||
Switch theme ({(props.currentTheme === 'light')? 'Light' : 'Night'})
|
Switch theme ({(props.currentTheme === 'light')? 'Light' : 'Night'})
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user