-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #876 from adamkendis/FRONT-client-layout
Metadata fetching, expanding filter menu, desktop layout
- Loading branch information
Showing
16 changed files
with
272 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,18 @@ | ||
/* eslint-disable */ | ||
// temporarily disabling eslint here until v2 refactor | ||
import React from 'react'; | ||
import { | ||
Switch, | ||
Route, | ||
Redirect, | ||
} from 'react-router-dom'; | ||
|
||
import PrivacyPolicy from '@components/privacyPolicy/PrivacyPolicy'; | ||
import Contact from './components/contact/Contact'; | ||
import About from './components/about/About'; | ||
import Body from './components/main/body/Body'; | ||
import Faq from './components/faq/Faq'; | ||
import Desktop from '@components/main/Desktop'; | ||
|
||
export default function Routes() { | ||
return ( | ||
<Switch> | ||
<Route path="/contact" component={Contact} /> | ||
<Route path="/about" component={About} /> | ||
<Route path="/privacy" component={PrivacyPolicy} /> | ||
<Route path="/comparison" component={Body} /> | ||
<Route path="/faq" component={Faq} /> | ||
<Route path="/data" component={Body} /> | ||
<Route path="/" component={About} /> | ||
<Route path="/map" component={Desktop} /> | ||
<Route path="/"> | ||
<Redirect to="map" /> | ||
</Route> | ||
</Switch> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import React, { useState } from 'react'; | ||
import PropTypes from 'proptypes'; | ||
import { connect } from 'react-redux'; | ||
import { toggleMenu as reduxToggleMenu } from '@reducers/ui'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
|
||
import Card from '@material-ui/core/Card'; | ||
import CardHeader from '@material-ui/core/CardHeader'; | ||
import CardContent from '@material-ui/core/CardContent'; | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown'; | ||
import ArrowDropUpIcon from '@material-ui/icons/ArrowDropUp'; | ||
import Collapse from '@material-ui/core/Collapse'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import GearButton from '../GearButton'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
card: { | ||
width: 300, | ||
backgroundColor: theme.palette.primary.main, | ||
position: 'absolute', | ||
left: 35, | ||
top: 75, | ||
borderRadius: 10, | ||
zIndex: 2000, | ||
}, | ||
header: { | ||
color: theme.palette.text.cyan, | ||
padding: 5, | ||
paddingRight: 0, | ||
}, | ||
headerAction: { | ||
margin: 'auto', | ||
}, | ||
headerTitle: { | ||
marginLeft: 10, | ||
fontSize: 20, | ||
fontWeight: 600, | ||
letterSpacing: '2px', | ||
}, | ||
button: { | ||
padding: 5, | ||
paddingRight: 0, | ||
color: theme.palette.text.dark, | ||
'&:hover': { | ||
backgroundColor: theme.palette.primary.main, | ||
}, | ||
'& svg': { | ||
fontSize: 30, | ||
}, | ||
}, | ||
})); | ||
|
||
const FilterMenu = ({ | ||
toggleMenu, | ||
}) => { | ||
const [expanded, setExpanded] = useState(false); | ||
const classes = useStyles(); | ||
|
||
// TODO: add basic/advanced toggle switch | ||
return ( | ||
<Card className={classes.card}> | ||
<CardHeader | ||
classes={{ | ||
root: classes.header, | ||
action: classes.headerAction, | ||
}} | ||
title={( | ||
<> | ||
<GearButton | ||
aria-label="toggle map menu" | ||
onClick={toggleMenu} | ||
/> | ||
<Typography | ||
className={classes.headerTitle} | ||
component="span" | ||
> | ||
FILTERS | ||
</Typography> | ||
</> | ||
)} | ||
action={( | ||
<IconButton | ||
className={classes.button} | ||
aria-label="toggle filter menu" | ||
onClick={() => setExpanded(prevExpanded => !prevExpanded)} | ||
disableFocusRipple | ||
disableRipple | ||
> | ||
{expanded ? <ArrowDropUpIcon /> : <ArrowDropDownIcon /> } | ||
</IconButton> | ||
)} | ||
/> | ||
<Collapse in={expanded}> | ||
<CardContent> | ||
TODO: Selectors | ||
</CardContent> | ||
</Collapse> | ||
</Card> | ||
); | ||
}; | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
toggleMenu: () => dispatch(reduxToggleMenu()), | ||
}); | ||
|
||
export default connect(null, mapDispatchToProps)(FilterMenu); | ||
|
||
FilterMenu.propTypes = { | ||
toggleMenu: PropTypes.func.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.