mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-22 09:41:26 -08:00
adding three sliders
This commit is contained in:
parent
81e7027a4e
commit
b31ce9101c
2 changed files with 37 additions and 3 deletions
26
justice40-frontend/src/components/map-slider.js
Normal file
26
justice40-frontend/src/components/map-slider.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import React, {useState} from 'react';
|
||||||
|
|
||||||
|
function MapSlider(props){
|
||||||
|
const [value, setValue] = useState(0);
|
||||||
|
return (
|
||||||
|
<div className="slider-container">
|
||||||
|
<label
|
||||||
|
className="usa-label"
|
||||||
|
htmlFor="usa-range">
|
||||||
|
{props.rangeName}
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
id="usa-range"
|
||||||
|
className="usa-range"
|
||||||
|
onChange={e => setValue(e.target.value)}
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
step="20"
|
||||||
|
value="60"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MapSlider;
|
|
@ -1,10 +1,14 @@
|
||||||
import React from 'react';
|
import React, {useState} from 'react';
|
||||||
import Layout from '../components/layout';
|
import Layout from '../components/layout';
|
||||||
import SEO from '../components/seo';
|
import SEO from '../components/seo';
|
||||||
import OlMapWrapper from '../components/ol-map-wrapper';
|
import OlMapWrapper from '../components/ol-map-wrapper';
|
||||||
|
import MapSlider from '../components/map-slider';
|
||||||
import * as styles from "./index.module.css";
|
import * as styles from "./index.module.css";
|
||||||
|
|
||||||
const IndexPage = () => {
|
|
||||||
|
function IndexPage(props) {
|
||||||
|
const [heat, setHeat] = useState("");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<SEO title="Justice 40 Home" />
|
<SEO title="Justice 40 Home" />
|
||||||
|
@ -13,7 +17,11 @@ const IndexPage = () => {
|
||||||
<div className="grid-col-8">
|
<div className="grid-col-8">
|
||||||
<OlMapWrapper />
|
<OlMapWrapper />
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-col-4"></div>
|
<div className="grid-col-4">
|
||||||
|
<MapSlider rangeName="Heat" />
|
||||||
|
<MapSlider rangeName="Poverty" />
|
||||||
|
<MapSlider rangeName="Environmental" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
Loading…
Add table
Reference in a new issue