Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced filters frontend #473

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"author": "Arsalaan Ansari",
"license": "ISC",
"dependencies": {
"@material-ui/core": "^4.11.4",
"cors": "^2.8.5",
"express": "^4.16.3",
"mysql": "^2.16.0",
Expand Down
74 changes: 74 additions & 0 deletions src/client/src/components/RangeSlider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React from 'react';
import { makeStyles, withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Slider from '@material-ui/core/Slider';

const useStyles = makeStyles({
root: {
width: 300,
},
});

function valuetext(value) {
return `${value}`;
}

const MySlider = withStyles({
root: {
color: '#62a8e5',
height: 8,
},
thumb: {
height: 24,
width: 24,
backgroundColor: '#fff',
border: '2px solid currentColor',
marginTop: -8,
marginLeft: -12,
'&:focus, &:hover, &$active': {
boxShadow: 'inherit',
},
},
active: {},
valueLabel: {
left: -6,
top: 4,
'& *': {
background: 'transparent',
color: '#000',
},
},
track: {
height: 8,
borderRadius: 4,
},
rail: {
height: 8,
borderRadius: 4,
},
})(Slider);

export default function RangeSlider() {
const classes = useStyles();
const [value, setValue] = React.useState([2, 8]);

const handleChange = (event, newValue) => {
setValue(newValue);
};

return (
<div className={classes.root}>
<MySlider
value={value}
onChange={handleChange}
valueLabelDisplay="auto"
aria-labelledby="range-slider"
getAriaValueText={valuetext}
min = {1}
max = {10}
step = {1}
valueLabelDisplay = "on"
/>
</div>
);
}
Loading